Changeset View
Changeset View
Standalone View
Standalone View
webenginepart/src/webenginepage.h
Show All 34 Lines | |||||
35 | #include <QScopedPointer> | 35 | #include <QScopedPointer> | ||
36 | 36 | | |||
37 | class QAuthenticator; | 37 | class QAuthenticator; | ||
38 | class QUrl; | 38 | class QUrl; | ||
39 | class WebSslInfo; | 39 | class WebSslInfo; | ||
40 | class WebEnginePart; | 40 | class WebEnginePart; | ||
41 | class QWebEngineDownloadItem; | 41 | class QWebEngineDownloadItem; | ||
42 | class KPasswdServerClient; | 42 | class KPasswdServerClient; | ||
43 | class WebEngineWallet; | ||||
43 | 44 | | |||
44 | class WebEnginePage : public QWebEnginePage | 45 | class WebEnginePage : public QWebEnginePage | ||
45 | { | 46 | { | ||
46 | Q_OBJECT | 47 | Q_OBJECT | ||
47 | public: | 48 | public: | ||
48 | explicit WebEnginePage(WebEnginePart *wpart, QWidget *parent = Q_NULLPTR); | 49 | explicit WebEnginePage(WebEnginePart *wpart, QWidget *parent = Q_NULLPTR); | ||
49 | ~WebEnginePage(); | 50 | ~WebEnginePage(); | ||
50 | 51 | | |||
51 | /** | 52 | /** | ||
52 | * Returns the SSL information for the current page. | 53 | * Returns the SSL information for the current page. | ||
53 | * | 54 | * | ||
54 | * @see WebSslInfo. | 55 | * @see WebSslInfo. | ||
55 | */ | 56 | */ | ||
56 | const WebSslInfo& sslInfo() const; | 57 | const WebSslInfo& sslInfo() const; | ||
57 | 58 | | |||
58 | /** | 59 | /** | ||
59 | * Sets the page's SSL information to @p other. | 60 | * Sets the page's SSL information to @p other. | ||
60 | * | 61 | * | ||
61 | * @see WebSslInfo | 62 | * @see WebSslInfo | ||
62 | */ | 63 | */ | ||
63 | void setSslInfo (const WebSslInfo &other); | 64 | void setSslInfo (const WebSslInfo &other); | ||
64 | 65 | | |||
65 | void download(const QUrl &url, bool newWindow = false); | 66 | void download(const QUrl &url, bool newWindow = false); | ||
66 | 67 | | |||
68 | WebEngineWallet* wallet() const {return m_wallet;} | ||||
69 | | ||||
67 | Q_SIGNALS: | 70 | Q_SIGNALS: | ||
68 | /** | 71 | /** | ||
69 | * This signal is emitted whenever a user cancels/aborts a load resource | 72 | * This signal is emitted whenever a user cancels/aborts a load resource | ||
70 | * request. | 73 | * request. | ||
71 | */ | 74 | */ | ||
72 | void loadAborted(const QUrl &url); | 75 | void loadAborted(const QUrl &url); | ||
73 | 76 | | |||
74 | void navigationRequested(WebEnginePage* page, const QUrl& url); | 77 | void navigationRequested(WebEnginePage* page, const QUrl& url); | ||
Show All 27 Lines | 104 | protected Q_SLOTS: | |||
102 | void slotLoadFinished(bool ok); | 105 | void slotLoadFinished(bool ok); | ||
103 | void slotUnsupportedContent(QNetworkReply* reply); | 106 | void slotUnsupportedContent(QNetworkReply* reply); | ||
104 | virtual void slotGeometryChangeRequested(const QRect& rect); | 107 | virtual void slotGeometryChangeRequested(const QRect& rect); | ||
105 | void slotFeaturePermissionRequested(const QUrl& url, QWebEnginePage::Feature feature); | 108 | void slotFeaturePermissionRequested(const QUrl& url, QWebEnginePage::Feature feature); | ||
106 | void slotAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth); | 109 | void slotAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth); | ||
107 | 110 | | |||
108 | private: | 111 | private: | ||
109 | bool checkLinkSecurity(const QNetworkRequest& req, NavigationType type) const; | 112 | bool checkLinkSecurity(const QNetworkRequest& req, NavigationType type) const; | ||
110 | bool checkFormData(const QNetworkRequest& req) const; | 113 | bool checkFormData(const QUrl& url) const; | ||
111 | bool handleMailToUrl (const QUrl& , NavigationType type) const; | 114 | bool handleMailToUrl (const QUrl& , NavigationType type) const; | ||
112 | void setPageJScriptPolicy(const QUrl& url); | 115 | void setPageJScriptPolicy(const QUrl& url); | ||
113 | 116 | | |||
114 | private: | 117 | private: | ||
115 | enum WebEnginePageSecurity { PageUnencrypted, PageEncrypted, PageMixed }; | 118 | enum WebEnginePageSecurity { PageUnencrypted, PageEncrypted, PageMixed }; | ||
116 | 119 | | |||
117 | int m_kioErrorCode; | 120 | int m_kioErrorCode; | ||
118 | bool m_ignoreError; | 121 | bool m_ignoreError; | ||
119 | 122 | | |||
120 | WebSslInfo m_sslInfo; | 123 | WebSslInfo m_sslInfo; | ||
121 | QPointer<WebEnginePart> m_part; | 124 | QPointer<WebEnginePart> m_part; | ||
122 | 125 | | |||
123 | QScopedPointer<KPasswdServerClient> m_passwdServerClient; | 126 | QScopedPointer<KPasswdServerClient> m_passwdServerClient; | ||
127 | WebEngineWallet *m_wallet; | ||||
124 | }; | 128 | }; | ||
125 | 129 | | |||
126 | 130 | | |||
127 | /** | 131 | /** | ||
128 | * This is a fake implementation of WebEnginePage to workaround the ugly API used | 132 | * This is a fake implementation of WebEnginePage to workaround the ugly API used | ||
129 | * to request for the creation of a new window from javascript in QtWebEngine. PORTING_TODO | 133 | * to request for the creation of a new window from javascript in QtWebEngine. PORTING_TODO | ||
130 | * | 134 | * | ||
131 | * The KPart API for creating new windows requires all the information about the | 135 | * The KPart API for creating new windows requires all the information about the | ||
Show All 21 Lines | 154 | private Q_SLOTS: | |||
153 | void slotStatusBarVisibilityChangeRequested(bool visible); | 157 | void slotStatusBarVisibilityChangeRequested(bool visible); | ||
154 | void slotToolBarVisibilityChangeRequested(bool visible); | 158 | void slotToolBarVisibilityChangeRequested(bool visible); | ||
155 | void slotLoadFinished(bool); | 159 | void slotLoadFinished(bool); | ||
156 | 160 | | |||
157 | private: | 161 | private: | ||
158 | KParts::WindowArgs m_windowArgs; | 162 | KParts::WindowArgs m_windowArgs; | ||
159 | WebWindowType m_type; | 163 | WebWindowType m_type; | ||
160 | bool m_createNewWindow; | 164 | bool m_createNewWindow; | ||
165 | WebEngineWallet* m_wallet; | ||||
161 | }; | 166 | }; | ||
162 | 167 | | |||
163 | #endif // WEBENGINEPAGE_H | 168 | #endif // WEBENGINEPAGE_H |