Merge lp:~mardy/webbrowser-app/per-account-dir into lp:webbrowser-app
- per-account-dir
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Alberto Mardegan |
Proposed branch: | lp:~mardy/webbrowser-app/per-account-dir |
Merge into: | lp:webbrowser-app |
Diff against target: |
555 lines (+140/-136) 12 files modified
src/app/WebViewImpl.qml (+5/-0) src/app/webcontainer/AccountsPage.qml (+5/-29) src/app/webcontainer/WebApp.qml (+1/-0) src/app/webcontainer/WebViewImplWebkit.qml (+1/-0) src/app/webcontainer/WebappContainerWebview.qml (+4/-1) src/app/webcontainer/chrome-cookie-store.cpp (+0/-13) src/app/webcontainer/chrome-cookie-store.h (+0/-7) src/app/webcontainer/cookie-store.cpp (+12/-20) src/app/webcontainer/online-accounts-cookie-store.cpp (+4/-5) src/app/webcontainer/oxide-cookie-helper.cpp (+5/-4) src/app/webcontainer/webapp-container.cpp (+2/-0) src/app/webcontainer/webapp-container.qml (+101/-57) |
To merge this branch: | bzr merge lp:~mardy/webbrowser-app/per-account-dir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Mardegan (community) | Needs Resubmitting | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+237428@code.launchpad.net |
Commit message
Use a different data location for different accounts
Move the webview behind a Loader, and set the dataPath according to the account number.
Description of the change
Use a different data location for different accounts
Move the webview behind a Loader, and set the dataPath according to the account number.
PS Jenkins bot (ps-jenkins) wrote : | # |
- 758. By Alberto Mardegan
-
Remove unused property
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:758
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 759. By Alberto Mardegan
-
Watch URL changes
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:759
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:759
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 760. By Alberto Mardegan
-
from trunk
[ Alberto Mardegan ]
Filter out account services which belong to other webapps - 761. By Alberto Mardegan
-
Use dataLocation
Apparmor rules prevent oxide from using ~/.cache/
- 762. By Alberto Mardegan
-
Check dates at a later stage
- 763. By Alberto Mardegan
-
Fix timestamp conversion
- 764. By Alberto Mardegan
-
Remove error msg
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:760
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:764
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:764
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Alberto Mardegan (mardy) wrote : | # |
This is superseded by https:/
Unmerged revisions
Preview Diff
1 | === modified file 'src/app/WebViewImpl.qml' | |||
2 | --- src/app/WebViewImpl.qml 2014-09-15 14:53:14 +0000 | |||
3 | +++ src/app/WebViewImpl.qml 2014-10-08 14:35:55 +0000 | |||
4 | @@ -29,6 +29,7 @@ | |||
5 | 29 | property var certificateError | 29 | property var certificateError |
6 | 30 | // Invalid certificates the user has explicitly allowed for this session | 30 | // Invalid certificates the user has explicitly allowed for this session |
7 | 31 | property var allowedCertificates: [] | 31 | property var allowedCertificates: [] |
8 | 32 | property url dataPath | ||
9 | 32 | 33 | ||
10 | 33 | /*experimental.certificateVerificationDialog: CertificateVerificationDialog {} | 34 | /*experimental.certificateVerificationDialog: CertificateVerificationDialog {} |
11 | 34 | experimental.authenticationDialog: AuthenticationDialog {} | 35 | experimental.authenticationDialog: AuthenticationDialog {} |
12 | @@ -39,6 +40,10 @@ | |||
13 | 39 | beforeUnloadDialog: BeforeUnloadDialog {} | 40 | beforeUnloadDialog: BeforeUnloadDialog {} |
14 | 40 | filePicker: filePickerLoader.item | 41 | filePicker: filePickerLoader.item |
15 | 41 | 42 | ||
16 | 43 | context: WebContext { | ||
17 | 44 | dataPath: webview.dataPath | ||
18 | 45 | } | ||
19 | 46 | |||
20 | 42 | onDownloadRequested: { | 47 | onDownloadRequested: { |
21 | 43 | if (downloadLoader.status == Loader.Ready) { | 48 | if (downloadLoader.status == Loader.Ready) { |
22 | 44 | var headers = { } | 49 | var headers = { } |
23 | 45 | 50 | ||
24 | === modified file 'src/app/webcontainer/AccountsPage.qml' | |||
25 | --- src/app/webcontainer/AccountsPage.qml 2014-08-21 15:15:21 +0000 | |||
26 | +++ src/app/webcontainer/AccountsPage.qml 2014-10-08 14:35:55 +0000 | |||
27 | @@ -25,12 +25,10 @@ | |||
28 | 25 | 25 | ||
29 | 26 | property alias accountProvider: accountsLogin.accountProvider | 26 | property alias accountProvider: accountsLogin.accountProvider |
30 | 27 | property alias applicationName: accountsLogin.applicationName | 27 | property alias applicationName: accountsLogin.applicationName |
37 | 28 | property var webappCookieStore: null | 28 | |
38 | 29 | property var onlineAccountStoreComponent: null | 29 | signal done(bool successful, var credentialsId) |
39 | 30 | 30 | ||
40 | 31 | signal done() | 31 | visible: true |
35 | 32 | |||
36 | 33 | visible: false | ||
41 | 34 | anchors.fill: parent | 32 | anchors.fill: parent |
42 | 35 | 33 | ||
43 | 36 | AccountsLoginPage { | 34 | AccountsLoginPage { |
44 | @@ -38,32 +36,10 @@ | |||
45 | 38 | 36 | ||
46 | 39 | anchors.fill: parent | 37 | anchors.fill: parent |
47 | 40 | 38 | ||
48 | 41 | QtObject { | ||
49 | 42 | id: internal | ||
50 | 43 | function onMoved(result) { | ||
51 | 44 | webappCookieStore.moved.disconnect(internal.onMoved) | ||
52 | 45 | if (!result) { | ||
53 | 46 | console.error("Unable to move cookies") | ||
54 | 47 | } | ||
55 | 48 | accountsPage.done() | ||
56 | 49 | } | ||
57 | 50 | } | ||
58 | 51 | |||
59 | 52 | onDone: { | 39 | onDone: { |
60 | 53 | if (!accountsPage.visible) | 40 | if (!accountsPage.visible) |
61 | 54 | return | 41 | return |
74 | 55 | if (!credentialsId) { | 42 | accountsPage.done(credentialsId != null, credentialsId) |
63 | 56 | accountsPage.done() | ||
64 | 57 | return | ||
65 | 58 | } | ||
66 | 59 | |||
67 | 60 | if (webappCookieStore) { | ||
68 | 61 | var instance = onlineAccountStoreComponent.createObject(accountsLogin, { "accountId": credentialsId }) | ||
69 | 62 | webappCookieStore.moved.connect(internal.onMoved) | ||
70 | 63 | webappCookieStore.moveFrom(instance) | ||
71 | 64 | } else { | ||
72 | 65 | accountsPage.done() | ||
73 | 66 | } | ||
75 | 67 | } | 43 | } |
76 | 68 | } | 44 | } |
77 | 69 | } | 45 | } |
78 | 70 | 46 | ||
79 | === modified file 'src/app/webcontainer/WebApp.qml' | |||
80 | --- src/app/webcontainer/WebApp.qml 2014-10-03 14:41:14 +0000 | |||
81 | +++ src/app/webcontainer/WebApp.qml 2014-10-08 14:35:55 +0000 | |||
82 | @@ -38,6 +38,7 @@ | |||
83 | 38 | property alias webappUrlPatterns: webview.webappUrlPatterns | 38 | property alias webappUrlPatterns: webview.webappUrlPatterns |
84 | 39 | property alias popupRedirectionUrlPrefix: webview.popupRedirectionUrlPrefix | 39 | property alias popupRedirectionUrlPrefix: webview.popupRedirectionUrlPrefix |
85 | 40 | property alias webviewOverrideFile: webview.webviewOverrideFile | 40 | property alias webviewOverrideFile: webview.webviewOverrideFile |
86 | 41 | property alias dataPath: webview.dataPath | ||
87 | 41 | property string localUserAgentOverride: "" | 42 | property string localUserAgentOverride: "" |
88 | 42 | 43 | ||
89 | 43 | property bool backForwardButtonsVisible: false | 44 | property bool backForwardButtonsVisible: false |
90 | 44 | 45 | ||
91 | === modified file 'src/app/webcontainer/WebViewImplWebkit.qml' | |||
92 | --- src/app/webcontainer/WebViewImplWebkit.qml 2014-07-29 21:51:07 +0000 | |||
93 | +++ src/app/webcontainer/WebViewImplWebkit.qml 2014-10-08 14:35:55 +0000 | |||
94 | @@ -35,6 +35,7 @@ | |||
95 | 35 | property var webappUrlPatterns: null | 35 | property var webappUrlPatterns: null |
96 | 36 | property string localUserAgentOverride: "" | 36 | property string localUserAgentOverride: "" |
97 | 37 | property string popupRedirectionUrlPrefix: "" | 37 | property string popupRedirectionUrlPrefix: "" |
98 | 38 | property url dataPath // unused | ||
99 | 38 | 39 | ||
100 | 39 | function getUAString() { | 40 | function getUAString() { |
101 | 40 | return webview.localUserAgentOverride.length === 0 ? undefined : webview.localUserAgentOverride | 41 | return webview.localUserAgentOverride.length === 0 ? undefined : webview.localUserAgentOverride |
102 | 41 | 42 | ||
103 | === modified file 'src/app/webcontainer/WebappContainerWebview.qml' | |||
104 | --- src/app/webcontainer/WebappContainerWebview.qml 2014-09-02 06:29:12 +0000 | |||
105 | +++ src/app/webcontainer/WebappContainerWebview.qml 2014-10-08 14:35:55 +0000 | |||
106 | @@ -30,6 +30,7 @@ | |||
107 | 30 | property bool withOxide: false | 30 | property bool withOxide: false |
108 | 31 | property bool developerExtrasEnabled: false | 31 | property bool developerExtrasEnabled: false |
109 | 32 | property string webappName: "" | 32 | property string webappName: "" |
110 | 33 | property url dataPath | ||
111 | 33 | property var currentWebview: webappContainerWebViewLoader.item | 34 | property var currentWebview: webappContainerWebViewLoader.item |
112 | 34 | property var webappUrlPatterns | 35 | property var webappUrlPatterns |
113 | 35 | property string localUserAgentOverride: "" | 36 | property string localUserAgentOverride: "" |
114 | @@ -39,9 +40,10 @@ | |||
115 | 39 | Loader { | 40 | Loader { |
116 | 40 | id: webappContainerWebViewLoader | 41 | id: webappContainerWebViewLoader |
117 | 41 | anchors.fill: parent | 42 | anchors.fill: parent |
118 | 42 | asynchronous: true | ||
119 | 43 | } | 43 | } |
120 | 44 | 44 | ||
121 | 45 | onUrlChanged: if (webappContainerWebViewLoader.item) webappContainerWebViewLoader.item.url = url | ||
122 | 46 | |||
123 | 45 | Component.onCompleted: { | 47 | Component.onCompleted: { |
124 | 46 | var webappEngineSource = | 48 | var webappEngineSource = |
125 | 47 | withOxide ? | 49 | withOxide ? |
126 | @@ -60,6 +62,7 @@ | |||
127 | 60 | { localUserAgentOverride: containerWebview.localUserAgentOverride | 62 | { localUserAgentOverride: containerWebview.localUserAgentOverride |
128 | 61 | , url: containerWebview.url | 63 | , url: containerWebview.url |
129 | 62 | , webappName: containerWebview.webappName | 64 | , webappName: containerWebview.webappName |
130 | 65 | , dataPath: dataPath | ||
131 | 63 | , webappUrlPatterns: containerWebview.webappUrlPatterns | 66 | , webappUrlPatterns: containerWebview.webappUrlPatterns |
132 | 64 | , developerExtrasEnabled: containerWebview.developerExtrasEnabled | 67 | , developerExtrasEnabled: containerWebview.developerExtrasEnabled |
133 | 65 | , popupRedirectionUrlPrefix: containerWebview.popupRedirectionUrlPrefix}) | 68 | , popupRedirectionUrlPrefix: containerWebview.popupRedirectionUrlPrefix}) |
134 | 66 | 69 | ||
135 | === modified file 'src/app/webcontainer/chrome-cookie-store.cpp' | |||
136 | --- src/app/webcontainer/chrome-cookie-store.cpp 2014-09-18 13:37:07 +0000 | |||
137 | +++ src/app/webcontainer/chrome-cookie-store.cpp 2014-10-08 14:35:55 +0000 | |||
138 | @@ -33,19 +33,6 @@ | |||
139 | 33 | this, SLOT(oxideCookiesUpdated(const QList<QNetworkCookie>&))); | 33 | this, SLOT(oxideCookiesUpdated(const QList<QNetworkCookie>&))); |
140 | 34 | } | 34 | } |
141 | 35 | 35 | ||
142 | 36 | void ChromeCookieStore::setHomepage(const QUrl& homepage) { | ||
143 | 37 | if (homepage == m_homepage) | ||
144 | 38 | return; | ||
145 | 39 | |||
146 | 40 | m_homepage = homepage; | ||
147 | 41 | |||
148 | 42 | emit homepageChanged(); | ||
149 | 43 | } | ||
150 | 44 | |||
151 | 45 | QUrl ChromeCookieStore::homepage() const { | ||
152 | 46 | return m_homepage; | ||
153 | 47 | } | ||
154 | 48 | |||
155 | 49 | void ChromeCookieStore::setOxideStoreBackend(QObject* backend) | 36 | void ChromeCookieStore::setOxideStoreBackend(QObject* backend) |
156 | 50 | { | 37 | { |
157 | 51 | m_cookieHelper->setOxideStoreBackend(backend); | 38 | m_cookieHelper->setOxideStoreBackend(backend); |
158 | 52 | 39 | ||
159 | === modified file 'src/app/webcontainer/chrome-cookie-store.h' | |||
160 | --- src/app/webcontainer/chrome-cookie-store.h 2014-09-18 13:37:07 +0000 | |||
161 | +++ src/app/webcontainer/chrome-cookie-store.h 2014-10-08 14:35:55 +0000 | |||
162 | @@ -30,7 +30,6 @@ | |||
163 | 30 | { | 30 | { |
164 | 31 | Q_OBJECT | 31 | Q_OBJECT |
165 | 32 | 32 | ||
166 | 33 | Q_PROPERTY(QUrl homepage READ homepage WRITE setHomepage NOTIFY homepageChanged) | ||
167 | 34 | Q_PROPERTY(QString dbPath READ dbPath WRITE setDbPath NOTIFY dbPathChanged) | 33 | Q_PROPERTY(QString dbPath READ dbPath WRITE setDbPath NOTIFY dbPathChanged) |
168 | 35 | Q_PROPERTY(QObject* oxideStoreBackend READ oxideStoreBackend WRITE setOxideStoreBackend NOTIFY oxideStoreBackendChanged) | 34 | Q_PROPERTY(QObject* oxideStoreBackend READ oxideStoreBackend WRITE setOxideStoreBackend NOTIFY oxideStoreBackendChanged) |
169 | 36 | 35 | ||
170 | @@ -41,10 +40,6 @@ | |||
171 | 41 | void setDbPath(const QString& path); | 40 | void setDbPath(const QString& path); |
172 | 42 | QString dbPath() const; | 41 | QString dbPath() const; |
173 | 43 | 42 | ||
174 | 44 | // dbpaths | ||
175 | 45 | void setHomepage(const QUrl& path); | ||
176 | 46 | QUrl homepage() const; | ||
177 | 47 | |||
178 | 48 | // oxideStoreBackend | 43 | // oxideStoreBackend |
179 | 49 | void setOxideStoreBackend(QObject* backend); | 44 | void setOxideStoreBackend(QObject* backend); |
180 | 50 | QObject* oxideStoreBackend() const; | 45 | QObject* oxideStoreBackend() const; |
181 | @@ -55,7 +50,6 @@ | |||
182 | 55 | Q_SIGNALS: | 50 | Q_SIGNALS: |
183 | 56 | void dbPathChanged(); | 51 | void dbPathChanged(); |
184 | 57 | void oxideStoreBackendChanged(); | 52 | void oxideStoreBackendChanged(); |
185 | 58 | void homepageChanged(); | ||
186 | 59 | 53 | ||
187 | 60 | private Q_SLOTS: | 54 | private Q_SLOTS: |
188 | 61 | void oxideCookiesReceived(int requestId, const QVariant& cookies); | 55 | void oxideCookiesReceived(int requestId, const QVariant& cookies); |
189 | @@ -67,7 +61,6 @@ | |||
190 | 67 | 61 | ||
191 | 68 | private: | 62 | private: |
192 | 69 | OxideCookieHelper* m_cookieHelper; | 63 | OxideCookieHelper* m_cookieHelper; |
193 | 70 | QUrl m_homepage; | ||
194 | 71 | QString m_dbPath; | 64 | QString m_dbPath; |
195 | 72 | }; | 65 | }; |
196 | 73 | 66 | ||
197 | 74 | 67 | ||
198 | === modified file 'src/app/webcontainer/cookie-store.cpp' | |||
199 | --- src/app/webcontainer/cookie-store.cpp 2014-08-26 09:49:32 +0000 | |||
200 | +++ src/app/webcontainer/cookie-store.cpp 2014-10-08 14:35:55 +0000 | |||
201 | @@ -91,8 +91,20 @@ | |||
202 | 91 | if (Q_UNLIKELY(!request)) | 91 | if (Q_UNLIKELY(!request)) |
203 | 92 | return; | 92 | return; |
204 | 93 | 93 | ||
205 | 94 | QDateTime lastRemoteCookieUpdate = | ||
206 | 95 | request->_cookieStore->lastUpdateTimeStamp(); | ||
207 | 96 | QDateTime lastLocalCookieUpdate = lastUpdateTimeStamp(); | ||
208 | 97 | |||
209 | 94 | delete request; | 98 | delete request; |
210 | 95 | 99 | ||
211 | 100 | if (lastRemoteCookieUpdate.isValid() && | ||
212 | 101 | lastLocalCookieUpdate.isValid() && | ||
213 | 102 | (lastRemoteCookieUpdate < lastLocalCookieUpdate)) | ||
214 | 103 | { | ||
215 | 104 | Q_EMIT moved(false); | ||
216 | 105 | return; | ||
217 | 106 | } | ||
218 | 107 | |||
219 | 96 | connect(this, &CookieStore::cookiesSet, | 108 | connect(this, &CookieStore::cookiesSet, |
220 | 97 | this, &CookieStore::moved); | 109 | this, &CookieStore::moved); |
221 | 98 | 110 | ||
222 | @@ -104,26 +116,6 @@ | |||
223 | 104 | if (Q_UNLIKELY(!store)) | 116 | if (Q_UNLIKELY(!store)) |
224 | 105 | return; | 117 | return; |
225 | 106 | 118 | ||
226 | 107 | QDateTime lastRemoteCookieUpdate = store->lastUpdateTimeStamp(); | ||
227 | 108 | QDateTime lastLocalCookieUpdate = lastUpdateTimeStamp(); | ||
228 | 109 | |||
229 | 110 | // Disabled for now since. | ||
230 | 111 | // There is an obvious race if the WebView is instanciated | ||
231 | 112 | // (since it creates a cookies db file at creation time). | ||
232 | 113 | // But when delaying the creation, only using the WebContext to | ||
233 | 114 | // access the cookieManager, and manually creating a cookies db file | ||
234 | 115 | // if none is found (since the cookie manager does not create one | ||
235 | 116 | // when setting its cookies), something fails. | ||
236 | 117 | #if 0 | ||
237 | 118 | if (lastRemoteCookieUpdate.isValid() && | ||
238 | 119 | lastLocalCookieUpdate.isValid() && | ||
239 | 120 | (lastRemoteCookieUpdate < lastLocalCookieUpdate)) | ||
240 | 121 | { | ||
241 | 122 | Q_EMIT moved(false); | ||
242 | 123 | return; | ||
243 | 124 | } | ||
244 | 125 | #endif | ||
245 | 126 | |||
246 | 127 | CookieStoreRequest* storeRequest = new CookieStoreRequest(store); | 119 | CookieStoreRequest* storeRequest = new CookieStoreRequest(store); |
247 | 128 | _currentStoreRequests.insert(storeRequest, true); | 120 | _currentStoreRequests.insert(storeRequest, true); |
248 | 129 | 121 | ||
249 | 130 | 122 | ||
250 | === modified file 'src/app/webcontainer/online-accounts-cookie-store.cpp' | |||
251 | --- src/app/webcontainer/online-accounts-cookie-store.cpp 2014-08-05 00:25:20 +0000 | |||
252 | +++ src/app/webcontainer/online-accounts-cookie-store.cpp 2014-10-08 14:35:55 +0000 | |||
253 | @@ -116,15 +116,14 @@ | |||
254 | 116 | 116 | ||
255 | 117 | if (arguments.count() > 1) | 117 | if (arguments.count() > 1) |
256 | 118 | { | 118 | { |
260 | 119 | QDateTime t; | 119 | qint64 timeStamp = arguments.at(1).toLongLong(); |
261 | 120 | QVariant timeStampVariant(arguments.at(1)); | 120 | if (timeStamp != 0) |
259 | 121 | if (timeStampVariant.canConvert(QMetaType::LongLong)) | ||
262 | 122 | { | 121 | { |
263 | 123 | qDebug() << "Got a cookie timestamp of" | 122 | qDebug() << "Got a cookie timestamp of" |
265 | 124 | << arguments.at(1).toLongLong() | 123 | << timeStamp |
266 | 125 | << "from Online Accounts DBUS cookiesForIdentity() call."; | 124 | << "from Online Accounts DBUS cookiesForIdentity() call."; |
267 | 126 | 125 | ||
269 | 127 | t.fromMSecsSinceEpoch(arguments.at(1).toLongLong() * 1000); | 126 | QDateTime t = QDateTime::fromMSecsSinceEpoch(timeStamp * 1000); |
270 | 128 | updateLastUpdateTimestamp(t); | 127 | updateLastUpdateTimestamp(t); |
271 | 129 | } | 128 | } |
272 | 130 | } | 129 | } |
273 | 131 | 130 | ||
274 | === modified file 'src/app/webcontainer/oxide-cookie-helper.cpp' | |||
275 | --- src/app/webcontainer/oxide-cookie-helper.cpp 2014-10-03 11:47:36 +0000 | |||
276 | +++ src/app/webcontainer/oxide-cookie-helper.cpp 2014-10-08 14:35:55 +0000 | |||
277 | @@ -53,6 +53,7 @@ | |||
278 | 53 | m_backend(0), | 53 | m_backend(0), |
279 | 54 | q_ptr(q) | 54 | q_ptr(q) |
280 | 55 | { | 55 | { |
281 | 56 | qRegisterMetaType<QList<QNetworkCookie> >(); | ||
282 | 56 | } | 57 | } |
283 | 57 | 58 | ||
284 | 58 | void OxideCookieHelperPrivate::setCookies(const QList<QNetworkCookie>& cookies) | 59 | void OxideCookieHelperPrivate::setCookies(const QList<QNetworkCookie>& cookies) |
285 | @@ -75,7 +76,7 @@ | |||
286 | 75 | /* We don't simply use Q_EMIT because we want the signal to be emitted | 76 | /* We don't simply use Q_EMIT because we want the signal to be emitted |
287 | 76 | * asynchronously */ | 77 | * asynchronously */ |
288 | 77 | QMetaObject::invokeMethod(q, "cookiesSet", Qt::QueuedConnection, | 78 | QMetaObject::invokeMethod(q, "cookiesSet", Qt::QueuedConnection, |
290 | 78 | Q_ARG(const QList<QNetworkCookie>&, cookies)); | 79 | Q_ARG(QList<QNetworkCookie>, cookies)); |
291 | 79 | return; | 80 | return; |
292 | 80 | } | 81 | } |
293 | 81 | 82 | ||
294 | @@ -119,8 +120,8 @@ | |||
295 | 119 | QMetaObject::invokeMethod(m_backend, "setNetworkCookies", | 120 | QMetaObject::invokeMethod(m_backend, "setNetworkCookies", |
296 | 120 | Qt::DirectConnection, | 121 | Qt::DirectConnection, |
297 | 121 | Q_RETURN_ARG(int, requestId), | 122 | Q_RETURN_ARG(int, requestId), |
300 | 122 | Q_ARG(const QUrl&, url), | 123 | Q_ARG(QUrl, url), |
301 | 123 | Q_ARG(const QList<QNetworkCookie>&, it.value())); | 124 | Q_ARG(QList<QNetworkCookie>, it.value())); |
302 | 124 | if (Q_UNLIKELY(requestId == -1)) { | 125 | if (Q_UNLIKELY(requestId == -1)) { |
303 | 125 | m_failedCookies.append(cookiesWithDomain(it.value(), url.host())); | 126 | m_failedCookies.append(cookiesWithDomain(it.value(), url.host())); |
304 | 126 | } else { | 127 | } else { |
305 | @@ -133,7 +134,7 @@ | |||
306 | 133 | /* We don't simply use Q_EMIT because we want the signal to be emitted | 134 | /* We don't simply use Q_EMIT because we want the signal to be emitted |
307 | 134 | * asynchronously */ | 135 | * asynchronously */ |
308 | 135 | QMetaObject::invokeMethod(q, "cookiesSet", Qt::QueuedConnection, | 136 | QMetaObject::invokeMethod(q, "cookiesSet", Qt::QueuedConnection, |
310 | 136 | Q_ARG(const QList<QNetworkCookie>&, m_failedCookies)); | 137 | Q_ARG(QList<QNetworkCookie>, m_failedCookies)); |
311 | 137 | } | 138 | } |
312 | 138 | } | 139 | } |
313 | 139 | 140 | ||
314 | 140 | 141 | ||
315 | === modified file 'src/app/webcontainer/webapp-container.cpp' | |||
316 | --- src/app/webcontainer/webapp-container.cpp 2014-10-03 14:41:14 +0000 | |||
317 | +++ src/app/webcontainer/webapp-container.cpp 2014-10-08 14:35:55 +0000 | |||
318 | @@ -157,6 +157,8 @@ | |||
319 | 157 | } | 157 | } |
320 | 158 | 158 | ||
321 | 159 | context->setContextProperty("webappContainerHelper", m_webappContainerHelper.data()); | 159 | context->setContextProperty("webappContainerHelper", m_webappContainerHelper.data()); |
322 | 160 | context->setContextProperty("cacheLocation", | ||
323 | 161 | QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); | ||
324 | 160 | 162 | ||
325 | 161 | if ( ! m_popupRedirectionUrlPrefix.isEmpty()) { | 163 | if ( ! m_popupRedirectionUrlPrefix.isEmpty()) { |
326 | 162 | m_window->setProperty("popupRedirectionUrlPrefix", m_popupRedirectionUrlPrefix); | 164 | m_window->setProperty("popupRedirectionUrlPrefix", m_popupRedirectionUrlPrefix); |
327 | 163 | 165 | ||
328 | === modified file 'src/app/webcontainer/webapp-container.qml' | |||
329 | --- src/app/webcontainer/webapp-container.qml 2014-10-03 14:41:14 +0000 | |||
330 | +++ src/app/webcontainer/webapp-container.qml 2014-10-08 14:35:55 +0000 | |||
331 | @@ -53,54 +53,52 @@ | |||
332 | 53 | title: getWindowTitle() | 53 | title: getWindowTitle() |
333 | 54 | 54 | ||
334 | 55 | function getWindowTitle() { | 55 | function getWindowTitle() { |
335 | 56 | var webappViewTitle = webappViewLoader.item ? webappViewLoader.item.title : "" | ||
336 | 56 | if (typeof(webappName) === 'string' && webappName.length !== 0) { | 57 | if (typeof(webappName) === 'string' && webappName.length !== 0) { |
337 | 57 | return webappName | 58 | return webappName |
339 | 58 | } else if (browser.title) { | 59 | } else if (webappViewTitle) { |
340 | 59 | // TRANSLATORS: %1 refers to the current page’s title | 60 | // TRANSLATORS: %1 refers to the current page’s title |
342 | 60 | return i18n.tr("%1 - Ubuntu Web Browser").arg(browser.title) | 61 | return i18n.tr("%1 - Ubuntu Web Browser").arg(webappViewTitle) |
343 | 61 | } else { | 62 | } else { |
344 | 62 | return i18n.tr("Ubuntu Web Browser") | 63 | return i18n.tr("Ubuntu Web Browser") |
345 | 63 | } | 64 | } |
346 | 64 | } | 65 | } |
347 | 65 | 66 | ||
377 | 66 | WebApp { | 67 | Component { |
378 | 67 | id: browser | 68 | id: webappViewComponent |
379 | 68 | 69 | ||
380 | 69 | // Initially set as non visible to leave a chance | 70 | WebApp { |
381 | 70 | // for the OA dialog to appear | 71 | id: browser |
382 | 71 | visible: false | 72 | |
383 | 72 | 73 | url: accountProvider.length !== 0 ? "" : root.url | |
384 | 73 | url: accountProvider.length === 0 ? root.url : "" | 74 | |
385 | 74 | 75 | dataPath: webappDataLocation | |
386 | 75 | chromeVisible: root.chromeVisible | 76 | webappName: root.webappName |
387 | 76 | backForwardButtonsVisible: root.backForwardButtonsVisible | 77 | chromeVisible: root.chromeVisible |
388 | 77 | developerExtrasEnabled: root.developerExtrasEnabled | 78 | backForwardButtonsVisible: root.backForwardButtonsVisible |
389 | 78 | oxide: root.oxide | 79 | developerExtrasEnabled: root.developerExtrasEnabled |
390 | 79 | webappModelSearchPath: root.webappModelSearchPath | 80 | oxide: root.oxide |
391 | 80 | webappUrlPatterns: root.webappUrlPatterns | 81 | webappModelSearchPath: root.webappModelSearchPath |
392 | 81 | 82 | webappUrlPatterns: root.webappUrlPatterns | |
393 | 82 | localUserAgentOverride: root.localUserAgentOverride | 83 | |
394 | 83 | 84 | localUserAgentOverride: root.localUserAgentOverride | |
395 | 84 | popupRedirectionUrlPrefix: root.popupRedirectionUrlPrefix | 85 | |
396 | 85 | webviewOverrideFile: root.webviewOverrideFile | 86 | popupRedirectionUrlPrefix: root.popupRedirectionUrlPrefix |
397 | 86 | 87 | webviewOverrideFile: root.webviewOverrideFile | |
398 | 87 | anchors.fill: parent | 88 | |
399 | 88 | 89 | anchors.fill: parent | |
400 | 89 | webbrowserWindow: webbrowserWindowProxy | 90 | |
401 | 90 | 91 | webbrowserWindow: webbrowserWindowProxy | |
402 | 91 | onWebappNameChanged: { | 92 | |
403 | 92 | if (root.webappName !== browser.webappName) { | 93 | onWebappNameChanged: { |
404 | 93 | root.webappName = browser.webappName; | 94 | if (root.webappName !== browser.webappName) { |
405 | 94 | root.title = getWindowTitle(); | 95 | root.webappName = browser.webappName; |
406 | 96 | root.title = getWindowTitle(); | ||
407 | 97 | } | ||
408 | 95 | } | 98 | } |
417 | 96 | } | 99 | |
418 | 97 | 100 | Component.onCompleted: i18n.domain = "webbrowser-app" | |
419 | 98 | onCurrentWebviewChanged: { | 101 | } |
412 | 99 | if (currentWebview) | ||
413 | 100 | root.updateCurrentView() | ||
414 | 101 | } | ||
415 | 102 | |||
416 | 103 | Component.onCompleted: i18n.domain = "webbrowser-app" | ||
420 | 104 | } | 102 | } |
421 | 105 | 103 | ||
422 | 106 | UnityWebApps.UnityWebappsAppModel { | 104 | UnityWebApps.UnityWebappsAppModel { |
423 | @@ -117,7 +115,9 @@ | |||
424 | 117 | 115 | ||
425 | 118 | // XXX: work around https://bugs.launchpad.net/unity8/+bug/1328839 | 116 | // XXX: work around https://bugs.launchpad.net/unity8/+bug/1328839 |
426 | 119 | // by toggling fullscreen on the window only on desktop. | 117 | // by toggling fullscreen on the window only on desktop. |
428 | 120 | visibility: browser.currentWebview && browser.currentWebview.fullscreen && | 118 | visibility: webappViewLoader.item && |
429 | 119 | webappViewLoader.item.currentWebview && | ||
430 | 120 | webappViewLoader.item.currentWebview.fullscreen && | ||
431 | 121 | (formFactor === "desktop") ? Window.FullScreen : Window.AutomaticVisibility | 121 | (formFactor === "desktop") ? Window.FullScreen : Window.AutomaticVisibility |
432 | 122 | 122 | ||
433 | 123 | Loader { | 123 | Loader { |
434 | @@ -134,17 +134,62 @@ | |||
435 | 134 | } | 134 | } |
436 | 135 | } | 135 | } |
437 | 136 | 136 | ||
438 | 137 | Loader { | ||
439 | 138 | id: webappViewLoader | ||
440 | 139 | anchors.fill: parent | ||
441 | 140 | |||
442 | 141 | property var credentialsId: null | ||
443 | 142 | property var webappDataLocation: credentialsId != null ? dataLocation + "/id-" + credentialsId : dataLocation | ||
444 | 143 | } | ||
445 | 144 | |||
446 | 145 | function onCookiesMoved(result) { | ||
447 | 146 | if (__webappCookieStore) { | ||
448 | 147 | __webappCookieStore.moved.disconnect(onCookiesMoved) | ||
449 | 148 | } | ||
450 | 149 | if (!result) { | ||
451 | 150 | console.log("Cookies were not moved") | ||
452 | 151 | } | ||
453 | 152 | webappViewLoader.item.url = root.url | ||
454 | 153 | } | ||
455 | 154 | |||
456 | 155 | function moveCookies(credentialsId) { | ||
457 | 156 | if (!__webappCookieStore) { | ||
458 | 157 | var context = webappViewLoader.item.currentWebview.context | ||
459 | 158 | __webappCookieStore = oxideCookieStoreComponent.createObject(this, { | ||
460 | 159 | "oxideStoreBackend": context.cookieManager, | ||
461 | 160 | "dbPath": context.dataPath + "/cookies.sqlite" | ||
462 | 161 | }) | ||
463 | 162 | } | ||
464 | 163 | |||
465 | 164 | var storeComponent = localCookieStoreDbPath.length !== 0 ? | ||
466 | 165 | localCookieStoreComponent : onlineAccountStoreComponent | ||
467 | 166 | |||
468 | 167 | var instance = storeComponent.createObject(root, { "accountId": credentialsId }) | ||
469 | 168 | __webappCookieStore.moved.connect(onCookiesMoved) | ||
470 | 169 | __webappCookieStore.moveFrom(instance) | ||
471 | 170 | } | ||
472 | 171 | |||
473 | 137 | Connections { | 172 | Connections { |
474 | 138 | target: accountsPageComponentLoader.item | 173 | target: accountsPageComponentLoader.item |
476 | 139 | onDone: loadWebAppView() | 174 | onDone: { |
477 | 175 | if (successful && credentialsId) { | ||
478 | 176 | webappViewLoader.loaded.connect(function () { | ||
479 | 177 | if (webappViewLoader.status == Loader.Ready) { | ||
480 | 178 | moveCookies(webappViewLoader.credentialsId) | ||
481 | 179 | } | ||
482 | 180 | }); | ||
483 | 181 | webappViewLoader.credentialsId = credentialsId | ||
484 | 182 | webappViewLoader.sourceComponent = webappViewComponent | ||
485 | 183 | } | ||
486 | 184 | else { | ||
487 | 185 | loadWebAppView() | ||
488 | 186 | } | ||
489 | 187 | } | ||
490 | 140 | } | 188 | } |
491 | 141 | 189 | ||
492 | 142 | Component { | 190 | Component { |
493 | 143 | id: oxideCookieStoreComponent | 191 | id: oxideCookieStoreComponent |
494 | 144 | ChromeCookieStore { | 192 | ChromeCookieStore { |
495 | 145 | dbPath: dataLocation + "/cookies.sqlite" | ||
496 | 146 | homepage: root.url | ||
497 | 147 | oxideStoreBackend: browser.currentWebview ? browser.currentWebview.context.cookieManager : null | ||
498 | 148 | } | 193 | } |
499 | 149 | } | 194 | } |
500 | 150 | 195 | ||
501 | @@ -155,6 +200,10 @@ | |||
502 | 155 | } | 200 | } |
503 | 156 | } | 201 | } |
504 | 157 | 202 | ||
505 | 203 | Component.onCompleted: { | ||
506 | 204 | updateCurrentView() | ||
507 | 205 | } | ||
508 | 206 | |||
509 | 158 | Component { | 207 | Component { |
510 | 159 | id: onlineAccountStoreComponent | 208 | id: onlineAccountStoreComponent |
511 | 160 | OnlineAccountsCookieStore { } | 209 | OnlineAccountsCookieStore { } |
512 | @@ -163,7 +212,7 @@ | |||
513 | 163 | function updateCurrentView() { | 212 | function updateCurrentView() { |
514 | 164 | // check if we are to display the login view | 213 | // check if we are to display the login view |
515 | 165 | // or directly switch to the webapp view | 214 | // or directly switch to the webapp view |
517 | 166 | if (accountProvider.length !== 0 && !__webappCookieStore && oxide) { | 215 | if (accountProvider.length !== 0 && oxide) { |
518 | 167 | loadLoginView(); | 216 | loadLoginView(); |
519 | 168 | } else { | 217 | } else { |
520 | 169 | loadWebAppView(); | 218 | loadWebAppView(); |
521 | @@ -171,27 +220,22 @@ | |||
522 | 171 | } | 220 | } |
523 | 172 | 221 | ||
524 | 173 | function loadLoginView() { | 222 | function loadLoginView() { |
525 | 174 | if (!__webappCookieStore) { | ||
526 | 175 | __webappCookieStore = oxideCookieStoreComponent.createObject(this) | ||
527 | 176 | } | ||
528 | 177 | accountsPageComponentLoader.setSource("AccountsPage.qml", { | 223 | accountsPageComponentLoader.setSource("AccountsPage.qml", { |
529 | 178 | "accountProvider": accountProvider, | 224 | "accountProvider": accountProvider, |
530 | 179 | "applicationName": unversionedAppId, | 225 | "applicationName": unversionedAppId, |
531 | 180 | "webappCookieStore": __webappCookieStore, | ||
532 | 181 | "onlineAccountStoreComponent": localCookieStoreDbPath.length !== 0 ? | ||
533 | 182 | localCookieStoreComponent : onlineAccountStoreComponent | ||
534 | 183 | }) | 226 | }) |
535 | 184 | } | 227 | } |
536 | 185 | 228 | ||
537 | 186 | function loadWebAppView() { | 229 | function loadWebAppView() { |
538 | 187 | if (accountsPageComponentLoader.item) | 230 | if (accountsPageComponentLoader.item) |
539 | 188 | accountsPageComponentLoader.item.visible = false | 231 | accountsPageComponentLoader.item.visible = false |
546 | 189 | browser.visible = true; | 232 | |
547 | 190 | if (browser.currentWebview) { | 233 | webappViewLoader.loaded.connect(function () { |
548 | 191 | browser.currentWebview.visible = true; | 234 | if (webappViewLoader.status === Loader.Ready) { |
549 | 192 | browser.currentWebview.url = root.url | 235 | webappViewLoader.item.currentWebview.url = root.url |
550 | 193 | browser.webappName = root.webappName | 236 | } |
551 | 194 | } | 237 | }); |
552 | 238 | webappViewLoader.sourceComponent = webappViewComponent | ||
553 | 195 | } | 239 | } |
554 | 196 | 240 | ||
555 | 197 | // Handle runtime requests to open urls as defined | 241 | // Handle runtime requests to open urls as defined |
FAILED: Continuous integration, rev:757 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 1144/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/5600 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 3965 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- amd64-ci/ 343 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 343 jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- armhf-ci/ 343/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-utopic- i386-ci/ 343 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/5291 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/6852 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/6852/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 14270 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 3338 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/4292 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/4292/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 1144/rebuild
http://