Merge lp:~osomon/webbrowser-app/official-api into lp:webbrowser-app
- official-api
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 565 | ||||
Proposed branch: | lp:~osomon/webbrowser-app/official-api | ||||
Merge into: | lp:webbrowser-app | ||||
Diff against target: |
1259 lines (+524/-263) 25 files modified
.bzrignore (+2/-0) CMakeLists.txt (+2/-0) debian/control (+41/-19) debian/qtdeclarative5-ubuntu-web-plugin.install (+1/-0) debian/qtdeclarative5-ubuntu-web-plugin.lintian-overrides (+3/-0) doc/CMakeLists.txt (+11/-0) doc/SharedWebContext.qdoc (+39/-0) doc/WebContext.qdoc (+70/-0) doc/WebView.qdoc (+207/-0) doc/ubuntu-web.qdoc (+22/-0) doc/ubuntu-web.qdocconf (+10/-0) src/Ubuntu/CMakeLists.txt (+22/-0) src/Ubuntu/Components/Extras/Browser/CMakeLists.txt (+2/-22) src/Ubuntu/Components/Extras/Browser/qmldir (+3/-1) src/Ubuntu/Web/CMakeLists.txt (+26/-0) src/Ubuntu/Web/UbuntuWebContext.qml (+7/-7) src/Ubuntu/Web/UbuntuWebView02.qml (+17/-146) src/Ubuntu/Web/plugin.cpp (+8/-5) src/Ubuntu/Web/qmldir (+5/-0) src/Ubuntu/Web/selection02.js (+0/-41) src/app/WebViewImpl.qml (+2/-2) src/app/webbrowser/TimelineView.qml (+0/-1) src/app/webcontainer/WebViewImplOxide.qml (+15/-15) tests/unittests/qml/tst_UbuntuWebView02.qml (+4/-4) webbrowser-app.qmlproject (+5/-0) |
||||
To merge this branch: | bzr merge lp:~osomon/webbrowser-app/official-api | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Łukasz Zemczak | packaging | Needs Fixing | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+221436@code.launchpad.net |
Commit message
Move version 0.2 of the API to "Ubuntu.Web" namespace, rename "UbuntuWebView" to "WebView", and document the public API intended for application developers.
The legacy namespace and component name are kept around for compatibility with existing applications.
Version 0.1 of the API remains untouched (it is deprecated).
Packaging changes:
new qtdeclarative5-
updated runtime dependencies for webbrowser-app, webapp-container and qtdeclarative5-
updated descriptions for all packages;
added missing multiarch stanza for webapp-
added missing predepends stanzas for multiarch packages.
Description of the change
Instructions for testing:
The name (UbuntuWebView → WebView) and namespace (Ubuntu.
From public API point of view, there are three scenarii to test:
import Ubuntu.
import Ubuntu.
import Ubuntu.Web 0.2 // new, same as above but renamed + API documentation
I have created three very simple click applications which can be used to test those scenarii, they all instantiate a webview that points to http://
Existing webapps (that use the webapp container) should also be thoroughly tested to ensure no regressions.
Finally the webbrowser app itself should be tested as well (changes to the app itself are minimal, the autopilot tests should cover us reasonably well here).
The API documentation can be generated with "make doc", you can see a preview at http://
There are debian packaging changes, I’ll make sure an ubuntu developer reviews them.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:561
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:563
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Bill Filler (bfiller) wrote : | # |
Couple of things I noticed in the clicks:
- com.ubuntu.
- com.ubuntu.
- com.ubuntu.
Bill Filler (bfiller) wrote : | # |
Sorry, correction
com.ubuntu.
com.ubuntu.
Bill Filler (bfiller) wrote : | # |
- browser-02: popup menus don't display, I think the user-agent string isn't getting set correctly either as google images looks different than on main browser
- browser-01: same issues, also typing in google search field causes the shift key to get turned on after every character which is quite odd
- com.ubuntu.
- 564. By Olivier Tilloy
-
Merge the latest changes from trunk and resolve a conflict.
Olivier Tilloy (osomon) wrote : | # |
The fact that popup menus don’t display is expected (and is not a regression): the application developer should provide a list of actions to be displayed (by default it is empty).
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:564
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
> The fact that popup menus don’t display is expected (and is not a regression):
> the application developer should provide a list of actions to be displayed (by
> default it is empty).
What’s not expected though is that an empty contextual menu is popped up. I filed bug #1326752 to track this issue.
Olivier Tilloy (osomon) wrote : | # |
> com.ubuntu.
> settings seem wrong, the initial size of the page is too small
>
> com.ubuntu.
> scrollbar issue with sizing
>
> browser-02: popup menus don't display, I think the user-agent string
> isn't getting set correctly either as google images looks different than
> on main browser
>
> browser-01: same issues, also typing in google search field causes the
> shift key to get turned on after every character which is quite odd
>
> com.ubuntu.
Except for the popup menu issue (which I explained above and for which I submitted a fix in a separate branch already), and for the google images one, I’m seeing all those issues in the current version of the image (without the changes this branch introduces). In other words, those are not new regressions, but existing bugs which I’ll investigate separately.
Olivier Tilloy (osomon) wrote : | # |
Note: regarding the issue with google images, I cannot reproduce it on my device, rendering looks the same within the test app and within the stock browser.
Olivier Tilloy (osomon) wrote : | # |
> com.ubuntu.
> scrollbar issue with sizing
Just tested on device with the latest oxide built from trunk, and the issue is gone, scrollbars are thin and semi-transparent as expected. I’m guessing this is a bug in the version of oxide that’s currently in the archive (based on revision 501 of lp:oxide, which is from two months ago). There’s a new release in preparation (based on revision 562 + selected bug fixes), it will hopefully resolve this issue and others.
Łukasz Zemczak (sil2100) wrote : | # |
In overall it looks good packaging-wise. One small thing that I noticed is that all the libs are missing Pre-Depends: ${misc:Pre-Depends} for all Multi-Arch packages. Could you add that for those binary packages? It's not anything serious, but it would be nice to have everything as it's supposed to.
The rest seems to look fine.
- 565. By Olivier Tilloy
-
Add missing pre-depends for multiarch packages.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:565
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2014-05-06 12:11:27 +0000 |
3 | +++ .bzrignore 2014-06-09 09:55:59 +0000 |
4 | @@ -24,12 +24,14 @@ |
5 | RE:tests/unittests/.+/tst_\w+Tests$ |
6 | tests/unittests/qml/undertest |
7 | po/*.gmo |
8 | +doc/html |
9 | |
10 | obj-* |
11 | debian/files |
12 | debian/tmp/ |
13 | debian/qtdeclarative5-ubuntu-ui-extras-browser-plugin/ |
14 | debian/qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets/ |
15 | +debian/qtdeclarative5-ubuntu-web-plugin/ |
16 | debian/webapp-container/ |
17 | debian/webapp-container-autopilot/ |
18 | debian/webbrowser-app/ |
19 | |
20 | === modified file 'CMakeLists.txt' |
21 | --- CMakeLists.txt 2014-05-06 07:49:11 +0000 |
22 | +++ CMakeLists.txt 2014-06-09 09:55:59 +0000 |
23 | @@ -61,6 +61,8 @@ |
24 | |
25 | add_subdirectory(po) |
26 | |
27 | +add_subdirectory(doc) |
28 | + |
29 | install(FILES webbrowser-app.svg |
30 | DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) |
31 | install(FILES screenshot.png |
32 | |
33 | === modified file 'debian/control' |
34 | --- debian/control 2014-05-22 15:27:38 +0000 |
35 | +++ debian/control 2014-06-09 09:55:59 +0000 |
36 | @@ -32,10 +32,12 @@ |
37 | Depends: ${misc:Depends}, |
38 | ${shlibs:Depends}, |
39 | liboxideqt-qmlplugin (>= 1.0.0~bzr490), |
40 | + libqt5sql5-sqlite, |
41 | qtdeclarative5-dialogs-plugin, |
42 | qtdeclarative5-qtquick2-plugin, |
43 | - qtdeclarative5-ubuntu-ui-extras-browser-plugin (= ${binary:Version}), |
44 | qtdeclarative5-ubuntu-ui-toolkit-plugin, |
45 | + qtdeclarative5-ubuntu-web-plugin (= ${binary:Version}), |
46 | + qtdeclarative5-unity-action-plugin, |
47 | qtdeclarative5-window-plugin, |
48 | Replaces: webbrowser-app-assets, |
49 | qtdeclarative5-ubuntu-ui-extras-browser-plugin (<< 0.22), |
50 | @@ -43,7 +45,7 @@ |
51 | Provides: webbrowser-app-assets |
52 | Breaks: qtdeclarative5-ubuntu-ui-extras-browser-plugin (<< 0.22) |
53 | Description: Ubuntu web browser |
54 | - A lightweight web browser tailored for Ubuntu, based on the Webkit rendering |
55 | + A lightweight web browser tailored for Ubuntu, based on the Oxide browser |
56 | engine and using the Ubuntu UI components. |
57 | |
58 | Package: webapp-container |
59 | @@ -51,44 +53,63 @@ |
60 | Multi-Arch: foreign |
61 | Depends: ${misc:Depends}, |
62 | ${shlibs:Depends}, |
63 | - libqt5webkit5-qmlwebkitplugin, |
64 | + liboxideqt-qmlplugin, |
65 | + libqt5sql5-sqlite, |
66 | + libqt5webkit5-qmlwebkitplugin, |
67 | qtdeclarative5-accounts-plugin, |
68 | qtdeclarative5-qtquick2-plugin (>= 5.2), |
69 | + qtdeclarative5-ubuntu-ui-extras-browser-plugin (= ${binary:Version}), |
70 | + qtdeclarative5-ubuntu-web-plugin (= ${binary:Version}), |
71 | + qtdeclarative5-unity-action-plugin, |
72 | unity-webapps-qml, |
73 | webbrowser-app (= ${binary:Version}), |
74 | Suggests: qtdeclarative5-online-accounts-client0.1 (>= 0.3), |
75 | Description: Ubuntu web applications container |
76 | - A lightweight webapps container tailored for Ubuntu, based on the Webkit |
77 | - rendering engine and using the Ubuntu UI components. |
78 | + A lightweight webapp container tailored for Ubuntu, based on the Oxide browser |
79 | + engine and using the Ubuntu UI components. |
80 | |
81 | Package: qtdeclarative5-ubuntu-ui-extras-browser-plugin |
82 | Architecture: any |
83 | Multi-Arch: same |
84 | +Pre-Depends: ${misc:Pre-Depends} |
85 | Depends: ${misc:Depends}, |
86 | ${shlibs:Depends}, |
87 | - libqt5sql5-sqlite, |
88 | libqt5webkit5-qmlwebkitplugin, |
89 | - liboxideqt-qmlplugin, |
90 | qtdeclarative5-qtquick2-plugin, |
91 | qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets (>= ${source:Version}), |
92 | qtdeclarative5-ubuntu-ui-toolkit-plugin, |
93 | - qtdeclarative5-unity-action-plugin, |
94 | + qtdeclarative5-ubuntu-web-plugin (= ${binary:Version}), |
95 | qtdeclarative5-window-plugin, |
96 | Replaces: webbrowser-app (<< 0.21) |
97 | Breaks: webbrowser-app (<< 0.21) |
98 | -Description: Ubuntu web browser QML plugin |
99 | - A lightweight web browser tailored for Ubuntu, based on the Webkit rendering |
100 | - engine and using the Ubuntu UI components. This package contains a standalone |
101 | - QML plugin that applications can use to embed a browser control. |
102 | +Description: Ubuntu web QML plugin |
103 | + A standalone QML plugin that contains the UbuntuWebView component |
104 | + (versions 0.1 based on WebKit and 0.2 based on Oxide), in the |
105 | + Ubuntu.Components.Extras.Browser module. |
106 | |
107 | Package: qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets |
108 | Architecture: all |
109 | Multi-Arch: foreign |
110 | Depends: ${misc:Depends}, |
111 | -Description: Ubuntu web browser QML plugin assets |
112 | - A lightweight web browser tailored for Ubuntu, based on the Webkit rendering |
113 | - engine and using the Ubuntu UI components. This package contains the |
114 | - PNGs used as UI elements by the QML plugin. |
115 | +Description: Ubuntu web QML plugin assets |
116 | + A standalone QML plugin that contains the UbuntuWebView component |
117 | + (versions 0.1 based on WebKit and 0.2 based on Oxide), in the |
118 | + Ubuntu.Components.Extras.Browser module. This package contains the |
119 | + PNGs used as UI elements by the plugin. |
120 | + |
121 | +Package: qtdeclarative5-ubuntu-web-plugin |
122 | +Architecture: any |
123 | +Multi-Arch: same |
124 | +Pre-Depends: ${misc:Pre-Depends} |
125 | +Depends: ${misc:Depends}, |
126 | + ${shlibs:Depends}, |
127 | + liboxideqt-qmlplugin, |
128 | + qtdeclarative5-qtquick2-plugin, |
129 | + qtdeclarative5-ubuntu-ui-toolkit-plugin, |
130 | + qtdeclarative5-window-plugin, |
131 | +Description: Ubuntu web QML plugin |
132 | + A standalone QML plugin that contains the WebView component, |
133 | + in the Ubuntu.Web module. |
134 | |
135 | Package: webbrowser-app-autopilot |
136 | Architecture: all |
137 | @@ -101,12 +122,13 @@ |
138 | unity8-autopilot, |
139 | webbrowser-app (>= ${binary:Version}), |
140 | Description: Ubuntu web browser autopilot tests |
141 | - A lightweight web browser tailored for Ubuntu, based on the Webkit rendering |
142 | + A lightweight web browser tailored for Ubuntu, based on the Oxide browser |
143 | engine and using the Ubuntu UI components. This package contains autopilot |
144 | tests for it. |
145 | |
146 | Package: webapp-container-autopilot |
147 | Architecture: all |
148 | +Multi-Arch: foreign |
149 | Depends: ${misc:Depends}, |
150 | libautopilot-qt (>= 1.4), |
151 | libqt5test5, |
152 | @@ -114,6 +136,6 @@ |
153 | ubuntu-ui-toolkit-autopilot, |
154 | webapp-container (>= ${binary:Version}), |
155 | Description: Ubuntu web applications container autopilot tests |
156 | - A lightweight webapps container tailored for Ubuntu, based on the Webkit |
157 | - rendering engine and using the Ubuntu UI components. This package contains autopilot |
158 | + A lightweight webapp container tailored for Ubuntu, based on the Oxide browser |
159 | + engine and using the Ubuntu UI components. This package contains autopilot |
160 | tests for it. |
161 | |
162 | === added file 'debian/qtdeclarative5-ubuntu-web-plugin.install' |
163 | --- debian/qtdeclarative5-ubuntu-web-plugin.install 1970-01-01 00:00:00 +0000 |
164 | +++ debian/qtdeclarative5-ubuntu-web-plugin.install 2014-06-09 09:55:59 +0000 |
165 | @@ -0,0 +1,1 @@ |
166 | +usr/lib/*/qt5/qml/Ubuntu/Web/* |
167 | |
168 | === added file 'debian/qtdeclarative5-ubuntu-web-plugin.lintian-overrides' |
169 | --- debian/qtdeclarative5-ubuntu-web-plugin.lintian-overrides 1970-01-01 00:00:00 +0000 |
170 | +++ debian/qtdeclarative5-ubuntu-web-plugin.lintian-overrides 2014-06-09 09:55:59 +0000 |
171 | @@ -0,0 +1,3 @@ |
172 | +qtdeclarative5-ubuntu-web-plugin: pkg-has-shlibs-control-file-but-no-actual-shared-libs |
173 | +qtdeclarative5-ubuntu-web-plugin: postinst-has-useless-call-to-ldconfig |
174 | +qtdeclarative5-ubuntu-web-plugin: postrm-has-useless-call-to-ldconfig |
175 | |
176 | === added directory 'doc' |
177 | === added file 'doc/CMakeLists.txt' |
178 | --- doc/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
179 | +++ doc/CMakeLists.txt 2014-06-09 09:55:59 +0000 |
180 | @@ -0,0 +1,11 @@ |
181 | +project(webbrowser-doc) |
182 | + |
183 | +find_program(QDOC_EXECUTABLE qdoc) |
184 | +if(QDOC_EXECUTABLE STREQUAL "QDOC_EXECUTABLE-NOTFOUND") |
185 | + message(WARNING "qdoc not found, documentation cannot be built") |
186 | +else() |
187 | + add_custom_target(doc |
188 | + COMMAND ${QDOC_EXECUTABLE} |
189 | + -outputdir ${CMAKE_CURRENT_BINARY_DIR}/html |
190 | + ${CMAKE_CURRENT_SOURCE_DIR}/ubuntu-web.qdocconf) |
191 | +endif() |
192 | |
193 | === added file 'doc/SharedWebContext.qdoc' |
194 | --- doc/SharedWebContext.qdoc 1970-01-01 00:00:00 +0000 |
195 | +++ doc/SharedWebContext.qdoc 2014-06-09 09:55:59 +0000 |
196 | @@ -0,0 +1,39 @@ |
197 | +/* |
198 | + * Copyright 2013 Canonical Ltd. |
199 | + * |
200 | + * This file is part of webbrowser-app. |
201 | + * |
202 | + * webbrowser-app is free software; you can redistribute it and/or modify |
203 | + * it under the terms of the GNU General Public License as published by |
204 | + * the Free Software Foundation; version 3. |
205 | + * |
206 | + * webbrowser-app is distributed in the hope that it will be useful, |
207 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
208 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
209 | + * GNU General Public License for more details. |
210 | + * |
211 | + * You should have received a copy of the GNU General Public License |
212 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
213 | + */ |
214 | + |
215 | +/*! |
216 | + \qmltype SharedWebContext |
217 | + \inqmlmodule Ubuntu.Web 0.2 |
218 | + \ingroup ubuntu |
219 | + \brief A singleton that exposes a shared \l WebContext that can be used |
220 | + by several \l WebView instances in the same application. |
221 | + |
222 | + Note that the \l WebView component already uses the shared context. |
223 | + */ |
224 | + |
225 | +/*! |
226 | + \qmlproperty WebContext SharedWebContext::sharedContext |
227 | + |
228 | + The \l WebContext instance that several \l WebView instances can share. |
229 | + */ |
230 | + |
231 | +/*! |
232 | + \qmlproperty string SharedWebContext::customUA |
233 | + |
234 | + An alias to the shared context’s default user agent string. |
235 | + */ |
236 | |
237 | === added file 'doc/WebContext.qdoc' |
238 | --- doc/WebContext.qdoc 1970-01-01 00:00:00 +0000 |
239 | +++ doc/WebContext.qdoc 2014-06-09 09:55:59 +0000 |
240 | @@ -0,0 +1,70 @@ |
241 | +/* |
242 | + * Copyright 2014 Canonical Ltd. |
243 | + * |
244 | + * This file is part of webbrowser-app. |
245 | + * |
246 | + * webbrowser-app is free software; you can redistribute it and/or modify |
247 | + * it under the terms of the GNU General Public License as published by |
248 | + * the Free Software Foundation; version 3. |
249 | + * |
250 | + * webbrowser-app is distributed in the hope that it will be useful, |
251 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
252 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
253 | + * GNU General Public License for more details. |
254 | + * |
255 | + * You should have received a copy of the GNU General Public License |
256 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
257 | + */ |
258 | + |
259 | +/*! |
260 | + \qmltype WebContext |
261 | + \inqmlmodule Ubuntu.Web 0.2 |
262 | + \ingroup ubuntu |
263 | + \brief A default context implementation for use with \l WebView. |
264 | + |
265 | + This default WebContext implementation has the default user agent string |
266 | + used by the Ubuntu browser as well as the UA override mechanism that allows |
267 | + sending an overridden user agent for given domains/websites, based on the |
268 | + form factor. |
269 | + |
270 | + It has its data path (for cache and cookie database) set to the standard |
271 | + writable data location for the current application, which is based on the |
272 | + application name (see \c Qt.application.name), for example |
273 | + \e ~/.local/share/myApp/. |
274 | + |
275 | + Note that the \l WebView component already uses this default context, so |
276 | + there is no need to explicitly instantiate a \c WebContext unless you |
277 | + want to override some of its default properties. |
278 | + |
279 | + \sa SharedWebContext |
280 | + */ |
281 | + |
282 | +// Note: only a subset of the properties of Oxide’s WebContext are documented |
283 | +// here. This is intentional, typical applications are not expected to be |
284 | +// needing the full set of properties and methods exposed by Oxide. |
285 | + |
286 | +/*! |
287 | + \qmlproperty string WebContext::userAgent |
288 | + |
289 | + The default user agent string that will be sent with each HTTP request. |
290 | + */ |
291 | + |
292 | +/*! |
293 | + \qmlproperty url WebContext::dataPath |
294 | + |
295 | + The local path where persistent data (such as cookies) will be stored. |
296 | + */ |
297 | + |
298 | +/*! |
299 | + \qmlproperty url WebContext::cachePath |
300 | + |
301 | + The local path where network data will be cached. |
302 | + If not set, it defaults to \l dataPath. |
303 | + */ |
304 | + |
305 | +/*! |
306 | + \qmlproperty string WebContext::acceptLangs |
307 | + |
308 | + The list of accepted languages (the Accept-Language HTTP header), |
309 | + as a comma-separated list of language codes. |
310 | + */ |
311 | |
312 | === added file 'doc/WebView.qdoc' |
313 | --- doc/WebView.qdoc 1970-01-01 00:00:00 +0000 |
314 | +++ doc/WebView.qdoc 2014-06-09 09:55:59 +0000 |
315 | @@ -0,0 +1,207 @@ |
316 | +/* |
317 | + * Copyright 2014 Canonical Ltd. |
318 | + * |
319 | + * This file is part of webbrowser-app. |
320 | + * |
321 | + * webbrowser-app is free software; you can redistribute it and/or modify |
322 | + * it under the terms of the GNU General Public License as published by |
323 | + * the Free Software Foundation; version 3. |
324 | + * |
325 | + * webbrowser-app is distributed in the hope that it will be useful, |
326 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
327 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
328 | + * GNU General Public License for more details. |
329 | + * |
330 | + * You should have received a copy of the GNU General Public License |
331 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
332 | + */ |
333 | + |
334 | +/*! |
335 | + \qmltype WebView |
336 | + \inqmlmodule Ubuntu.Web 0.2 |
337 | + \ingroup ubuntu |
338 | + \brief A webview that can be used to render web content in an application. |
339 | + |
340 | + Here is a very simple example of how to use a WebView to render a web page: |
341 | + \qml |
342 | + import QtQuick 2.0 |
343 | + import Ubuntu.Web 0.2 |
344 | + |
345 | + WebView { |
346 | + url: "http://ubuntu.com" |
347 | + } |
348 | + \endqml |
349 | + |
350 | + The \c WebView component defaults to using a \l {SharedWebContext} |
351 | + {shared \c WebContext} that is shared across all \c WebView instances |
352 | + in a given application. |
353 | + |
354 | + \sa SharedWebContext |
355 | + */ |
356 | + |
357 | +/*! |
358 | + \qmlproperty url WebView::url |
359 | + |
360 | + The URL of the current page. |
361 | + */ |
362 | + |
363 | +/*! |
364 | + \qmlproperty string WebView::title |
365 | + |
366 | + The title of the current page. |
367 | + */ |
368 | + |
369 | +/*! |
370 | + \qmlproperty url WebView::icon |
371 | + |
372 | + The URL of the favicon of the current page. |
373 | + */ |
374 | + |
375 | +/*! |
376 | + \qmlproperty bool WebView::canGoBack |
377 | + |
378 | + Whether the navigation history has a previous entry to navigate back. |
379 | + |
380 | + \sa goBack, canGoForward |
381 | + */ |
382 | + |
383 | +/*! |
384 | + \qmlproperty bool WebView::canGoForward |
385 | + |
386 | + Whether the navigation history has a next entry to navigate forward. |
387 | + |
388 | + \sa goForward, canGoBack |
389 | + */ |
390 | + |
391 | +/*! |
392 | + \qmlproperty bool WebView::incognito |
393 | + |
394 | + Whether the WebView is being used in private browsing mode, |
395 | + where no data is persisted across sessions. |
396 | + */ |
397 | + |
398 | +/*! |
399 | + \qmlproperty bool WebView::loading |
400 | + |
401 | + Whether the current page is loading. |
402 | + |
403 | + \sa loadProgress, stop, reload |
404 | + */ |
405 | + |
406 | +/*! |
407 | + \qmlproperty bool WebView::fullscreen |
408 | + |
409 | + Whether the current page requested fullscreen display. |
410 | + */ |
411 | + |
412 | +/*! |
413 | + \qmlproperty int WebView::loadProgress |
414 | + |
415 | + The load progress of the current page |
416 | + (as a integer value between 0 and 100). |
417 | + |
418 | + \sa loading |
419 | + */ |
420 | + |
421 | +/*! |
422 | + \qmlproperty component WebView::alertDialog |
423 | + |
424 | + The QML component that will be instantiated to display |
425 | + a JavaScript alert dialog. |
426 | + |
427 | + \sa confirmDialog, promptDialog, beforeUnloadDialog |
428 | + */ |
429 | + |
430 | +/*! |
431 | + \qmlproperty component WebView::confirmDialog |
432 | + |
433 | + The QML component that will be instantiated to display |
434 | + a JavaScript confirmation dialog. |
435 | + |
436 | + \sa alertDialog, promptDialog, beforeUnloadDialog |
437 | + */ |
438 | + |
439 | +/*! |
440 | + \qmlproperty component WebView::promptDialog |
441 | + |
442 | + The QML component that will be instantiated to display |
443 | + a JavaScript prompt dialog. |
444 | + |
445 | + \sa alertDialog, confirmDialog, beforeUnloadDialog |
446 | + */ |
447 | + |
448 | +/*! |
449 | + \qmlproperty component WebView::beforeUnloadDialog |
450 | + |
451 | + The QML component that will be instantiated to display |
452 | + a JavaScript confirmation when the user initiates a navigation away from |
453 | + the current page, if the page has defined an \c onBeforeUnload handler. |
454 | + |
455 | + \sa alertDialog, confirmDialog, promptDialog |
456 | + */ |
457 | + |
458 | +/*! |
459 | + \qmlproperty component WebView::filePicker |
460 | + |
461 | + The QML component that will be instantiated to let the user select files |
462 | + when the user clicks an \c {<input type="file">} element |
463 | + on the current page. |
464 | + */ |
465 | + |
466 | +/*! |
467 | + \qmlproperty WebContext WebView::context |
468 | + |
469 | + The web context associated to this WebView. |
470 | + By default a \l {SharedWebContext} {shared context} is used which should |
471 | + fit most use cases, do not override unless you really need a finer control |
472 | + over the context. |
473 | + */ |
474 | + |
475 | +/*! |
476 | + \qmlproperty list WebView::navigationHistory |
477 | + |
478 | + The navigation history (back/forward entries) stored as a list model |
479 | + with a \c currentIndex property. Each entry exposes the URL and title of |
480 | + the corresponding page, as well as a timestamp of when it was visited. |
481 | + */ |
482 | + |
483 | +/*! |
484 | + \qmlmethod void WebView::goBack() |
485 | + |
486 | + Go back one entry in the navigation history. |
487 | + |
488 | + \sa canGoBack, goForward |
489 | + */ |
490 | + |
491 | +/*! |
492 | + \qmlmethod void WebView::goForward() |
493 | + |
494 | + Go forward one entry in the navigation history. |
495 | + |
496 | + \sa canGoForward, goBack |
497 | + */ |
498 | + |
499 | +/*! |
500 | + \qmlmethod void WebView::stop() |
501 | + |
502 | + Stop loading the current page. |
503 | + Does nothing if there is no page currently loading. |
504 | + |
505 | + \sa reload, loading |
506 | + */ |
507 | + |
508 | +/*! |
509 | + \qmlmethod void WebView::reload() |
510 | + |
511 | + Reload the current page. |
512 | + |
513 | + \sa stop |
514 | + */ |
515 | + |
516 | +/*! |
517 | + \qmlmethod void WebView::loadHtml(string html, url baseUrl) |
518 | + |
519 | + Load HTML content from memory instead of loading it from a URL. |
520 | + The \c baseUrl argument is used to resolve relative URLs in the provided |
521 | + content. |
522 | + */ |
523 | |
524 | === added file 'doc/ubuntu-web.qdoc' |
525 | --- doc/ubuntu-web.qdoc 1970-01-01 00:00:00 +0000 |
526 | +++ doc/ubuntu-web.qdoc 2014-06-09 09:55:59 +0000 |
527 | @@ -0,0 +1,22 @@ |
528 | +/* |
529 | + * Copyright 2014 Canonical Ltd. |
530 | + * |
531 | + * This file is part of webbrowser-app. |
532 | + * |
533 | + * webbrowser-app is free software; you can redistribute it and/or modify |
534 | + * it under the terms of the GNU General Public License as published by |
535 | + * the Free Software Foundation; version 3. |
536 | + * |
537 | + * webbrowser-app is distributed in the hope that it will be useful, |
538 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
539 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
540 | + * GNU General Public License for more details. |
541 | + * |
542 | + * You should have received a copy of the GNU General Public License |
543 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
544 | + */ |
545 | + |
546 | +/*! |
547 | + \qmlmodule Ubuntu.Web 0.2 |
548 | + \title Ubuntu Web module |
549 | + */ |
550 | |
551 | === added file 'doc/ubuntu-web.qdocconf' |
552 | --- doc/ubuntu-web.qdocconf 1970-01-01 00:00:00 +0000 |
553 | +++ doc/ubuntu-web.qdocconf 2014-06-09 09:55:59 +0000 |
554 | @@ -0,0 +1,10 @@ |
555 | +project = UbuntuWeb |
556 | +description = Ubuntu Web module documentation |
557 | +sourcedirs = ./ |
558 | +sources.fileextensions = "*.qdoc" |
559 | +outputdir = html |
560 | +outputformats = HTML |
561 | +version = 0.2 |
562 | +syntaxhightlighting = true |
563 | +sourceencoding = UTF-8 |
564 | +outputencoding = UTF-8 |
565 | |
566 | === modified file 'src/Ubuntu/CMakeLists.txt' |
567 | --- src/Ubuntu/CMakeLists.txt 2013-07-02 07:58:19 +0000 |
568 | +++ src/Ubuntu/CMakeLists.txt 2014-06-09 09:55:59 +0000 |
569 | @@ -1,1 +1,23 @@ |
570 | +if(NOT CMAKE_CROSSCOMPILING) |
571 | + find_program(QMAKE_EXECUTABLE qmake) |
572 | + if(QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND") |
573 | + message(FATAL_ERROR "qmake not found") |
574 | + endif() |
575 | + execute_process( |
576 | + COMMAND ${QMAKE_EXECUTABLE} -query QT_INSTALL_QML |
577 | + RESULT_VARIABLE RESULT |
578 | + OUTPUT_VARIABLE QT_INSTALL_QML |
579 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
580 | + ) |
581 | + if(NOT RESULT EQUAL 0) |
582 | + message(FATAL_ERROR "Failed to determine QT_INSTALL_QML from qmake") |
583 | + endif() |
584 | +else() |
585 | + # qmake isn't multi-arch aware as it installs arch-specific mkspec files |
586 | + # in to /usr/share, so we can't use it here (we'd need a qmake binary |
587 | + # for the host arch using data for the target arch) |
588 | + set(QT_INSTALL_QML "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml") |
589 | +endif() |
590 | + |
591 | add_subdirectory(Components) |
592 | +add_subdirectory(Web) |
593 | |
594 | === modified file 'src/Ubuntu/Components/Extras/Browser/CMakeLists.txt' |
595 | --- src/Ubuntu/Components/Extras/Browser/CMakeLists.txt 2014-05-06 07:49:11 +0000 |
596 | +++ src/Ubuntu/Components/Extras/Browser/CMakeLists.txt 2014-06-09 09:55:59 +0000 |
597 | @@ -1,25 +1,5 @@ |
598 | project(webbrowser-plugin) |
599 | |
600 | -if(NOT CMAKE_CROSSCOMPILING) |
601 | - find_program(QMAKE_EXECUTABLE qmake) |
602 | - if(QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND") |
603 | - message(FATAL_ERROR "qmake not found") |
604 | - endif() |
605 | - execute_process( |
606 | - COMMAND ${QMAKE_EXECUTABLE} -query QT_INSTALL_QML |
607 | - RESULT_VARIABLE RESULT |
608 | - OUTPUT_VARIABLE QT_INSTALL_QML |
609 | - OUTPUT_STRIP_TRAILING_WHITESPACE |
610 | - ) |
611 | - if(NOT RESULT EQUAL 0) |
612 | - message(FATAL_ERROR "Failed to determine QT_INSTALL_QML from qmake") |
613 | - endif() |
614 | -else() |
615 | - # qmake isn't multi-arch aware as it installs arch-specific mkspec files |
616 | - # in to /usr/share, so we can't use it here (we'd need a qmake binary |
617 | - # for the host arch using data for the target arch) |
618 | - set(QT_INSTALL_QML "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml") |
619 | -endif() |
620 | set(WEBBROWSER_IMPORTS_DIR "${QT_INSTALL_QML}/Ubuntu/Components/Extras/Browser") |
621 | |
622 | set(PLUGIN ubuntu-ui-extras-browser-plugin) |
623 | @@ -46,6 +26,6 @@ |
624 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} |
625 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${CMAKE_CURRENT_BINARY_DIR}/${_file}) |
626 | endforeach(_file) |
627 | - add_custom_target(copy_files_to_build_dir DEPENDS ${copied}) |
628 | - add_dependencies(${PLUGIN} copy_files_to_build_dir) |
629 | + add_custom_target(copy_files_to_build_dir_legacy DEPENDS ${copied}) |
630 | + add_dependencies(${PLUGIN} copy_files_to_build_dir_legacy) |
631 | endif() |
632 | |
633 | === added symlink 'src/Ubuntu/Components/Extras/Browser/ItemSelector02.qml' |
634 | === target is u'../../../Web/ItemSelector02.qml' |
635 | === added symlink 'src/Ubuntu/Components/Extras/Browser/UbuntuSharedWebContext.qml' |
636 | === target is u'../../../Web/UbuntuSharedWebContext.qml' |
637 | === added symlink 'src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml' |
638 | === target is u'../../../Web/UbuntuWebContext.qml' |
639 | === added symlink 'src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml' |
640 | === target is u'../../../Web/UbuntuWebView02.qml' |
641 | === added symlink 'src/Ubuntu/Components/Extras/Browser/UserAgent02.qml' |
642 | === target is u'../../../Web/UserAgent02.qml' |
643 | === added symlink 'src/Ubuntu/Components/Extras/Browser/plugin.cpp' |
644 | === target is u'../../../Web/plugin.cpp' |
645 | === added symlink 'src/Ubuntu/Components/Extras/Browser/plugin.h' |
646 | === target is u'../../../Web/plugin.h' |
647 | === modified file 'src/Ubuntu/Components/Extras/Browser/qmldir' |
648 | --- src/Ubuntu/Components/Extras/Browser/qmldir 2014-04-16 09:21:28 +0000 |
649 | +++ src/Ubuntu/Components/Extras/Browser/qmldir 2014-06-09 09:55:59 +0000 |
650 | @@ -3,6 +3,8 @@ |
651 | UbuntuWebView 0.1 UbuntuWebView01.qml |
652 | UbuntuWebView 0.2 UbuntuWebView02.qml |
653 | singleton UbuntuSharedWebContext 0.2 UbuntuSharedWebContext.qml |
654 | +singleton SharedWebContext 0.2 UbuntuSharedWebContext.qml |
655 | UbuntuWebContext 0.2 UbuntuWebContext.qml |
656 | -# Without the following line, importing version 0.1 of the module fails |
657 | +# Without the following lines, importing version 0.1 of the module fails |
658 | singleton UbuntuSharedWebContext 0.1 dummysingleton.qml |
659 | +singleton SharedWebContext 0.1 dummysingleton.qml |
660 | |
661 | === added symlink 'src/Ubuntu/Components/Extras/Browser/selection02.js' |
662 | === target is u'../../../Web/selection02.js' |
663 | === added symlink 'src/Ubuntu/Components/Extras/Browser/ua-override-worker.js' |
664 | === target is u'../../../Web/ua-override-worker.js' |
665 | === added symlink 'src/Ubuntu/Components/Extras/Browser/ua-overrides-desktop.js' |
666 | === target is u'../../../Web/ua-overrides-desktop.js' |
667 | === added symlink 'src/Ubuntu/Components/Extras/Browser/ua-overrides-mobile.js' |
668 | === target is u'../../../Web/ua-overrides-mobile.js' |
669 | === added directory 'src/Ubuntu/Web' |
670 | === added file 'src/Ubuntu/Web/CMakeLists.txt' |
671 | --- src/Ubuntu/Web/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
672 | +++ src/Ubuntu/Web/CMakeLists.txt 2014-06-09 09:55:59 +0000 |
673 | @@ -0,0 +1,26 @@ |
674 | +project(ubuntu-web-plugin) |
675 | + |
676 | +set(UBUNTU_WEB_IMPORTS_DIR "${QT_INSTALL_QML}/Ubuntu/Web") |
677 | + |
678 | +set(PLUGIN ubuntu-web-plugin) |
679 | + |
680 | +set(PLUGIN_SRC plugin.cpp) |
681 | + |
682 | +add_library(${PLUGIN} MODULE ${PLUGIN_SRC}) |
683 | + |
684 | +qt5_use_modules(${PLUGIN} Core Gui Qml) |
685 | + |
686 | +file(GLOB QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml qmldir *.js) |
687 | +install(TARGETS ${PLUGIN} DESTINATION ${UBUNTU_WEB_IMPORTS_DIR}) |
688 | +install(FILES ${QML_FILES} DESTINATION ${UBUNTU_WEB_IMPORTS_DIR}) |
689 | + |
690 | +if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) |
691 | + # copy qml files over to build dir to be able to import them uninstalled |
692 | + foreach(_file ${QML_FILES}) |
693 | + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file} |
694 | + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} |
695 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${CMAKE_CURRENT_BINARY_DIR}/${_file}) |
696 | + endforeach(_file) |
697 | + add_custom_target(copy_files_to_build_dir DEPENDS ${QML_FILES}) |
698 | + add_dependencies(${PLUGIN} copy_files_to_build_dir) |
699 | +endif() |
700 | |
701 | === renamed file 'src/Ubuntu/Components/Extras/Browser/ItemSelector02.qml' => 'src/Ubuntu/Web/ItemSelector02.qml' |
702 | === renamed file 'src/Ubuntu/Components/Extras/Browser/UbuntuSharedWebContext.qml' => 'src/Ubuntu/Web/UbuntuSharedWebContext.qml' |
703 | === renamed file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml' => 'src/Ubuntu/Web/UbuntuWebContext.qml' |
704 | --- src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml 2014-04-16 10:45:57 +0000 |
705 | +++ src/Ubuntu/Web/UbuntuWebContext.qml 2014-06-09 09:55:59 +0000 |
706 | @@ -17,12 +17,12 @@ |
707 | */ |
708 | |
709 | import QtQuick 2.0 |
710 | -import com.canonical.Oxide 1.0 |
711 | +import com.canonical.Oxide 1.0 as Oxide |
712 | |
713 | -WebContext { |
714 | +Oxide.WebContext { |
715 | dataPath: dataLocation |
716 | userAgent: __ua.defaultUA |
717 | - networkRequestDelegate: WebContextDelegateWorker { |
718 | + networkRequestDelegate: Oxide.WebContextDelegateWorker { |
719 | source: Qt.resolvedUrl("ua-override-worker.js") |
720 | onMessage: console.log("Overriden UA for", message.url, ":", message.override) |
721 | Component.onCompleted: { |
722 | @@ -44,15 +44,15 @@ |
723 | sessionCookieMode: { |
724 | if (typeof webContextSessionCookieMode !== 'undefined') { |
725 | if (webContextSessionCookieMode === "persistent") { |
726 | - return WebContext.SessionCookieModePersistent |
727 | + return Oxide.WebContext.SessionCookieModePersistent |
728 | } else if (webContextSessionCookieMode === "restored") { |
729 | - return WebContext.SessionCookieModeRestored |
730 | + return Oxide.WebContext.SessionCookieModeRestored |
731 | } |
732 | } |
733 | - return WebContext.SessionCookieModeEphemeral |
734 | + return Oxide.WebContext.SessionCookieModeEphemeral |
735 | } |
736 | userScripts: [ |
737 | - UserScript { |
738 | + Oxide.UserScript { |
739 | context: "oxide://selection/" |
740 | url: Qt.resolvedUrl("selection02.js") |
741 | incognitoEnabled: true |
742 | |
743 | === renamed file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml' => 'src/Ubuntu/Web/UbuntuWebView02.qml' |
744 | --- src/Ubuntu/Components/Extras/Browser/UbuntuWebView02.qml 2014-06-05 11:49:42 +0000 |
745 | +++ src/Ubuntu/Web/UbuntuWebView02.qml 2014-06-09 09:55:59 +0000 |
746 | @@ -18,16 +18,14 @@ |
747 | |
748 | import QtQuick 2.0 |
749 | import QtQuick.Window 2.0 |
750 | -import com.canonical.Oxide 1.0 |
751 | +import com.canonical.Oxide 1.0 as Oxide |
752 | import Ubuntu.Components 0.1 |
753 | import Ubuntu.Components.Popups 0.1 |
754 | -import "." |
755 | +import "." // QTBUG-34418 |
756 | |
757 | -WebView { |
758 | +Oxide.WebView { |
759 | id: _webview |
760 | |
761 | - //interactive: !selection.visible |
762 | - |
763 | /** |
764 | * Client overridable function called before the default treatment of a |
765 | * valid navigation request. This function can stop the navigation request |
766 | @@ -51,16 +49,16 @@ |
767 | return undefined |
768 | } |
769 | |
770 | - context: UbuntuSharedWebContext.sharedContext |
771 | + context: SharedWebContext.sharedContext |
772 | Component.onCompleted: { |
773 | var customUA = getUAString() |
774 | if (customUA !== undefined) { |
775 | - UbuntuSharedWebContext.customUA = customUA |
776 | + SharedWebContext.customUA = customUA |
777 | } |
778 | } |
779 | |
780 | messageHandlers: [ |
781 | - ScriptMessageHandler { |
782 | + Oxide.ScriptMessageHandler { |
783 | msgId: "contextmenu" |
784 | contexts: ["oxide://selection/"] |
785 | callback: function(msg, frame) { |
786 | @@ -90,7 +88,7 @@ |
787 | } |
788 | } |
789 | }, |
790 | - ScriptMessageHandler { |
791 | + Oxide.ScriptMessageHandler { |
792 | msgId: "scroll" |
793 | contexts: ["oxide://selection/"] |
794 | callback: function(msg, frame) { |
795 | @@ -102,141 +100,14 @@ |
796 | ] |
797 | |
798 | onNavigationRequested: { |
799 | - request.action = NavigationRequest.ActionAccept; |
800 | + request.action = Oxide.NavigationRequest.ActionAccept; |
801 | navigationRequestedDelegate(request); |
802 | } |
803 | |
804 | preferences.passwordEchoEnabled: formFactor === "mobile" |
805 | |
806 | - /*experimental.preferences.navigatorQtObjectEnabled: true |
807 | - experimental.userScripts: [Qt.resolvedUrl("selection.js")] |
808 | - experimental.onMessageReceived: { |
809 | - var data = null |
810 | - try { |
811 | - data = JSON.parse(message.data) |
812 | - } catch (error) { |
813 | - console.debug('DEBUG:', message.data) |
814 | - return |
815 | - } |
816 | - if ('event' in data) { |
817 | - if (data.event === 'longpress') { |
818 | - if (('img' in data) || ('href' in data)) { |
819 | - contextualData.clear() |
820 | - if ('img' in data) { |
821 | - contextualData.img = data.img |
822 | - } |
823 | - if ('href' in data) { |
824 | - contextualData.href = data.href |
825 | - contextualData.title = data.title |
826 | - } |
827 | - contextualRectangle.position(data) |
828 | - PopupUtils.open(contextualPopover, contextualRectangle) |
829 | - return |
830 | - } |
831 | - } |
832 | - if ((data.event === 'longpress') || (data.event === 'selectionadjusted')) { |
833 | - selection.clearData() |
834 | - selection.createData() |
835 | - if ('html' in data) { |
836 | - selection.mimedata.html = data.html |
837 | - } |
838 | - // FIXME: push the text and image data in the order |
839 | - // they appear in the selected block. |
840 | - if ('text' in data) { |
841 | - selection.mimedata.text = data.text |
842 | - } |
843 | - if ('images' in data) { |
844 | - // TODO: download and cache the images locally |
845 | - // (grab them from the webview’s cache, if possible), |
846 | - // and forward local URLs. |
847 | - selection.mimedata.urls = data.images |
848 | - } |
849 | - selection.show(data.left, data.top, data.width, data.height) |
850 | - } |
851 | - } |
852 | - }*/ |
853 | - |
854 | popupMenu: ItemSelector02 {} |
855 | |
856 | - /*property alias selection: selection |
857 | - property ActionList selectionActions |
858 | - Selection { |
859 | - id: selection |
860 | - |
861 | - anchors.fill: parent |
862 | - visible: false |
863 | - |
864 | - property Item __popover: null |
865 | - property var mimedata: null |
866 | - |
867 | - Component { |
868 | - id: selectionPopover |
869 | - ActionSelectionPopover { |
870 | - grabDismissAreaEvents: false |
871 | - actions: selectionActions |
872 | - } |
873 | - } |
874 | - |
875 | - function createData() { |
876 | - if (mimedata === null) { |
877 | - mimedata = Clipboard.newData() |
878 | - } |
879 | - } |
880 | - |
881 | - function clearData() { |
882 | - if (mimedata !== null) { |
883 | - delete mimedata |
884 | - mimedata = null |
885 | - } |
886 | - } |
887 | - |
888 | - function actionTriggered() { |
889 | - selection.visible = false |
890 | - } |
891 | - |
892 | - function __showPopover() { |
893 | - __popover = PopupUtils.open(selectionPopover, selection.rect) |
894 | - var actions = __popover.actions.actions |
895 | - for (var i in actions) { |
896 | - actions[i].onTriggered.connect(actionTriggered) |
897 | - } |
898 | - } |
899 | - |
900 | - function show(x, y, width, height) { |
901 | - var scale = _webview.experimental.test.contentsScale * _webview.experimental.test.devicePixelRatio |
902 | - rect.x = x * scale + _webview.contentX |
903 | - rect.y = y * scale + _webview.contentY |
904 | - rect.width = width * scale |
905 | - rect.height = height * scale |
906 | - visible = true |
907 | - __showPopover() |
908 | - } |
909 | - |
910 | - onVisibleChanged: { |
911 | - if (!visible && (__popover != null)) { |
912 | - PopupUtils.close(__popover) |
913 | - __popover = null |
914 | - } |
915 | - } |
916 | - |
917 | - onResized: { |
918 | - var message = new Object |
919 | - message.query = 'adjustselection' |
920 | - var rect = selection.rect |
921 | - var scale = _webview.experimental.test.contentsScale * _webview.experimental.test.devicePixelRatio |
922 | - message.left = (rect.x - _webview.contentX) / scale |
923 | - message.right = (rect.x + rect.width - _webview.contentX) / scale |
924 | - message.top = (rect.y - _webview.contentY) / scale |
925 | - message.bottom = (rect.y + rect.height - _webview.contentY) / scale |
926 | - _webview.experimental.postMessage(JSON.stringify(message)) |
927 | - } |
928 | - |
929 | - function copy() { |
930 | - Clipboard.push(mimedata) |
931 | - clearData() |
932 | - } |
933 | - }*/ |
934 | - |
935 | Item { |
936 | id: contextualRectangle |
937 | |
938 | @@ -275,9 +146,9 @@ |
939 | property Item currentContextualMenu: null |
940 | } |
941 | |
942 | - readonly property bool lastLoadSucceeded: internal.lastLoadRequestStatus === LoadEvent.TypeSucceeded |
943 | - readonly property bool lastLoadStopped: internal.lastLoadRequestStatus === LoadEvent.TypeStopped |
944 | - readonly property bool lastLoadFailed: internal.lastLoadRequestStatus === LoadEvent.TypeFailed |
945 | + readonly property bool lastLoadSucceeded: internal.lastLoadRequestStatus === Oxide.LoadEvent.TypeSucceeded |
946 | + readonly property bool lastLoadStopped: internal.lastLoadRequestStatus === Oxide.LoadEvent.TypeStopped |
947 | + readonly property bool lastLoadFailed: internal.lastLoadRequestStatus === Oxide.LoadEvent.TypeFailed |
948 | onLoadingChanged: { |
949 | if (loadEvent.url.toString() !== "data:text/html,chromewebdata") { |
950 | internal.lastLoadRequestStatus = loadEvent.type |
951 | @@ -293,15 +164,15 @@ |
952 | |
953 | onJavaScriptConsoleMessage: { |
954 | var msg = "[JS] (%1:%2) %3".arg(sourceId).arg(lineNumber).arg(message) |
955 | - if (level === WebView.LogSeverityVerbose) { |
956 | + if (level === Oxide.WebView.LogSeverityVerbose) { |
957 | console.log(msg) |
958 | - } else if (level === WebView.LogSeverityInfo) { |
959 | + } else if (level === Oxide.WebView.LogSeverityInfo) { |
960 | console.info(msg) |
961 | - } else if (level === WebView.LogSeverityWarning) { |
962 | + } else if (level === Oxide.WebView.LogSeverityWarning) { |
963 | console.warn(msg) |
964 | - } else if ((level === WebView.LogSeverityError) || |
965 | - (level === WebView.LogSeverityErrorReport) || |
966 | - (level === WebView.LogSeverityFatal)) { |
967 | + } else if ((level === Oxide.WebView.LogSeverityError) || |
968 | + (level === Oxide.WebView.LogSeverityErrorReport) || |
969 | + (level === Oxide.WebView.LogSeverityFatal)) { |
970 | console.error(msg) |
971 | } |
972 | } |
973 | |
974 | === renamed file 'src/Ubuntu/Components/Extras/Browser/UserAgent02.qml' => 'src/Ubuntu/Web/UserAgent02.qml' |
975 | === renamed file 'src/Ubuntu/Components/Extras/Browser/plugin.cpp' => 'src/Ubuntu/Web/plugin.cpp' |
976 | --- src/Ubuntu/Components/Extras/Browser/plugin.cpp 2014-03-19 22:17:40 +0000 |
977 | +++ src/Ubuntu/Web/plugin.cpp 2014-06-09 09:55:59 +0000 |
978 | @@ -1,5 +1,5 @@ |
979 | /* |
980 | - * Copyright 2013 Canonical Ltd. |
981 | + * Copyright 2013-2014 Canonical Ltd. |
982 | * |
983 | * This file is part of webbrowser-app. |
984 | * |
985 | @@ -74,14 +74,17 @@ |
986 | QQmlContext* context = engine->rootContext(); |
987 | context->setContextProperty("dataLocation", dataLocation.absolutePath()); |
988 | |
989 | - // Set the desired pixel ratio (not needed once we use Qt’s way of |
990 | - // calculating the proper pixel ratio by device/screen). |
991 | - context->setContextProperty("QtWebKitDPR", getQtWebkitDpr()); |
992 | + if (uri == QLatin1String("Ubuntu.Components.Extras.Browser")) { |
993 | + // Set the desired pixel ratio (not needed once we use Qt’s way of |
994 | + // calculating the proper pixel ratio by device/screen). |
995 | + context->setContextProperty("QtWebKitDPR", getQtWebkitDpr()); |
996 | + } |
997 | |
998 | context->setContextProperty("formFactor", getFormFactor()); |
999 | } |
1000 | |
1001 | void UbuntuBrowserPlugin::registerTypes(const char* uri) |
1002 | { |
1003 | - Q_ASSERT(uri == QLatin1String("Ubuntu.Components.Extras.Browser")); |
1004 | + Q_ASSERT(uri == QLatin1String("Ubuntu.Components.Extras.Browser") |
1005 | + || uri == QLatin1String("Ubuntu.Web")); |
1006 | } |
1007 | |
1008 | === renamed file 'src/Ubuntu/Components/Extras/Browser/plugin.h' => 'src/Ubuntu/Web/plugin.h' |
1009 | === added file 'src/Ubuntu/Web/qmldir' |
1010 | --- src/Ubuntu/Web/qmldir 1970-01-01 00:00:00 +0000 |
1011 | +++ src/Ubuntu/Web/qmldir 2014-06-09 09:55:59 +0000 |
1012 | @@ -0,0 +1,5 @@ |
1013 | +module Ubuntu.Web |
1014 | +plugin ubuntu-web-plugin |
1015 | +WebView 0.2 UbuntuWebView02.qml |
1016 | +WebContext 0.2 UbuntuWebContext.qml |
1017 | +singleton SharedWebContext 0.2 UbuntuSharedWebContext.qml |
1018 | |
1019 | === renamed file 'src/Ubuntu/Components/Extras/Browser/selection02.js' => 'src/Ubuntu/Web/selection02.js' |
1020 | --- src/Ubuntu/Components/Extras/Browser/selection02.js 2014-04-23 12:30:01 +0000 |
1021 | +++ src/Ubuntu/Web/selection02.js 2014-06-09 09:55:59 +0000 |
1022 | @@ -16,12 +16,6 @@ |
1023 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1024 | */ |
1025 | |
1026 | -function elementContainedInBox(element, box) { |
1027 | - var rect = element.getBoundingClientRect(); |
1028 | - return ((box.left <= rect.left) && (box.right >= rect.right) && |
1029 | - (box.top <= rect.top) && (box.bottom >= rect.bottom)); |
1030 | -} |
1031 | - |
1032 | function getImgFullUri(uri) { |
1033 | if ((uri.slice(0, 7) === 'http://') || |
1034 | (uri.slice(0, 8) === 'https://') || |
1035 | @@ -104,41 +98,6 @@ |
1036 | return data; |
1037 | } |
1038 | |
1039 | -function adjustSelection(selection) { |
1040 | - // FIXME: allow selecting two consecutive blocks, instead of |
1041 | - // interpolating to the containing block. |
1042 | - var centerX = (selection.left + selection.right) / 2; |
1043 | - var centerY = (selection.top + selection.bottom) / 2; |
1044 | - var element = document.elementFromPoint(centerX, centerY); |
1045 | - var parent = element; |
1046 | - while (elementContainedInBox(parent, selection)) { |
1047 | - parent = parent.parentNode; |
1048 | - } |
1049 | - element = parent; |
1050 | - return getSelectedData(element); |
1051 | -} |
1052 | - |
1053 | -function distance(touch1, touch2) { |
1054 | - return Math.sqrt(Math.pow(touch2.clientX - touch1.clientX, 2) + |
1055 | - Math.pow(touch2.clientY - touch1.clientY, 2)); |
1056 | -} |
1057 | - |
1058 | -/*navigator.qt.onmessage = function(message) { |
1059 | - var data = null; |
1060 | - try { |
1061 | - data = JSON.parse(message.data); |
1062 | - } catch (error) { |
1063 | - return; |
1064 | - } |
1065 | - if ('query' in data) { |
1066 | - if (data.query === 'adjustselection') { |
1067 | - var selection = adjustSelection(data); |
1068 | - selection.event = 'selectionadjusted'; |
1069 | - navigator.qt.postMessage(JSON.stringify(selection)); |
1070 | - } |
1071 | - } |
1072 | -}*/ |
1073 | - |
1074 | document.documentElement.addEventListener('contextmenu', function(event) { |
1075 | var element = document.elementFromPoint(event.clientX, event.clientY); |
1076 | var data = getSelectedData(element); |
1077 | |
1078 | === renamed file 'src/Ubuntu/Components/Extras/Browser/ua-override-worker.js' => 'src/Ubuntu/Web/ua-override-worker.js' |
1079 | === renamed file 'src/Ubuntu/Components/Extras/Browser/ua-overrides-desktop.js' => 'src/Ubuntu/Web/ua-overrides-desktop.js' |
1080 | === renamed file 'src/Ubuntu/Components/Extras/Browser/ua-overrides-mobile.js' => 'src/Ubuntu/Web/ua-overrides-mobile.js' |
1081 | === modified file 'src/app/WebViewImpl.qml' |
1082 | --- src/app/WebViewImpl.qml 2014-04-11 11:42:07 +0000 |
1083 | +++ src/app/WebViewImpl.qml 2014-06-09 09:55:59 +0000 |
1084 | @@ -18,11 +18,11 @@ |
1085 | |
1086 | import QtQuick 2.0 |
1087 | //import Ubuntu.Components 0.1 |
1088 | -import Ubuntu.Components.Extras.Browser 0.2 |
1089 | +import Ubuntu.Web 0.2 |
1090 | //import Ubuntu.Components.Popups 0.1 |
1091 | //import "actions" as Actions |
1092 | |
1093 | -UbuntuWebView { |
1094 | +WebView { |
1095 | id: webview |
1096 | |
1097 | property var currentWebview: webview |
1098 | |
1099 | === modified file 'src/app/webbrowser/TimelineView.qml' |
1100 | --- src/app/webbrowser/TimelineView.qml 2014-05-22 16:21:27 +0000 |
1101 | +++ src/app/webbrowser/TimelineView.qml 2014-06-09 09:55:59 +0000 |
1102 | @@ -18,7 +18,6 @@ |
1103 | |
1104 | import QtQuick 2.0 |
1105 | import Ubuntu.Components 0.1 |
1106 | -//import Ubuntu.Components.Extras.Browser 0.1 |
1107 | import Ubuntu.Components.ListItems 0.1 as ListItem |
1108 | import webbrowserapp.private 0.1 |
1109 | |
1110 | |
1111 | === modified file 'src/app/webcontainer/WebViewImplOxide.qml' |
1112 | --- src/app/webcontainer/WebViewImplOxide.qml 2014-05-06 17:21:19 +0000 |
1113 | +++ src/app/webcontainer/WebViewImplOxide.qml 2014-06-09 09:55:59 +0000 |
1114 | @@ -18,11 +18,11 @@ |
1115 | |
1116 | import QtQuick 2.0 |
1117 | import QtQuick.Window 2.0 |
1118 | -import com.canonical.Oxide 1.0 |
1119 | +import com.canonical.Oxide 1.0 as Oxide |
1120 | import Ubuntu.Components 0.1 |
1121 | -import Ubuntu.Components.Extras.Browser 0.2 |
1122 | +import Ubuntu.Components.Popups 0.1 |
1123 | import Ubuntu.UnityWebApps 0.1 as UnityWebApps |
1124 | -import Ubuntu.Components.Popups 0.1 |
1125 | +import Ubuntu.Web 0.2 |
1126 | import "../actions" as Actions |
1127 | import ".." |
1128 | |
1129 | @@ -66,8 +66,8 @@ |
1130 | } |
1131 | |
1132 | function isNewForegroundWebViewDisposition(disposition) { |
1133 | - return disposition === NavigationRequest.DispositionNewPopup || |
1134 | - disposition === NavigationRequest.DispositionNewForegroundTab; |
1135 | + return disposition === Oxide.NavigationRequest.DispositionNewPopup || |
1136 | + disposition === Oxide.NavigationRequest.DispositionNewForegroundTab; |
1137 | } |
1138 | |
1139 | function shouldAllowNavigationTo(url) { |
1140 | @@ -104,14 +104,14 @@ |
1141 | // See https://developer.mozilla.org/en-US/docs/Web/API/Window.open |
1142 | if (newForegroundPageRequest && url == 'about:blank') { |
1143 | console.log('Accepting a new window request to navigate to "about:blank"') |
1144 | - request.action = NavigationRequest.ActionAccept |
1145 | + request.action = Oxide.NavigationRequest.ActionAccept |
1146 | return; |
1147 | } |
1148 | |
1149 | if (newForegroundPageRequest && shouldOpenPopupsInDefaultBrowser()) { |
1150 | console.debug('Opening: popup window ' + url + ' in the browser window.') |
1151 | |
1152 | - request.action = NavigationRequest.ActionReject |
1153 | + request.action = Oxide.NavigationRequest.ActionReject |
1154 | Qt.openUrlExternally(url); |
1155 | return; |
1156 | } |
1157 | @@ -120,20 +120,20 @@ |
1158 | // or if we dont have a list of url patterns specified to filter the |
1159 | // browsing actions |
1160 | if ( ! webview.haveValidUrlPatterns() && ! webview.isRunningAsANamedWebapp()) { |
1161 | - request.action = NavigationRequest.ActionAccept |
1162 | + request.action = Oxide.NavigationRequest.ActionAccept |
1163 | return |
1164 | } |
1165 | |
1166 | - request.action = NavigationRequest.ActionReject |
1167 | + request.action = Oxide.NavigationRequest.ActionReject |
1168 | if (webview.shouldAllowNavigationTo(url)) |
1169 | - request.action = NavigationRequest.ActionAccept |
1170 | + request.action = Oxide.NavigationRequest.ActionAccept |
1171 | |
1172 | // SAML requests are used for instance by Google Apps for your domain; |
1173 | // they are implemented as a HTTP redirect to a URL containing the |
1174 | // query parameter called "SAMLRequest". |
1175 | // Besides letting the request through, we must also add the SAML |
1176 | // domain to the list of the allowed hosts. |
1177 | - if (request.disposition === NavigationRequest.DispositionCurrentTab && |
1178 | + if (request.disposition === Oxide.NavigationRequest.DispositionCurrentTab && |
1179 | url.indexOf("SAMLRequest") > 0) { |
1180 | var urlRegExp = new RegExp("https?://([^?/]+)") |
1181 | var match = urlRegExp.exec(url) |
1182 | @@ -142,10 +142,10 @@ |
1183 | var hostPattern = "https?://" + host.replace(escapeDotsRegExp, "\\.") + "/" |
1184 | console.log("SAML request detected. Adding host pattern: " + hostPattern) |
1185 | webappUrlPatterns.push(hostPattern) |
1186 | - request.action = NavigationRequest.ActionAccept |
1187 | + request.action = Oxide.NavigationRequest.ActionAccept |
1188 | } |
1189 | |
1190 | - if (request.action === NavigationRequest.ActionReject) { |
1191 | + if (request.action === Oxide.NavigationRequest.ActionReject) { |
1192 | console.debug('Opening: ' + url + ' in the browser window.') |
1193 | Qt.openUrlExternally(url) |
1194 | } |
1195 | @@ -160,7 +160,7 @@ |
1196 | Window { |
1197 | id: popup |
1198 | property alias request: popupBrowser.request |
1199 | - UbuntuWebView { |
1200 | + WebView { |
1201 | id: popupBrowser |
1202 | anchors.fill: parent |
1203 | |
1204 | @@ -170,7 +170,7 @@ |
1205 | // If we are to browse in the popup to a place where we are not allows |
1206 | if ( ! isNewForegroundWebViewDisposition(request.disposition) && |
1207 | ! webview.shouldAllowNavigationTo(url)) { |
1208 | - request.action = NavigationRequest.ActionReject |
1209 | + request.action = Oxide.NavigationRequest.ActionReject |
1210 | Qt.openUrlExternally(url); |
1211 | popup.close() |
1212 | return; |
1213 | |
1214 | === modified file 'tests/unittests/qml/tst_UbuntuWebView02.qml' |
1215 | --- tests/unittests/qml/tst_UbuntuWebView02.qml 2014-04-16 12:33:49 +0000 |
1216 | +++ tests/unittests/qml/tst_UbuntuWebView02.qml 2014-06-09 09:55:59 +0000 |
1217 | @@ -18,10 +18,10 @@ |
1218 | |
1219 | import QtQuick 2.0 |
1220 | import QtTest 1.0 |
1221 | -import Ubuntu.Components.Extras.Browser 0.2 |
1222 | +import Ubuntu.Web 0.2 |
1223 | |
1224 | TestCase { |
1225 | - name: "UbuntuWebView" |
1226 | + name: "WebView" |
1227 | |
1228 | function test_context_singleton() { |
1229 | compare(webview1.context, webview2.context) |
1230 | @@ -33,11 +33,11 @@ |
1231 | compare(webview2.context.userAgent, "custom UA") |
1232 | } |
1233 | |
1234 | - UbuntuWebView { |
1235 | + WebView { |
1236 | id: webview1 |
1237 | } |
1238 | |
1239 | - UbuntuWebView { |
1240 | + WebView { |
1241 | id: webview2 |
1242 | |
1243 | function getUAString(url) { |
1244 | |
1245 | === modified file 'webbrowser-app.qmlproject' |
1246 | --- webbrowser-app.qmlproject 2013-07-18 08:35:41 +0000 |
1247 | +++ webbrowser-app.qmlproject 2014-06-09 09:55:59 +0000 |
1248 | @@ -22,6 +22,11 @@ |
1249 | filter: "*.h;*.cpp;*.py" |
1250 | } |
1251 | |
1252 | + Files { |
1253 | + directory: "doc" |
1254 | + filter: "*.qdoc;*.qdocconf" |
1255 | + } |
1256 | + |
1257 | /* List of plugin directories passed to QML runtime */ |
1258 | importPaths: [ "src" ] |
1259 | } |
FAILED: Continuous integration, rev:560 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 839/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 526 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic- touch/134 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- amd64-ci/ 38 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 38 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 38/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- i386-ci/ 38 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 466 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/665 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/665/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1108 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1108/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/6766 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 7915
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 839/rebuild
http://