Merge lp:~uriboni/oxide/basic-authentication into lp:~oxide-developers/oxide/oxide.trunk
- basic-authentication
- Merge into oxide.trunk
Status: | Merged |
---|---|
Merged at revision: | 1152 |
Proposed branch: | lp:~uriboni/oxide/basic-authentication |
Merge into: | lp:~oxide-developers/oxide/oxide.trunk |
Diff against target: |
1029 lines (+714/-5) 23 files modified
qt/core/api/oxideqhttpauthenticationrequest.cc (+103/-0) qt/core/api/oxideqhttpauthenticationrequest.h (+64/-0) qt/core/api/oxideqhttpauthenticationrequest_p.h (+47/-0) qt/core/browser/oxide_qt_web_view.cc (+8/-0) qt/core/browser/oxide_qt_web_view.h (+3/-0) qt/core/core.gyp (+9/-0) qt/core/glue/oxide_qt_web_view_proxy_client.h (+4/-0) qt/qmlplugin/oxide_qml_plugin.cc (+5/-0) qt/quick/api/oxideqquickwebview.cc (+26/-0) qt/quick/api/oxideqquickwebview_p.h (+1/-0) qt/quick/api/oxideqquickwebview_p_p.h (+2/-0) qt/tests/qmltests/TestWebView.qml (+1/-1) qt/tests/qmltests/api/tst_httpAuthentication.py (+31/-0) qt/tests/qmltests/api/tst_httpAuthentication.qml (+142/-0) shared/browser/oxide_resource_dispatcher_host_delegate.cc (+14/-3) shared/browser/oxide_resource_dispatcher_host_delegate.h (+8/-0) shared/browser/oxide_resource_dispatcher_host_login_delegate.cc (+162/-0) shared/browser/oxide_resource_dispatcher_host_login_delegate.h (+65/-0) shared/browser/oxide_web_view.cc (+6/-1) shared/browser/oxide_web_view.h (+4/-0) shared/browser/oxide_web_view_client.cc (+3/-0) shared/browser/oxide_web_view_client.h (+4/-0) shared/shared.gyp (+2/-0) |
To merge this branch: | bzr merge lp:~uriboni/oxide/basic-authentication |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Coulson | Needs Fixing | ||
Olivier Tilloy (community) | Needs Fixing | ||
Review via email: mp+260922@code.launchpad.net |
Commit message
Implements basic authentication support
Description of the change
Implements basic authentication support.
- 1084. By Ugo Riboni
-
Fix the oxide version used in unit tests
- 1085. By Ugo Riboni
-
Simplify and fix unit tests
Olivier Tilloy (osomon) wrote : | # |
I’m seeing this really weird warning when running unit tests locally:
1: QWARN : qml-api-
I don’t see how WebView_
Olivier Tilloy (osomon) wrote : | # |
In qt/core/core.gyp, file paths should be kept sorted alphabetically.
Chris Coulson (chrisccoulson) wrote : | # |
Thanks for this - I've left some comments inline.
One general point - there's a mixture of 2-space and 4-space indentation. Please stick to 2-space (using 4-space only for wrapped lines). We try to adhere to the Chromium style guide on this - see http://
Also, what happens if the application doesn't connect a handler, or does connect one but allows the request object to be garbage collected before responding to it? Oxide should take the default action - ie, deny - but it doesn't look like that will happen here. Please take a look at how this is handled for permission requests, and there should also be a test case for this as well.
Chris Coulson (chrisccoulson) wrote : | # |
I've just added a couple more comments for things I missed
- 1086. By Ugo Riboni
-
Reorder alphabetically the gyp file
- 1087. By Ugo Riboni
-
Merge upstream changes
- 1088. By Ugo Riboni
-
Fix indentation
- 1089. By Ugo Riboni
-
Remove check on login_delegate as it can not be null
- 1090. By Ugo Riboni
-
Remove the cancellation callback when the QT class is destroyed, for safety
- 1091. By Ugo Riboni
-
Remove some useless code
- 1092. By Ugo Riboni
-
Rename *basicAuthentic
ation* to *httpAuthentica tion* since we are also handling digest auth - 1093. By Ugo Riboni
-
Mark some properties as constant since we only assign them at construction
- 1094. By Ugo Riboni
-
Make private and hidden the constructor of OxideQHttpAuthe
nticationReques t since it can only be created from within the webview - 1095. By Ugo Riboni
-
Invalidate the pointer to the delegate when the request is cancelled, as it will be deleted by chromium immediately after. Check that we have a valid pointer before calling through it elsewhere.
- 1096. By Ugo Riboni
-
Fix some indentation
- 1097. By Ugo Riboni
-
Rename tests
- 1098. By Ugo Riboni
-
Remove non-useful null pointer check
- 1099. By Ugo Riboni
-
More properly ensure that data is accessed from the right thread
- 1100. By Ugo Riboni
-
Clear the callback in the right destructor
- 1101. By Ugo Riboni
-
Move ResourceDispatc
herHostLoginDel egate to is own source files, and remove another case of accessing the UrlRequest outside of the IO thread. - 1102. By Ugo Riboni
-
Remove Qt code that for some bizarre reason ended up in oxide and still compiles
- 1103. By Ugo Riboni
-
Simplify the code to access the WebView
- 1104. By Ugo Riboni
-
Deny the authentication if the request object is ignored and gets destroyed. Add test for this case.
Chris Coulson (chrisccoulson) wrote : | # |
I've added some more comments inline
Olivier Tilloy (osomon) wrote : | # |
Preview Diff
1 | === added file 'qt/core/api/oxideqhttpauthenticationrequest.cc' | |||
2 | --- qt/core/api/oxideqhttpauthenticationrequest.cc 1970-01-01 00:00:00 +0000 | |||
3 | +++ qt/core/api/oxideqhttpauthenticationrequest.cc 2015-06-18 16:37:15 +0000 | |||
4 | @@ -0,0 +1,103 @@ | |||
5 | 1 | // vim:expandtab:shiftwidth=2:tabstop=2: | ||
6 | 2 | // Copyright (C) 2015 Canonical Ltd. | ||
7 | 3 | |||
8 | 4 | // This library is free software; you can redistribute it and/or | ||
9 | 5 | // modify it under the terms of the GNU Lesser General Public | ||
10 | 6 | // License as published by the Free Software Foundation; either | ||
11 | 7 | // version 2.1 of the License, or (at your option) any later version. | ||
12 | 8 | |||
13 | 9 | // This library is distributed in the hope that it will be useful, | ||
14 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | 12 | // Lesser General Public License for more details. | ||
17 | 13 | |||
18 | 14 | // You should have received a copy of the GNU Lesser General Public | ||
19 | 15 | // License along with this library; if not, write to the Free Software | ||
20 | 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | 17 | |||
22 | 18 | #include "base/bind.h" | ||
23 | 19 | #include "base/callback.h" | ||
24 | 20 | |||
25 | 21 | #include "shared/browser/oxide_resource_dispatcher_host_login_delegate.h" | ||
26 | 22 | #include "qt/core/browser/oxide_qt_web_view.h" | ||
27 | 23 | |||
28 | 24 | #include "oxideqhttpauthenticationrequest.h" | ||
29 | 25 | #include "oxideqhttpauthenticationrequest_p.h" | ||
30 | 26 | |||
31 | 27 | OxideQHttpAuthenticationRequestPrivate::OxideQHttpAuthenticationRequestPrivate( | ||
32 | 28 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate) | ||
33 | 29 | : q_ptr(nullptr), | ||
34 | 30 | login_delegate_(login_delegate) { | ||
35 | 31 | // Use of base::Unretained is safe here because we clear the callback | ||
36 | 32 | // in the destructor, so that it can not called back on a deleted object | ||
37 | 33 | login_delegate->SetCancelledCallback( | ||
38 | 34 | base::Bind(&OxideQHttpAuthenticationRequestPrivate::RequestCancelled, | ||
39 | 35 | base::Unretained(this))); | ||
40 | 36 | } | ||
41 | 37 | |||
42 | 38 | OxideQHttpAuthenticationRequestPrivate::~OxideQHttpAuthenticationRequestPrivate() { | ||
43 | 39 | if (login_delegate_) { | ||
44 | 40 | login_delegate_->SetCancelledCallback(base::Closure()); | ||
45 | 41 | |||
46 | 42 | // Always deny the request when we are being destroyed, as it should be the | ||
47 | 43 | // default action in case the client ignores this request and it gets | ||
48 | 44 | // garbage collected. | ||
49 | 45 | // In case an action has already been taken, this is a essentially a no-op. | ||
50 | 46 | login_delegate_->Deny(); | ||
51 | 47 | } | ||
52 | 48 | } | ||
53 | 49 | |||
54 | 50 | void OxideQHttpAuthenticationRequestPrivate::RequestCancelled() { | ||
55 | 51 | Q_Q(OxideQHttpAuthenticationRequest); | ||
56 | 52 | |||
57 | 53 | login_delegate_ = nullptr; | ||
58 | 54 | q->cancelled(); | ||
59 | 55 | } | ||
60 | 56 | |||
61 | 57 | OxideQHttpAuthenticationRequest::OxideQHttpAuthenticationRequest( | ||
62 | 58 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate) | ||
63 | 59 | : d_ptr(new OxideQHttpAuthenticationRequestPrivate(login_delegate)) { | ||
64 | 60 | Q_D(OxideQHttpAuthenticationRequest); | ||
65 | 61 | d->q_ptr = this; | ||
66 | 62 | } | ||
67 | 63 | |||
68 | 64 | OxideQHttpAuthenticationRequest::~OxideQHttpAuthenticationRequest() {} | ||
69 | 65 | |||
70 | 66 | QString OxideQHttpAuthenticationRequest::host() const { | ||
71 | 67 | Q_D(const OxideQHttpAuthenticationRequest); | ||
72 | 68 | |||
73 | 69 | if (d->login_delegate_) { | ||
74 | 70 | return QString::fromStdString(d->login_delegate_->Host()); | ||
75 | 71 | } else { | ||
76 | 72 | return QString(); | ||
77 | 73 | } | ||
78 | 74 | } | ||
79 | 75 | |||
80 | 76 | QString OxideQHttpAuthenticationRequest::realm() const { | ||
81 | 77 | Q_D(const OxideQHttpAuthenticationRequest); | ||
82 | 78 | |||
83 | 79 | if (d->login_delegate_) { | ||
84 | 80 | return QString::fromStdString(d->login_delegate_->Realm()); | ||
85 | 81 | } else { | ||
86 | 82 | return QString(); | ||
87 | 83 | } | ||
88 | 84 | } | ||
89 | 85 | |||
90 | 86 | void OxideQHttpAuthenticationRequest::deny() { | ||
91 | 87 | Q_D(OxideQHttpAuthenticationRequest); | ||
92 | 88 | |||
93 | 89 | if (d->login_delegate_) { | ||
94 | 90 | d->login_delegate_->Deny(); | ||
95 | 91 | d->login_delegate_ = nullptr; | ||
96 | 92 | } | ||
97 | 93 | } | ||
98 | 94 | |||
99 | 95 | void OxideQHttpAuthenticationRequest::allow(const QString &username, | ||
100 | 96 | const QString &password) { | ||
101 | 97 | Q_D(OxideQHttpAuthenticationRequest); | ||
102 | 98 | |||
103 | 99 | if (d->login_delegate_) { | ||
104 | 100 | d->login_delegate_->Allow(username.toStdString(), password.toStdString()); | ||
105 | 101 | d->login_delegate_ = nullptr; | ||
106 | 102 | } | ||
107 | 103 | } | ||
108 | 0 | 104 | ||
109 | === added file 'qt/core/api/oxideqhttpauthenticationrequest.h' | |||
110 | --- qt/core/api/oxideqhttpauthenticationrequest.h 1970-01-01 00:00:00 +0000 | |||
111 | +++ qt/core/api/oxideqhttpauthenticationrequest.h 2015-06-18 16:37:15 +0000 | |||
112 | @@ -0,0 +1,64 @@ | |||
113 | 1 | // vim:expandtab:shiftwidth=2:tabstop=2: | ||
114 | 2 | // Copyright (C) 2015 Canonical Ltd. | ||
115 | 3 | |||
116 | 4 | // This library is free software; you can redistribute it and/or | ||
117 | 5 | // modify it under the terms of the GNU Lesser General Public | ||
118 | 6 | // License as published by the Free Software Foundation; either | ||
119 | 7 | // version 2.1 of the License, or (at your option) any later version. | ||
120 | 8 | |||
121 | 9 | // This library is distributed in the hope that it will be useful, | ||
122 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
123 | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
124 | 12 | // Lesser General Public License for more details. | ||
125 | 13 | |||
126 | 14 | // You should have received a copy of the GNU Lesser General Public | ||
127 | 15 | // License along with this library; if not, write to the Free Software | ||
128 | 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
129 | 17 | |||
130 | 18 | #ifndef OXIDE_Q_HTTP_AUTHENTICATION_REQUEST | ||
131 | 19 | #define OXIDE_Q_HTTP_AUTHENTICATION_REQUEST | ||
132 | 20 | |||
133 | 21 | #include <QObject> | ||
134 | 22 | #include <QScopedPointer> | ||
135 | 23 | #include <QString> | ||
136 | 24 | #include <QtGlobal> | ||
137 | 25 | |||
138 | 26 | class OxideQHttpAuthenticationRequestPrivate; | ||
139 | 27 | |||
140 | 28 | namespace oxide { | ||
141 | 29 | namespace qt { | ||
142 | 30 | class WebView; | ||
143 | 31 | } | ||
144 | 32 | class ResourceDispatcherHostLoginDelegate; | ||
145 | 33 | } | ||
146 | 34 | |||
147 | 35 | class Q_DECL_EXPORT OxideQHttpAuthenticationRequest : public QObject { | ||
148 | 36 | Q_OBJECT | ||
149 | 37 | Q_PROPERTY(QString host READ host CONSTANT) | ||
150 | 38 | Q_PROPERTY(QString realm READ realm CONSTANT) | ||
151 | 39 | |||
152 | 40 | Q_DECLARE_PRIVATE(OxideQHttpAuthenticationRequest) | ||
153 | 41 | Q_DISABLE_COPY(OxideQHttpAuthenticationRequest) | ||
154 | 42 | |||
155 | 43 | public: | ||
156 | 44 | ~OxideQHttpAuthenticationRequest(); | ||
157 | 45 | |||
158 | 46 | QString host() const; | ||
159 | 47 | QString realm() const; | ||
160 | 48 | |||
161 | 49 | Q_INVOKABLE void allow(const QString& username, const QString& password); | ||
162 | 50 | Q_INVOKABLE void deny(); | ||
163 | 51 | |||
164 | 52 | Q_SIGNALS: | ||
165 | 53 | void cancelled() const; | ||
166 | 54 | |||
167 | 55 | private: | ||
168 | 56 | Q_DECL_HIDDEN OxideQHttpAuthenticationRequest( | ||
169 | 57 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate); | ||
170 | 58 | |||
171 | 59 | QScopedPointer<OxideQHttpAuthenticationRequestPrivate> d_ptr; | ||
172 | 60 | |||
173 | 61 | friend class oxide::qt::WebView; | ||
174 | 62 | }; | ||
175 | 63 | |||
176 | 64 | #endif // OXIDE_Q_HTTP_AUTHENTICATION_REQUEST | ||
177 | 0 | 65 | ||
178 | === added file 'qt/core/api/oxideqhttpauthenticationrequest_p.h' | |||
179 | --- qt/core/api/oxideqhttpauthenticationrequest_p.h 1970-01-01 00:00:00 +0000 | |||
180 | +++ qt/core/api/oxideqhttpauthenticationrequest_p.h 2015-06-18 16:37:15 +0000 | |||
181 | @@ -0,0 +1,47 @@ | |||
182 | 1 | // vim:expandtab:shiftwidth=2:tabstop=2: | ||
183 | 2 | // Copyright (C) 2015 Canonical Ltd. | ||
184 | 3 | |||
185 | 4 | // This library is free software; you can redistribute it and/or | ||
186 | 5 | // modify it under the terms of the GNU Lesser General Public | ||
187 | 6 | // License as published by the Free Software Foundation; either | ||
188 | 7 | // version 2.1 of the License, or (at your option) any later version. | ||
189 | 8 | |||
190 | 9 | // This library is distributed in the hope that it will be useful, | ||
191 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
192 | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
193 | 12 | // Lesser General Public License for more details. | ||
194 | 13 | |||
195 | 14 | // You should have received a copy of the GNU Lesser General Public | ||
196 | 15 | // License along with this library; if not, write to the Free Software | ||
197 | 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
198 | 17 | |||
199 | 18 | #ifndef _OXIDE_QT_CORE_API_HTTP_AUTHENTICATION_REQUEST_P_H_ | ||
200 | 19 | #define _OXIDE_QT_CORE_API_HTTP_AUTHENTICATION_REQUEST_P_H_ | ||
201 | 20 | |||
202 | 21 | #include <QtGlobal> | ||
203 | 22 | #include <QString> | ||
204 | 23 | |||
205 | 24 | namespace oxide { | ||
206 | 25 | class ResourceDispatcherHostLoginDelegate; | ||
207 | 26 | } | ||
208 | 27 | |||
209 | 28 | class OxideQHttpAuthenticationRequest; | ||
210 | 29 | |||
211 | 30 | class OxideQHttpAuthenticationRequestPrivate { | ||
212 | 31 | Q_DECLARE_PUBLIC(OxideQHttpAuthenticationRequest) | ||
213 | 32 | |||
214 | 33 | public: | ||
215 | 34 | virtual ~OxideQHttpAuthenticationRequestPrivate(); | ||
216 | 35 | |||
217 | 36 | private: | ||
218 | 37 | OxideQHttpAuthenticationRequestPrivate( | ||
219 | 38 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate); | ||
220 | 39 | void RequestCancelled(); | ||
221 | 40 | |||
222 | 41 | OxideQHttpAuthenticationRequest* q_ptr; | ||
223 | 42 | QString realm_; | ||
224 | 43 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate_; | ||
225 | 44 | }; | ||
226 | 45 | |||
227 | 46 | #endif // _OXIDE_QT_CORE_API_HTTP_AUTHENTICATION_REQUEST_P_H_ | ||
228 | 47 | |||
229 | 0 | 48 | ||
230 | === modified file 'qt/core/browser/oxide_qt_web_view.cc' | |||
231 | --- qt/core/browser/oxide_qt_web_view.cc 2015-06-04 17:11:01 +0000 | |||
232 | +++ qt/core/browser/oxide_qt_web_view.cc 2015-06-18 16:37:15 +0000 | |||
233 | @@ -58,6 +58,7 @@ | |||
234 | 58 | 58 | ||
235 | 59 | #include "qt/core/api/oxideqdownloadrequest.h" | 59 | #include "qt/core/api/oxideqdownloadrequest.h" |
236 | 60 | #include "qt/core/api/oxideqloadevent.h" | 60 | #include "qt/core/api/oxideqloadevent.h" |
237 | 61 | #include "qt/core/api/oxideqhttpauthenticationrequest.h" | ||
238 | 61 | #include "qt/core/api/oxideqnavigationrequest.h" | 62 | #include "qt/core/api/oxideqnavigationrequest.h" |
239 | 62 | #include "qt/core/api/oxideqnewviewrequest.h" | 63 | #include "qt/core/api/oxideqnewviewrequest.h" |
240 | 63 | #include "qt/core/api/oxideqnewviewrequest_p.h" | 64 | #include "qt/core/api/oxideqnewviewrequest_p.h" |
241 | @@ -744,6 +745,13 @@ | |||
242 | 744 | client_->DownloadRequested(&download_request); | 745 | client_->DownloadRequested(&download_request); |
243 | 745 | } | 746 | } |
244 | 746 | 747 | ||
245 | 748 | void WebView::HttpAuthenticationRequested( | ||
246 | 749 | oxide::ResourceDispatcherHostLoginDelegate* login_delegate) { | ||
247 | 750 | // The client takes ownership of the request | ||
248 | 751 | client_->HttpAuthenticationRequested( | ||
249 | 752 | new OxideQHttpAuthenticationRequest(login_delegate)); | ||
250 | 753 | } | ||
251 | 754 | |||
252 | 747 | bool WebView::ShouldHandleNavigation(const GURL& url, | 755 | bool WebView::ShouldHandleNavigation(const GURL& url, |
253 | 748 | WindowOpenDisposition disposition, | 756 | WindowOpenDisposition disposition, |
254 | 749 | bool user_gesture) { | 757 | bool user_gesture) { |
255 | 750 | 758 | ||
256 | === modified file 'qt/core/browser/oxide_qt_web_view.h' | |||
257 | --- qt/core/browser/oxide_qt_web_view.h 2015-06-04 13:21:49 +0000 | |||
258 | +++ qt/core/browser/oxide_qt_web_view.h 2015-06-18 16:37:15 +0000 | |||
259 | @@ -141,6 +141,9 @@ | |||
260 | 141 | const std::string& cookies, | 141 | const std::string& cookies, |
261 | 142 | const std::string& referrer, | 142 | const std::string& referrer, |
262 | 143 | const std::string& user_agent) override; | 143 | const std::string& user_agent) override; |
263 | 144 | void HttpAuthenticationRequested( | ||
264 | 145 | ResourceDispatcherHostLoginDelegate* login_delegate) override; | ||
265 | 146 | |||
266 | 144 | bool ShouldHandleNavigation(const GURL& url, | 147 | bool ShouldHandleNavigation(const GURL& url, |
267 | 145 | WindowOpenDisposition disposition, | 148 | WindowOpenDisposition disposition, |
268 | 146 | bool user_gesture) override; | 149 | bool user_gesture) override; |
269 | 147 | 150 | ||
270 | === modified file 'qt/core/core.gyp' | |||
271 | --- qt/core/core.gyp 2015-06-07 20:27:38 +0000 | |||
272 | +++ qt/core/core.gyp 2015-06-18 16:37:15 +0000 | |||
273 | @@ -208,6 +208,7 @@ | |||
274 | 208 | 'sources': [ | 208 | 'sources': [ |
275 | 209 | '<(INTERMEDIATE_DIR)/moc_oxideqcertificateerror.cc', | 209 | '<(INTERMEDIATE_DIR)/moc_oxideqcertificateerror.cc', |
276 | 210 | '<(INTERMEDIATE_DIR)/moc_oxideqdownloadrequest.cc', | 210 | '<(INTERMEDIATE_DIR)/moc_oxideqdownloadrequest.cc', |
277 | 211 | '<(INTERMEDIATE_DIR)/moc_oxideqhttpauthenticationrequest.cc', | ||
278 | 211 | '<(INTERMEDIATE_DIR)/moc_oxideqloadevent.cc', | 212 | '<(INTERMEDIATE_DIR)/moc_oxideqloadevent.cc', |
279 | 212 | '<(INTERMEDIATE_DIR)/moc_oxideqmediacapturedevices.cc', | 213 | '<(INTERMEDIATE_DIR)/moc_oxideqmediacapturedevices.cc', |
280 | 213 | '<(INTERMEDIATE_DIR)/moc_oxideqnetworkcallbackevents.cc', | 214 | '<(INTERMEDIATE_DIR)/moc_oxideqnetworkcallbackevents.cc', |
281 | @@ -227,6 +228,9 @@ | |||
282 | 227 | 'api/oxideqdownloadrequest_p.h', | 228 | 'api/oxideqdownloadrequest_p.h', |
283 | 228 | 'api/oxideqglobal.cc', | 229 | 'api/oxideqglobal.cc', |
284 | 229 | 'api/oxideqglobal.h', | 230 | 'api/oxideqglobal.h', |
285 | 231 | 'api/oxideqhttpauthenticationrequest.cc', | ||
286 | 232 | 'api/oxideqhttpauthenticationrequest.h', | ||
287 | 233 | 'api/oxideqhttpauthenticationrequest_p.h', | ||
288 | 230 | 'api/oxideqloadevent.cc', | 234 | 'api/oxideqloadevent.cc', |
289 | 231 | 'api/oxideqloadevent.h', | 235 | 'api/oxideqloadevent.h', |
290 | 232 | 'api/oxideqloadevent_p.h', | 236 | 'api/oxideqloadevent_p.h', |
291 | @@ -272,6 +276,11 @@ | |||
292 | 272 | 'includes': [ 'moc.gypi' ] | 276 | 'includes': [ 'moc.gypi' ] |
293 | 273 | }, | 277 | }, |
294 | 274 | { | 278 | { |
295 | 279 | 'action_name': 'moc_oxideqhttpauthenticationrequest.cc', | ||
296 | 280 | 'moc_input': 'api/oxideqhttpauthenticationrequest.h', | ||
297 | 281 | 'includes': [ 'moc.gypi' ] | ||
298 | 282 | }, | ||
299 | 283 | { | ||
300 | 275 | 'action_name': 'moc_oxideqloadevent.cc', | 284 | 'action_name': 'moc_oxideqloadevent.cc', |
301 | 276 | 'moc_input': 'api/oxideqloadevent.h', | 285 | 'moc_input': 'api/oxideqloadevent.h', |
302 | 277 | 'includes': [ 'moc.gypi' ] | 286 | 'includes': [ 'moc.gypi' ] |
303 | 278 | 287 | ||
304 | === modified file 'qt/core/glue/oxide_qt_web_view_proxy_client.h' | |||
305 | --- qt/core/glue/oxide_qt_web_view_proxy_client.h 2015-05-27 20:56:59 +0000 | |||
306 | +++ qt/core/glue/oxide_qt_web_view_proxy_client.h 2015-06-18 16:37:15 +0000 | |||
307 | @@ -32,6 +32,7 @@ | |||
308 | 32 | class OxideQMediaAccessPermissionRequest; | 32 | class OxideQMediaAccessPermissionRequest; |
309 | 33 | class OxideQNavigationRequest; | 33 | class OxideQNavigationRequest; |
310 | 34 | class OxideQNewViewRequest; | 34 | class OxideQNewViewRequest; |
311 | 35 | class OxideQHttpAuthenticationRequest; | ||
312 | 35 | 36 | ||
313 | 36 | QT_BEGIN_NAMESPACE | 37 | QT_BEGIN_NAMESPACE |
314 | 37 | class QCursor; | 38 | class QCursor; |
315 | @@ -139,6 +140,9 @@ | |||
316 | 139 | 140 | ||
317 | 140 | virtual void DownloadRequested(OxideQDownloadRequest* download_request) = 0; | 141 | virtual void DownloadRequested(OxideQDownloadRequest* download_request) = 0; |
318 | 141 | 142 | ||
319 | 143 | virtual void HttpAuthenticationRequested( | ||
320 | 144 | OxideQHttpAuthenticationRequest* authentication_request) = 0; | ||
321 | 145 | |||
322 | 142 | virtual void CertificateError(OxideQCertificateError* cert_error) = 0; | 146 | virtual void CertificateError(OxideQCertificateError* cert_error) = 0; |
323 | 143 | 147 | ||
324 | 144 | virtual void ContentBlocked() = 0; // XXX(chrisccoulson): Rename to BlockedContentChanged throughout Oxide | 148 | virtual void ContentBlocked() = 0; // XXX(chrisccoulson): Rename to BlockedContentChanged throughout Oxide |
325 | 145 | 149 | ||
326 | === modified file 'qt/qmlplugin/oxide_qml_plugin.cc' | |||
327 | --- qt/qmlplugin/oxide_qml_plugin.cc 2015-06-05 18:43:21 +0000 | |||
328 | +++ qt/qmlplugin/oxide_qml_plugin.cc 2015-06-18 16:37:15 +0000 | |||
329 | @@ -25,6 +25,7 @@ | |||
330 | 25 | #include "qt/core/api/oxideqcertificateerror.h" | 25 | #include "qt/core/api/oxideqcertificateerror.h" |
331 | 26 | #include "qt/core/api/oxideqdownloadrequest.h" | 26 | #include "qt/core/api/oxideqdownloadrequest.h" |
332 | 27 | #include "qt/core/api/oxideqfindcontroller.h" | 27 | #include "qt/core/api/oxideqfindcontroller.h" |
333 | 28 | #include "qt/core/api/oxideqhttpauthenticationrequest.h" | ||
334 | 28 | #include "qt/core/api/oxideqloadevent.h" | 29 | #include "qt/core/api/oxideqloadevent.h" |
335 | 29 | #include "qt/core/api/oxideqnavigationrequest.h" | 30 | #include "qt/core/api/oxideqnavigationrequest.h" |
336 | 30 | #include "qt/core/api/oxideqnewviewrequest.h" | 31 | #include "qt/core/api/oxideqnewviewrequest.h" |
337 | @@ -136,6 +137,10 @@ | |||
338 | 136 | qmlRegisterType<OxideQQuickWebView, 4>(uri, 1, 8, "WebView"); | 137 | qmlRegisterType<OxideQQuickWebView, 4>(uri, 1, 8, "WebView"); |
339 | 137 | 138 | ||
340 | 138 | qmlRegisterType<OxideQQuickWebContext, 3>(uri, 1, 9, "WebContext"); | 139 | qmlRegisterType<OxideQQuickWebContext, 3>(uri, 1, 9, "WebContext"); |
341 | 140 | |||
342 | 141 | qmlRegisterUncreatableType<OxideQHttpAuthenticationRequest>(uri, 1, 9, "HttpAuthenticationRequest", | ||
343 | 142 | "HttpAuthenticationRequest is delivered by WebView.httpAuthenticationRequested"); | ||
344 | 143 | qmlRegisterType<OxideQQuickWebView, 5>(uri, 1, 9, "WebView"); | ||
345 | 139 | } | 144 | } |
346 | 140 | }; | 145 | }; |
347 | 141 | 146 | ||
348 | 142 | 147 | ||
349 | === modified file 'qt/quick/api/oxideqquickwebview.cc' | |||
350 | --- qt/quick/api/oxideqquickwebview.cc 2015-05-28 23:51:39 +0000 | |||
351 | +++ qt/quick/api/oxideqquickwebview.cc 2015-06-18 16:37:15 +0000 | |||
352 | @@ -43,6 +43,7 @@ | |||
353 | 43 | #include "qt/core/api/oxideqcertificateerror.h" | 43 | #include "qt/core/api/oxideqcertificateerror.h" |
354 | 44 | #include "qt/core/api/oxideqfindcontroller.h" | 44 | #include "qt/core/api/oxideqfindcontroller.h" |
355 | 45 | #include "qt/core/api/oxideqglobal.h" | 45 | #include "qt/core/api/oxideqglobal.h" |
356 | 46 | #include "qt/core/api/oxideqhttpauthenticationrequest.h" | ||
357 | 46 | #include "qt/core/api/oxideqloadevent.h" | 47 | #include "qt/core/api/oxideqloadevent.h" |
358 | 47 | #include "qt/core/api/oxideqnewviewrequest.h" | 48 | #include "qt/core/api/oxideqnewviewrequest.h" |
359 | 48 | #include "qt/core/api/oxideqpermissionrequest.h" | 49 | #include "qt/core/api/oxideqpermissionrequest.h" |
360 | @@ -461,6 +462,31 @@ | |||
361 | 461 | 462 | ||
362 | 462 | } | 463 | } |
363 | 463 | 464 | ||
364 | 465 | void OxideQQuickWebViewPrivate::HttpAuthenticationRequested( | ||
365 | 466 | OxideQHttpAuthenticationRequest* authentication_request) { | ||
366 | 467 | Q_Q(OxideQQuickWebView); | ||
367 | 468 | |||
368 | 469 | // See the comment in RequestGeolocationPermission | ||
369 | 470 | |||
370 | 471 | QQmlEngine* engine = qmlEngine(q); | ||
371 | 472 | if (!engine) { | ||
372 | 473 | delete authentication_request; | ||
373 | 474 | return; | ||
374 | 475 | } | ||
375 | 476 | |||
376 | 477 | { | ||
377 | 478 | QJSValue val = engine->newQObject(authentication_request); | ||
378 | 479 | if (!val.isQObject()) { | ||
379 | 480 | delete authentication_request; | ||
380 | 481 | return; | ||
381 | 482 | } | ||
382 | 483 | |||
383 | 484 | emit q->httpAuthenticationRequested(val); | ||
384 | 485 | } | ||
385 | 486 | |||
386 | 487 | engine->collectGarbage(); | ||
387 | 488 | } | ||
388 | 489 | |||
389 | 464 | void OxideQQuickWebViewPrivate::HandleUnhandledKeyboardEvent( | 490 | void OxideQQuickWebViewPrivate::HandleUnhandledKeyboardEvent( |
390 | 465 | QKeyEvent* event) { | 491 | QKeyEvent* event) { |
391 | 466 | Q_Q(OxideQQuickWebView); | 492 | Q_Q(OxideQQuickWebView); |
392 | 467 | 493 | ||
393 | === modified file 'qt/quick/api/oxideqquickwebview_p.h' | |||
394 | --- qt/quick/api/oxideqquickwebview_p.h 2015-05-28 23:51:39 +0000 | |||
395 | +++ qt/quick/api/oxideqquickwebview_p.h 2015-06-18 16:37:15 +0000 | |||
396 | @@ -356,6 +356,7 @@ | |||
397 | 356 | Q_REVISION(2) void prepareToCloseResponse(bool proceed); | 356 | Q_REVISION(2) void prepareToCloseResponse(bool proceed); |
398 | 357 | Q_REVISION(2) void closeRequested(); | 357 | Q_REVISION(2) void closeRequested(); |
399 | 358 | Q_REVISION(4) void webProcessStatusChanged(); | 358 | Q_REVISION(4) void webProcessStatusChanged(); |
400 | 359 | Q_REVISION(5) void httpAuthenticationRequested(const QJSValue& request); | ||
401 | 359 | 360 | ||
402 | 360 | // Deprecated since 1.3 | 361 | // Deprecated since 1.3 |
403 | 361 | void loadingChanged(OxideQLoadEvent* loadEvent); | 362 | void loadingChanged(OxideQLoadEvent* loadEvent); |
404 | 362 | 363 | ||
405 | === modified file 'qt/quick/api/oxideqquickwebview_p_p.h' | |||
406 | --- qt/quick/api/oxideqquickwebview_p_p.h 2015-05-28 23:51:39 +0000 | |||
407 | +++ qt/quick/api/oxideqquickwebview_p_p.h 2015-06-18 16:37:15 +0000 | |||
408 | @@ -135,6 +135,8 @@ | |||
409 | 135 | void EvictCurrentFrame() override; | 135 | void EvictCurrentFrame() override; |
410 | 136 | void SetInputMethodEnabled(bool enabled) override; | 136 | void SetInputMethodEnabled(bool enabled) override; |
411 | 137 | void DownloadRequested(OxideQDownloadRequest* download_request) override; | 137 | void DownloadRequested(OxideQDownloadRequest* download_request) override; |
412 | 138 | void HttpAuthenticationRequested( | ||
413 | 139 | OxideQHttpAuthenticationRequest* authentication_request) override; | ||
414 | 138 | void CertificateError(OxideQCertificateError* cert_error) override; | 140 | void CertificateError(OxideQCertificateError* cert_error) override; |
415 | 139 | void ContentBlocked() override; | 141 | void ContentBlocked() override; |
416 | 140 | void PrepareToCloseResponse(bool proceed) override; | 142 | void PrepareToCloseResponse(bool proceed) override; |
417 | 141 | 143 | ||
418 | === modified file 'qt/tests/qmltests/TestWebView.qml' | |||
419 | --- qt/tests/qmltests/TestWebView.qml 2015-05-15 15:03:10 +0000 | |||
420 | +++ qt/tests/qmltests/TestWebView.qml 2015-06-18 16:37:15 +0000 | |||
421 | @@ -1,6 +1,6 @@ | |||
422 | 1 | import QtQuick 2.0 | 1 | import QtQuick 2.0 |
423 | 2 | import QtTest 1.0 | 2 | import QtTest 1.0 |
425 | 3 | import com.canonical.Oxide 1.8 | 3 | import com.canonical.Oxide 1.9 |
426 | 4 | import com.canonical.Oxide.Testing 1.0 as Testing | 4 | import com.canonical.Oxide.Testing 1.0 as Testing |
427 | 5 | import "TestUtils.js" as TestUtils | 5 | import "TestUtils.js" as TestUtils |
428 | 6 | 6 | ||
429 | 7 | 7 | ||
430 | === added file 'qt/tests/qmltests/api/tst_httpAuthentication.py' | |||
431 | --- qt/tests/qmltests/api/tst_httpAuthentication.py 1970-01-01 00:00:00 +0000 | |||
432 | +++ qt/tests/qmltests/api/tst_httpAuthentication.py 2015-06-18 16:37:15 +0000 | |||
433 | @@ -0,0 +1,31 @@ | |||
434 | 1 | from cStringIO import StringIO | ||
435 | 2 | import base64 | ||
436 | 3 | |||
437 | 4 | def handler(request): | ||
438 | 5 | html = StringIO() | ||
439 | 6 | |||
440 | 7 | def send_401(): | ||
441 | 8 | request.send_response(401) | ||
442 | 9 | request.send_header("WWW-Authenticate", "Basic realm=\"Fake Realm\"") | ||
443 | 10 | request.send_header("Cache-Control", "no-store") | ||
444 | 11 | request.send_header("Content-Length", html.tell()) | ||
445 | 12 | request.end_headers() | ||
446 | 13 | |||
447 | 14 | if "Authorization" in request.headers: | ||
448 | 15 | user, password = request.path.split("?")[1].split("_") | ||
449 | 16 | header = request.headers["Authorization"] | ||
450 | 17 | credentials = base64.b64decode(header[len("Basic "):]).split(":") | ||
451 | 18 | if credentials[0] == user and credentials[1] == password: | ||
452 | 19 | html.write("Authentication success") | ||
453 | 20 | request.send_response(200) | ||
454 | 21 | request.send_header("Cache-Control", "no-store") | ||
455 | 22 | request.send_header("Content-Length", html.tell()) | ||
456 | 23 | request.end_headers() | ||
457 | 24 | else: | ||
458 | 25 | html.write("Wrong credentials") | ||
459 | 26 | send_401() | ||
460 | 27 | else: | ||
461 | 28 | html.write("Requested credentials") | ||
462 | 29 | send_401() | ||
463 | 30 | |||
464 | 31 | request.wfile.write(html.getvalue()) | ||
465 | 0 | 32 | ||
466 | === added file 'qt/tests/qmltests/api/tst_httpAuthentication.qml' | |||
467 | --- qt/tests/qmltests/api/tst_httpAuthentication.qml 1970-01-01 00:00:00 +0000 | |||
468 | +++ qt/tests/qmltests/api/tst_httpAuthentication.qml 2015-06-18 16:37:15 +0000 | |||
469 | @@ -0,0 +1,142 @@ | |||
470 | 1 | import QtQuick 2.0 | ||
471 | 2 | import QtTest 1.0 | ||
472 | 3 | import com.canonical.Oxide 1.9 | ||
473 | 4 | import com.canonical.Oxide.Testing 1.0 | ||
474 | 5 | |||
475 | 6 | TestWebView { | ||
476 | 7 | id: webView | ||
477 | 8 | width: 200 | ||
478 | 9 | height: 200 | ||
479 | 10 | |||
480 | 11 | property var lastRequest | ||
481 | 12 | property int lastStatusCode: -1 | ||
482 | 13 | property int totalRequests: 0 | ||
483 | 14 | property int expectedRequests: 0 | ||
484 | 15 | property int totalCancellations: 0 | ||
485 | 16 | property int expectedCancellations: 0 | ||
486 | 17 | property bool ignoreRequests: false | ||
487 | 18 | |||
488 | 19 | // Since the browser caches credentials after the first successful | ||
489 | 20 | // authentication, we make sure to use a different username for every test | ||
490 | 21 | property string baseUrl: "http://testsuite/tst_httpAuthentication.py" | ||
491 | 22 | property int userNameSuffix: 0 | ||
492 | 23 | property string currentUser: "user" + userNameSuffix | ||
493 | 24 | property string credentialsUrl: baseUrl + "?" + currentUser + "_pass" | ||
494 | 25 | |||
495 | 26 | onHttpAuthenticationRequested: { | ||
496 | 27 | if (!ignoreRequests) { | ||
497 | 28 | lastRequest = request | ||
498 | 29 | lastRequest.cancelled.connect(updateCancellations) | ||
499 | 30 | } | ||
500 | 31 | totalRequests++ | ||
501 | 32 | } | ||
502 | 33 | |||
503 | 34 | onLoadEvent: lastStatusCode = event.httpStatusCode | ||
504 | 35 | |||
505 | 36 | function updateCancellations() { totalCancellations++ } | ||
506 | 37 | |||
507 | 38 | TestCase { | ||
508 | 39 | id: test | ||
509 | 40 | name: "httpAuthentication" | ||
510 | 41 | when: windowShown | ||
511 | 42 | |||
512 | 43 | function init() { | ||
513 | 44 | ignoreRequests = false | ||
514 | 45 | if (lastRequest) { | ||
515 | 46 | lastRequest.cancelled.disconnect(updateCancellations) | ||
516 | 47 | lastRequest = null | ||
517 | 48 | } | ||
518 | 49 | webView.url = "about:blank"; | ||
519 | 50 | verify(webView.waitForLoadSucceeded()); | ||
520 | 51 | totalRequests = 0 | ||
521 | 52 | expectedRequests = 0 | ||
522 | 53 | totalCancellations = 0 | ||
523 | 54 | expectedCancellations = 0 | ||
524 | 55 | lastStatusCode = -1 | ||
525 | 56 | userNameSuffix++ | ||
526 | 57 | } | ||
527 | 58 | |||
528 | 59 | function receivedRequest() { | ||
529 | 60 | return totalRequests == expectedRequests | ||
530 | 61 | } | ||
531 | 62 | |||
532 | 63 | function receivedCancellation() { | ||
533 | 64 | return totalCancellations == expectedCancellations | ||
534 | 65 | } | ||
535 | 66 | |||
536 | 67 | function test_requestMembers() { | ||
537 | 68 | expectedRequests++ | ||
538 | 69 | webView.url = credentialsUrl | ||
539 | 70 | verify(waitFor(receivedRequest), "No authentication request") | ||
540 | 71 | compare(lastRequest.realm, "Fake Realm") | ||
541 | 72 | compare(lastRequest.host, "testsuite:80") | ||
542 | 73 | } | ||
543 | 74 | |||
544 | 75 | function test_wrong_password() { | ||
545 | 76 | expectedRequests++ | ||
546 | 77 | webView.url = credentialsUrl | ||
547 | 78 | verify(waitFor(receivedRequest), "No authentication request") | ||
548 | 79 | expectedRequests++ | ||
549 | 80 | lastRequest.allow(currentUser, "wrong") | ||
550 | 81 | verify(waitFor(receivedRequest), "No authentication request") | ||
551 | 82 | } | ||
552 | 83 | |||
553 | 84 | function test_wrong_username() { | ||
554 | 85 | expectedRequests++ | ||
555 | 86 | webView.url = credentialsUrl | ||
556 | 87 | verify(waitFor(receivedRequest), "No authentication request") | ||
557 | 88 | expectedRequests++ | ||
558 | 89 | lastRequest.allow(currentUser + "_wrong", "pass") | ||
559 | 90 | verify(waitFor(receivedRequest), "No authentication request") | ||
560 | 91 | } | ||
561 | 92 | |||
562 | 93 | function test_right_credentials() { | ||
563 | 94 | expectedRequests++ | ||
564 | 95 | webView.url = credentialsUrl | ||
565 | 96 | verify(waitFor(receivedRequest), "No authentication request") | ||
566 | 97 | lastRequest.allow(currentUser, "pass") | ||
567 | 98 | webView.waitForLoadSucceeded() | ||
568 | 99 | compare(lastStatusCode, 200) | ||
569 | 100 | compare(expectedRequests, totalRequests) | ||
570 | 101 | } | ||
571 | 102 | |||
572 | 103 | function test_explicit_cancellation() { | ||
573 | 104 | webView.url = credentialsUrl | ||
574 | 105 | expectedRequests++ | ||
575 | 106 | verify(waitFor(receivedRequest), "No authentication request") | ||
576 | 107 | |||
577 | 108 | lastRequest.deny() | ||
578 | 109 | webView.waitForLoadSucceeded() | ||
579 | 110 | compare(lastStatusCode, 401) | ||
580 | 111 | // when cancelling explicity we should not receive cancellation signals | ||
581 | 112 | compare(totalCancellations, 0) | ||
582 | 113 | } | ||
583 | 114 | |||
584 | 115 | function test_cancel_by_navigation() { | ||
585 | 116 | webView.url = credentialsUrl | ||
586 | 117 | expectedRequests++ | ||
587 | 118 | verify(waitFor(receivedRequest), "No authentication request") | ||
588 | 119 | |||
589 | 120 | expectedCancellations++ | ||
590 | 121 | webView.url = "about:blank" | ||
591 | 122 | verify(waitFor(receivedCancellation), "Authentication not cancelled") | ||
592 | 123 | |||
593 | 124 | webView.waitForLoadSucceeded() | ||
594 | 125 | compare(expectedRequests, totalRequests) | ||
595 | 126 | } | ||
596 | 127 | |||
597 | 128 | function test_ignored_request_cancelled() { | ||
598 | 129 | ignoreRequests = true | ||
599 | 130 | webView.url = credentialsUrl | ||
600 | 131 | expectedRequests++ | ||
601 | 132 | verify(waitFor(receivedRequest), "No authentication request") | ||
602 | 133 | |||
603 | 134 | // force garbage collection so the request object will be destroyed | ||
604 | 135 | // as we did not keep any reference to it. | ||
605 | 136 | // the request destructor will call request.deny() | ||
606 | 137 | gc() | ||
607 | 138 | webView.waitForLoadSucceeded() | ||
608 | 139 | compare(lastStatusCode, 401) | ||
609 | 140 | } | ||
610 | 141 | } | ||
611 | 142 | } | ||
612 | 0 | 143 | ||
613 | === modified file 'shared/browser/oxide_resource_dispatcher_host_delegate.cc' | |||
614 | --- shared/browser/oxide_resource_dispatcher_host_delegate.cc 2015-06-06 10:38:48 +0000 | |||
615 | +++ shared/browser/oxide_resource_dispatcher_host_delegate.cc 2015-06-18 16:37:15 +0000 | |||
616 | @@ -18,12 +18,14 @@ | |||
617 | 18 | #include "oxide_resource_dispatcher_host_delegate.h" | 18 | #include "oxide_resource_dispatcher_host_delegate.h" |
618 | 19 | 19 | ||
619 | 20 | #include "base/bind.h" | 20 | #include "base/bind.h" |
620 | 21 | #include "base/callback.h" | ||
621 | 22 | #include "base/logging.h" | 21 | #include "base/logging.h" |
622 | 23 | #include "base/strings/utf_string_conversions.h" | 22 | #include "base/strings/utf_string_conversions.h" |
623 | 24 | #include "content/public/browser/browser_thread.h" | 23 | #include "content/public/browser/browser_thread.h" |
624 | 24 | #include "content/public/browser/render_frame_host.h" | ||
625 | 25 | #include "content/public/browser/render_view_host.h" | 25 | #include "content/public/browser/render_view_host.h" |
626 | 26 | #include "content/public/browser/resource_dispatcher_host.h" | ||
627 | 26 | #include "content/public/browser/resource_context.h" | 27 | #include "content/public/browser/resource_context.h" |
628 | 28 | #include "content/public/browser/resource_request_info.h" | ||
629 | 27 | #include "content/public/common/referrer.h" | 29 | #include "content/public/common/referrer.h" |
630 | 28 | #include "net/base/mime_util.h" | 30 | #include "net/base/mime_util.h" |
631 | 29 | #include "net/cookies/cookie_monster.h" | 31 | #include "net/cookies/cookie_monster.h" |
632 | @@ -37,6 +39,7 @@ | |||
633 | 37 | #include "oxide_browser_context_delegate.h" | 39 | #include "oxide_browser_context_delegate.h" |
634 | 38 | #include "oxide_browser_platform_integration.h" | 40 | #include "oxide_browser_platform_integration.h" |
635 | 39 | #include "oxide_redirection_intercept_throttle.h" | 41 | #include "oxide_redirection_intercept_throttle.h" |
636 | 42 | #include "oxide_resource_dispatcher_host_login_delegate.h" | ||
637 | 40 | #include "oxide_web_view.h" | 43 | #include "oxide_web_view.h" |
638 | 41 | 44 | ||
639 | 42 | namespace oxide { | 45 | namespace oxide { |
640 | @@ -193,8 +196,8 @@ | |||
641 | 193 | params.render_process_id, params.render_view_id); | 196 | params.render_process_id, params.render_view_id); |
642 | 194 | if (!rvh) { | 197 | if (!rvh) { |
643 | 195 | LOG(ERROR) << "Invalid or non-existent render_process_id & render_view_id:" | 198 | LOG(ERROR) << "Invalid or non-existent render_process_id & render_view_id:" |
646 | 196 | << params.render_process_id << ", " << params.render_view_id | 199 | << params.render_process_id << ", " << params.render_view_id |
647 | 197 | << "during download url delegate dispatch"; | 200 | << "during download url delegate dispatch"; |
648 | 198 | return; | 201 | return; |
649 | 199 | } | 202 | } |
650 | 200 | 203 | ||
651 | @@ -239,6 +242,14 @@ | |||
652 | 239 | return BrowserPlatformIntegration::GetInstance()->LaunchURLExternally(url); | 242 | return BrowserPlatformIntegration::GetInstance()->LaunchURLExternally(url); |
653 | 240 | } | 243 | } |
654 | 241 | 244 | ||
655 | 245 | content::ResourceDispatcherHostLoginDelegate* | ||
656 | 246 | ResourceDispatcherHostDelegate::CreateLoginDelegate( | ||
657 | 247 | net::AuthChallengeInfo* auth_info, | ||
658 | 248 | net::URLRequest* request) { | ||
659 | 249 | // Chromium will own the delegate | ||
660 | 250 | return new ResourceDispatcherHostLoginDelegate(auth_info, request); | ||
661 | 251 | } | ||
662 | 252 | |||
663 | 242 | ResourceDispatcherHostDelegate::ResourceDispatcherHostDelegate() {} | 253 | ResourceDispatcherHostDelegate::ResourceDispatcherHostDelegate() {} |
664 | 243 | 254 | ||
665 | 244 | ResourceDispatcherHostDelegate::~ResourceDispatcherHostDelegate() {} | 255 | ResourceDispatcherHostDelegate::~ResourceDispatcherHostDelegate() {} |
666 | 245 | 256 | ||
667 | === modified file 'shared/browser/oxide_resource_dispatcher_host_delegate.h' | |||
668 | --- shared/browser/oxide_resource_dispatcher_host_delegate.h 2015-06-02 15:31:02 +0000 | |||
669 | +++ shared/browser/oxide_resource_dispatcher_host_delegate.h 2015-06-18 16:37:15 +0000 | |||
670 | @@ -18,6 +18,7 @@ | |||
671 | 18 | #ifndef _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 18 | #ifndef _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
672 | 19 | #define _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 19 | #define _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
673 | 20 | 20 | ||
674 | 21 | #include "base/callback.h" | ||
675 | 21 | #include "base/macros.h" | 22 | #include "base/macros.h" |
676 | 22 | #include "base/strings/string16.h" | 23 | #include "base/strings/string16.h" |
677 | 23 | #include "content/public/browser/resource_dispatcher_host_delegate.h" | 24 | #include "content/public/browser/resource_dispatcher_host_delegate.h" |
678 | @@ -35,6 +36,8 @@ | |||
679 | 35 | 36 | ||
680 | 36 | namespace oxide { | 37 | namespace oxide { |
681 | 37 | 38 | ||
682 | 39 | class ResourceDispatcherHostLoginDelegate; | ||
683 | 40 | |||
684 | 38 | class ResourceDispatcherHostDelegate | 41 | class ResourceDispatcherHostDelegate |
685 | 39 | : public content::ResourceDispatcherHostDelegate { | 42 | : public content::ResourceDispatcherHostDelegate { |
686 | 40 | public: | 43 | public: |
687 | @@ -89,6 +92,11 @@ | |||
688 | 89 | ui::PageTransition page_transition, | 92 | ui::PageTransition page_transition, |
689 | 90 | bool has_user_gesture) override; | 93 | bool has_user_gesture) override; |
690 | 91 | 94 | ||
691 | 95 | content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( | ||
692 | 96 | net::AuthChallengeInfo* auth_info, | ||
693 | 97 | net::URLRequest* request) override; | ||
694 | 98 | |||
695 | 99 | private: | ||
696 | 92 | DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostDelegate); | 100 | DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostDelegate); |
697 | 93 | }; | 101 | }; |
698 | 94 | 102 | ||
699 | 95 | 103 | ||
700 | === added file 'shared/browser/oxide_resource_dispatcher_host_login_delegate.cc' | |||
701 | --- shared/browser/oxide_resource_dispatcher_host_login_delegate.cc 1970-01-01 00:00:00 +0000 | |||
702 | +++ shared/browser/oxide_resource_dispatcher_host_login_delegate.cc 2015-06-18 16:37:15 +0000 | |||
703 | @@ -0,0 +1,162 @@ | |||
704 | 1 | // vim:expandtab:shiftwidth=2:tabstop=2: | ||
705 | 2 | // Copyright (C) 2014-2015 Canonical Ltd. | ||
706 | 3 | |||
707 | 4 | // This library is free software; you can redistribute it and/or | ||
708 | 5 | // modify it under the terms of the GNU Lesser General Public | ||
709 | 6 | // License as published by the Free Software Foundation; either | ||
710 | 7 | // version 2.1 of the License, or (at your option) any later version. | ||
711 | 8 | |||
712 | 9 | // This library is distributed in the hope that it will be useful, | ||
713 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
714 | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
715 | 12 | // Lesser General Public License for more details. | ||
716 | 13 | |||
717 | 14 | // You should have received a copy of the GNU Lesser General Public | ||
718 | 15 | // License along with this library; if not, write to the Free Software | ||
719 | 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
720 | 17 | |||
721 | 18 | #include "oxide_resource_dispatcher_host_login_delegate.h" | ||
722 | 19 | |||
723 | 20 | #include "base/bind.h" | ||
724 | 21 | #include "base/logging.h" | ||
725 | 22 | #include "base/strings/utf_string_conversions.h" | ||
726 | 23 | #include "content/public/browser/browser_thread.h" | ||
727 | 24 | #include "content/public/browser/render_frame_host.h" | ||
728 | 25 | #include "content/public/browser/resource_dispatcher_host.h" | ||
729 | 26 | #include "content/public/browser/resource_context.h" | ||
730 | 27 | #include "content/public/browser/resource_request_info.h" | ||
731 | 28 | #include "net/base/auth.h" | ||
732 | 29 | #include "net/url_request/url_request.h" | ||
733 | 30 | |||
734 | 31 | #include "oxide_web_view.h" | ||
735 | 32 | |||
736 | 33 | namespace oxide { | ||
737 | 34 | |||
738 | 35 | ResourceDispatcherHostLoginDelegate::ResourceDispatcherHostLoginDelegate( | ||
739 | 36 | net::AuthChallengeInfo* auth_info, | ||
740 | 37 | net::URLRequest* request) | ||
741 | 38 | : request_(request) { | ||
742 | 39 | DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | ||
743 | 40 | |||
744 | 41 | host_ = auth_info->challenger.ToString(); | ||
745 | 42 | realm_ = auth_info->realm; | ||
746 | 43 | |||
747 | 44 | WebView* webview = GetWebView(request_); | ||
748 | 45 | if (!webview) { | ||
749 | 46 | // Deny the request if we can not get access to the webview, as there is | ||
750 | 47 | // no other sensible thing to do. | ||
751 | 48 | Deny(); | ||
752 | 49 | return; | ||
753 | 50 | } | ||
754 | 51 | |||
755 | 52 | content::BrowserThread::PostTask( | ||
756 | 53 | content::BrowserThread::UI, | ||
757 | 54 | FROM_HERE, | ||
758 | 55 | base::Bind(&ResourceDispatcherHostLoginDelegate::DispatchRequest, | ||
759 | 56 | this, webview)); | ||
760 | 57 | } | ||
761 | 58 | |||
762 | 59 | ResourceDispatcherHostLoginDelegate::~ResourceDispatcherHostLoginDelegate() {} | ||
763 | 60 | |||
764 | 61 | void ResourceDispatcherHostLoginDelegate::SetCancelledCallback( | ||
765 | 62 | const base::Closure& cancelled_callback) { | ||
766 | 63 | DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | ||
767 | 64 | |||
768 | 65 | cancelled_callback_ = cancelled_callback; | ||
769 | 66 | } | ||
770 | 67 | |||
771 | 68 | void ResourceDispatcherHostLoginDelegate::OnRequestCancelled() { | ||
772 | 69 | DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | ||
773 | 70 | |||
774 | 71 | request_ = nullptr; | ||
775 | 72 | |||
776 | 73 | content::BrowserThread::PostTask( | ||
777 | 74 | content::BrowserThread::UI, | ||
778 | 75 | FROM_HERE, | ||
779 | 76 | base::Bind(&ResourceDispatcherHostLoginDelegate::DispatchCancelledCallback, | ||
780 | 77 | this)); | ||
781 | 78 | } | ||
782 | 79 | |||
783 | 80 | void ResourceDispatcherHostLoginDelegate::DispatchCancelledCallback() { | ||
784 | 81 | DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | ||
785 | 82 | |||
786 | 83 | if (!cancelled_callback_.is_null()) { | ||
787 | 84 | content::BrowserThread::PostTask( | ||
788 | 85 | content::BrowserThread::UI, | ||
789 | 86 | FROM_HERE, | ||
790 | 87 | cancelled_callback_); | ||
791 | 88 | } | ||
792 | 89 | } | ||
793 | 90 | |||
794 | 91 | void ResourceDispatcherHostLoginDelegate::Deny() { | ||
795 | 92 | if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { | ||
796 | 93 | content::BrowserThread::PostTask( | ||
797 | 94 | content::BrowserThread::IO, | ||
798 | 95 | FROM_HERE, | ||
799 | 96 | base::Bind(&ResourceDispatcherHostLoginDelegate::Deny, this)); | ||
800 | 97 | return; | ||
801 | 98 | } | ||
802 | 99 | |||
803 | 100 | if (!request_) { | ||
804 | 101 | return; | ||
805 | 102 | } | ||
806 | 103 | |||
807 | 104 | request_->CancelAuth(); | ||
808 | 105 | content::ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest( | ||
809 | 106 | request_); | ||
810 | 107 | request_ = nullptr; | ||
811 | 108 | } | ||
812 | 109 | |||
813 | 110 | void ResourceDispatcherHostLoginDelegate::Allow(const std::string &username, | ||
814 | 111 | const std::string &password) | ||
815 | 112 | { | ||
816 | 113 | if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { | ||
817 | 114 | content::BrowserThread::PostTask( | ||
818 | 115 | content::BrowserThread::IO, | ||
819 | 116 | FROM_HERE, | ||
820 | 117 | base::Bind(&ResourceDispatcherHostLoginDelegate::Allow, this, | ||
821 | 118 | username, password)); | ||
822 | 119 | return; | ||
823 | 120 | } | ||
824 | 121 | |||
825 | 122 | if (!request_) { | ||
826 | 123 | return; | ||
827 | 124 | } | ||
828 | 125 | |||
829 | 126 | request_->SetAuth(net::AuthCredentials(base::UTF8ToUTF16(username), | ||
830 | 127 | base::UTF8ToUTF16(password))); | ||
831 | 128 | content::ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest( | ||
832 | 129 | request_); | ||
833 | 130 | request_ = nullptr; | ||
834 | 131 | } | ||
835 | 132 | |||
836 | 133 | WebView* ResourceDispatcherHostLoginDelegate::GetWebView( | ||
837 | 134 | net::URLRequest* request) { | ||
838 | 135 | int processId; | ||
839 | 136 | int frameId; | ||
840 | 137 | content::ResourceRequestInfo::GetRenderFrameForRequest(request, &processId, | ||
841 | 138 | &frameId); | ||
842 | 139 | content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(processId, | ||
843 | 140 | frameId); | ||
844 | 141 | if (!rfh) { | ||
845 | 142 | return nullptr; | ||
846 | 143 | } | ||
847 | 144 | |||
848 | 145 | return WebView::FromRenderFrameHost(rfh); | ||
849 | 146 | } | ||
850 | 147 | |||
851 | 148 | void ResourceDispatcherHostLoginDelegate::DispatchRequest(WebView* webview) { | ||
852 | 149 | DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | ||
853 | 150 | |||
854 | 151 | webview->HttpAuthenticationRequested(this); | ||
855 | 152 | } | ||
856 | 153 | |||
857 | 154 | std::string ResourceDispatcherHostLoginDelegate::Host() const { | ||
858 | 155 | return host_; | ||
859 | 156 | } | ||
860 | 157 | |||
861 | 158 | std::string ResourceDispatcherHostLoginDelegate::Realm() const { | ||
862 | 159 | return realm_; | ||
863 | 160 | } | ||
864 | 161 | |||
865 | 162 | } // namespace oxide | ||
866 | 0 | 163 | ||
867 | === added file 'shared/browser/oxide_resource_dispatcher_host_login_delegate.h' | |||
868 | --- shared/browser/oxide_resource_dispatcher_host_login_delegate.h 1970-01-01 00:00:00 +0000 | |||
869 | +++ shared/browser/oxide_resource_dispatcher_host_login_delegate.h 2015-06-18 16:37:15 +0000 | |||
870 | @@ -0,0 +1,65 @@ | |||
871 | 1 | // vim:expandtab:shiftwidth=2:tabstop=2: | ||
872 | 2 | // Copyright (C) 2014-2015 Canonical Ltd. | ||
873 | 3 | |||
874 | 4 | // This library is free software; you can redistribute it and/or | ||
875 | 5 | // modify it under the terms of the GNU Lesser General Public | ||
876 | 6 | // License as published by the Free Software Foundation; either | ||
877 | 7 | // version 2.1 of the License, or (at your option) any later version. | ||
878 | 8 | |||
879 | 9 | // This library is distributed in the hope that it will be useful, | ||
880 | 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
881 | 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
882 | 12 | // Lesser General Public License for more details. | ||
883 | 13 | |||
884 | 14 | // You should have received a copy of the GNU Lesser General Public | ||
885 | 15 | // License along with this library; if not, write to the Free Software | ||
886 | 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
887 | 17 | |||
888 | 18 | #ifndef _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ | ||
889 | 19 | #define _OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ | ||
890 | 20 | |||
891 | 21 | #include "base/callback.h" | ||
892 | 22 | #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | ||
893 | 23 | |||
894 | 24 | namespace net { | ||
895 | 25 | class URLRequest; | ||
896 | 26 | class AuthChallengeInfo; | ||
897 | 27 | } | ||
898 | 28 | |||
899 | 29 | namespace oxide { | ||
900 | 30 | |||
901 | 31 | class ResourceDispatcherHostDelegate; | ||
902 | 32 | class WebView; | ||
903 | 33 | |||
904 | 34 | class ResourceDispatcherHostLoginDelegate | ||
905 | 35 | : public content::ResourceDispatcherHostLoginDelegate { | ||
906 | 36 | public: | ||
907 | 37 | ResourceDispatcherHostLoginDelegate(net::AuthChallengeInfo* auth_info, | ||
908 | 38 | net::URLRequest* request); | ||
909 | 39 | ~ResourceDispatcherHostLoginDelegate() override; | ||
910 | 40 | void OnRequestCancelled() override; | ||
911 | 41 | |||
912 | 42 | void Deny(); | ||
913 | 43 | void Allow(const std::string& username, const std::string& password); | ||
914 | 44 | |||
915 | 45 | void SetCancelledCallback(const base::Closure& cancelled_callback); | ||
916 | 46 | |||
917 | 47 | std::string Host() const; | ||
918 | 48 | std::string Realm() const; | ||
919 | 49 | |||
920 | 50 | private: | ||
921 | 51 | friend class ResourceDispatcherHostDelegate; | ||
922 | 52 | void DispatchRequest(WebView* webview); | ||
923 | 53 | void DispatchCancelledCallback(); | ||
924 | 54 | WebView* GetWebView(net::URLRequest* request); | ||
925 | 55 | |||
926 | 56 | net::URLRequest* request_; | ||
927 | 57 | std::string host_; | ||
928 | 58 | std::string realm_; | ||
929 | 59 | base::Closure cancelled_callback_; | ||
930 | 60 | }; | ||
931 | 61 | |||
932 | 62 | } // namespace oxide | ||
933 | 63 | |||
934 | 64 | #endif // OXIDE_SHARED_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE | ||
935 | 65 | |||
936 | 0 | 66 | ||
937 | === modified file 'shared/browser/oxide_web_view.cc' | |||
938 | --- shared/browser/oxide_web_view.cc 2015-06-17 21:04:11 +0000 | |||
939 | +++ shared/browser/oxide_web_view.cc 2015-06-18 16:37:15 +0000 | |||
940 | @@ -1269,7 +1269,7 @@ | |||
941 | 1269 | DCHECK(root_frame_.get()); | 1269 | DCHECK(root_frame_.get()); |
942 | 1270 | 1270 | ||
943 | 1271 | if (params->context && init_data_->load_params) { | 1271 | if (params->context && init_data_->load_params) { |
945 | 1272 | web_contents_->GetController().LoadURLWithParams(*init_data_->load_params); | 1272 | web_contents_->GetController().LoadURLWithParams(*init_data_->load_params); |
946 | 1273 | } | 1273 | } |
947 | 1274 | 1274 | ||
948 | 1275 | web_contents_->GetController().LoadIfNecessary(); | 1275 | web_contents_->GetController().LoadIfNecessary(); |
949 | @@ -2100,6 +2100,11 @@ | |||
950 | 2100 | user_agent); | 2100 | user_agent); |
951 | 2101 | } | 2101 | } |
952 | 2102 | 2102 | ||
953 | 2103 | void WebView::HttpAuthenticationRequested( | ||
954 | 2104 | ResourceDispatcherHostLoginDelegate* login_delegate) { | ||
955 | 2105 | client_->HttpAuthenticationRequested(login_delegate); | ||
956 | 2106 | } | ||
957 | 2107 | |||
958 | 2103 | CompositorFrameHandle* WebView::GetCompositorFrameHandle() const { | 2108 | CompositorFrameHandle* WebView::GetCompositorFrameHandle() const { |
959 | 2104 | return current_compositor_frame_.get(); | 2109 | return current_compositor_frame_.get(); |
960 | 2105 | } | 2110 | } |
961 | 2106 | 2111 | ||
962 | === modified file 'shared/browser/oxide_web_view.h' | |||
963 | --- shared/browser/oxide_web_view.h 2015-06-11 13:06:02 +0000 | |||
964 | +++ shared/browser/oxide_web_view.h 2015-06-18 16:37:15 +0000 | |||
965 | @@ -98,6 +98,7 @@ | |||
966 | 98 | class CompositorFrameHandle; | 98 | class CompositorFrameHandle; |
967 | 99 | class FilePicker; | 99 | class FilePicker; |
968 | 100 | class JavaScriptDialog; | 100 | class JavaScriptDialog; |
969 | 101 | class ResourceDispatcherHostLoginDelegate; | ||
970 | 101 | class RenderWidgetHostView; | 102 | class RenderWidgetHostView; |
971 | 102 | class WebContextMenu; | 103 | class WebContextMenu; |
972 | 103 | class WebFrame; | 104 | class WebFrame; |
973 | @@ -310,6 +311,9 @@ | |||
974 | 310 | const std::string& referrer, | 311 | const std::string& referrer, |
975 | 311 | const std::string& user_agent); | 312 | const std::string& user_agent); |
976 | 312 | 313 | ||
977 | 314 | void HttpAuthenticationRequested( | ||
978 | 315 | ResourceDispatcherHostLoginDelegate* login_delegate); | ||
979 | 316 | |||
980 | 313 | CompositorFrameHandle* GetCompositorFrameHandle() const; | 317 | CompositorFrameHandle* GetCompositorFrameHandle() const; |
981 | 314 | void DidCommitCompositorFrame(); | 318 | void DidCommitCompositorFrame(); |
982 | 315 | 319 | ||
983 | 316 | 320 | ||
984 | === modified file 'shared/browser/oxide_web_view_client.cc' | |||
985 | --- shared/browser/oxide_web_view_client.cc 2015-06-04 13:21:49 +0000 | |||
986 | +++ shared/browser/oxide_web_view_client.cc 2015-06-18 16:37:15 +0000 | |||
987 | @@ -168,4 +168,7 @@ | |||
988 | 168 | 168 | ||
989 | 169 | void WebViewClient::FindInPageCountChanged() {} | 169 | void WebViewClient::FindInPageCountChanged() {} |
990 | 170 | 170 | ||
991 | 171 | void WebViewClient::HttpAuthenticationRequested( | ||
992 | 172 | ResourceDispatcherHostLoginDelegate* login_delegate) {} | ||
993 | 173 | |||
994 | 171 | } // namespace oxide | 174 | } // namespace oxide |
995 | 172 | 175 | ||
996 | === modified file 'shared/browser/oxide_web_view_client.h' | |||
997 | --- shared/browser/oxide_web_view_client.h 2015-06-04 13:21:49 +0000 | |||
998 | +++ shared/browser/oxide_web_view_client.h 2015-06-18 16:37:15 +0000 | |||
999 | @@ -48,6 +48,7 @@ | |||
1000 | 48 | class CertificateError; | 48 | class CertificateError; |
1001 | 49 | class FilePicker; | 49 | class FilePicker; |
1002 | 50 | class JavaScriptDialog; | 50 | class JavaScriptDialog; |
1003 | 51 | class ResourceDispatcherHostLoginDelegate; | ||
1004 | 51 | class SecurityStatus; | 52 | class SecurityStatus; |
1005 | 52 | class WebContextMenu; | 53 | class WebContextMenu; |
1006 | 53 | class WebFrame; | 54 | class WebFrame; |
1007 | @@ -206,6 +207,9 @@ | |||
1008 | 206 | 207 | ||
1009 | 207 | virtual void FindInPageCurrentChanged(); | 208 | virtual void FindInPageCurrentChanged(); |
1010 | 208 | virtual void FindInPageCountChanged(); | 209 | virtual void FindInPageCountChanged(); |
1011 | 210 | |||
1012 | 211 | virtual void HttpAuthenticationRequested( | ||
1013 | 212 | ResourceDispatcherHostLoginDelegate* login_delegate); | ||
1014 | 209 | }; | 213 | }; |
1015 | 210 | 214 | ||
1016 | 211 | } // namespace oxide | 215 | } // namespace oxide |
1017 | 212 | 216 | ||
1018 | === modified file 'shared/shared.gyp' | |||
1019 | --- shared/shared.gyp 2015-06-10 13:10:39 +0000 | |||
1020 | +++ shared/shared.gyp 2015-06-18 16:37:15 +0000 | |||
1021 | @@ -370,6 +370,8 @@ | |||
1022 | 370 | 'browser/oxide_render_widget_host_view_delegate.h', | 370 | 'browser/oxide_render_widget_host_view_delegate.h', |
1023 | 371 | 'browser/oxide_resource_dispatcher_host_delegate.cc', | 371 | 'browser/oxide_resource_dispatcher_host_delegate.cc', |
1024 | 372 | 'browser/oxide_resource_dispatcher_host_delegate.h', | 372 | 'browser/oxide_resource_dispatcher_host_delegate.h', |
1025 | 373 | 'browser/oxide_resource_dispatcher_host_login_delegate.cc', | ||
1026 | 374 | 'browser/oxide_resource_dispatcher_host_login_delegate.h', | ||
1027 | 373 | 'browser/oxide_script_message_dispatcher_browser.cc', | 375 | 'browser/oxide_script_message_dispatcher_browser.cc', |
1028 | 374 | 'browser/oxide_script_message_dispatcher_browser.h', | 376 | 'browser/oxide_script_message_dispatcher_browser.h', |
1029 | 375 | 'browser/oxide_script_message_impl_browser.cc', | 377 | 'browser/oxide_script_message_impl_browser.cc', |
I’m getting the following error when running the unit tests on a local build:
1: QWARN : qml-api- test::UnknownTe stFunc( ) file:// /home/osomon/ dev/phablet/ oxide/trunk/ qt/tests/ qmltests/ api/tst_ WebView_ basicAuthentica tion.qml: 25:3: "TestWebView. onBasicAuthenti cationRequested " is not available due to component versioning. cationRequested : { test::tst_ WebView_ basicAuthentica tion::compile( ) dev/phablet/ oxide/trunk/ qt/tests/ qmltests/ api/tst_ WebView_ basicAuthentica tion.qml produced 1 error(s): dev/phablet/ oxide/trunk/ qt/tests/ qmltests/ api/tst_ WebView_ basicAuthentica tion.qml: 25,3: "TestWebView. onBasicAuthenti cationRequested " is not available due to component versioning. dev/phablet/ oxide/trunk/ objdir- x64-release/ qt/tests/ qmltests osomon/ dev/phablet/ oxide/trunk/ objdir- x64-release/ out/bin' osomon/ dev/phablet/ oxide/trunk/ objdir- x64-release/ out/imports' x86_64- linux-gnu/ qt5/qml' test::tst_ WebView_ basicAuthentica tion::compile( ) "TestWebView. onBasicAuthenti cationRequested " is not available due to component versioning. osomon/ dev/phablet/ oxide/trunk/ qt/tests/ qmltests/ api/tst_ WebView_ basicAuthentica tion.qml( 25)]
1: onBasicAuthenti
1: ^
1: QWARN : qml-api-
1: /home/osomon/
1: /home/osomon/
1: Working directory: /home/osomon/
1: View: QQuickView, import paths:
1: '/home/
1: '/home/
1: '/usr/lib/
1: Plugin paths:
1: '.'
1:
1: FAIL! : qml-api-
1: Loc: [/home/
You will need to import com.canonical.Oxide 1.9 in your tests.