~mardy/webbrowser-app/cookie-sharing

« back to all changes in this revision

Viewing changes to src/app/webcontainer/webapp-container.cpp

  • Committer: Alberto Mardegan
  • Date: 2015-05-11 10:00:59 UTC
  • Revision ID: alberto.mardegan@canonical.com-20150511100059-6lveyuq7gs2l2y6h
use shared cookie store

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "local-cookie-store.h"
25
25
#include "online-accounts-cookie-store.h"
26
26
#include "session-utils.h"
 
27
#include "shared-cookie-store.h"
27
28
#include "url-pattern-utils.h"
28
29
#include "webapp-container-helper.h"
29
30
 
86
87
    m_storeSessionCookies(false),
87
88
    m_backForwardButtonsVisible(false),
88
89
    m_addressBarVisible(false),
 
90
    m_sharedCookies(false),
89
91
    m_localWebappManifest(false),
90
92
    m_webappContainerHelper(new WebappContainerHelper())
91
93
{
119
121
        m_window->setProperty("backForwardButtonsVisible", m_backForwardButtonsVisible);
120
122
        m_window->setProperty("chromeVisible", m_addressBarVisible);
121
123
        m_window->setProperty("accountProvider", m_accountProvider);
 
124
        m_window->setProperty("sharedCookies", m_sharedCookies);
122
125
 
123
126
        m_window->setProperty("webappUrlPatterns", m_webappUrlPatterns);
124
127
        QQmlContext* context = m_engine->rootContext();
237
240
                                           "LocalCookieStore");
238
241
        qmlRegisterType<OnlineAccountsCookieStore>(privateModuleUri, 0, 1,
239
242
                                                   "OnlineAccountsCookieStore");
 
243
        qmlRegisterType<SharedCookieStore>(privateModuleUri, 0, 1,
 
244
                                           "SharedCookieStore");
240
245
    }
241
246
}
242
247
 
257
262
       " [--enable-back-forward]"
258
263
       " [--enable-addressbar]"
259
264
       " [--store-session-cookies]"
 
265
       " [--shared-cookies]"
260
266
       " [--user-agent-string=USER_AGENT]"
261
267
       " [URL]" << endl;
262
268
    out << "Options:" << endl;
272
278
    out << "  --webappUrlPatterns=URL_PATTERNS    list of comma-separated url patterns (wildcard based) that the webapp is allowed to navigate to" << endl;
273
279
    out << "  --accountProvider=PROVIDER_NAME     Online account provider for the application if the application is to reuse a local account." << endl;
274
280
    out << "  --store-session-cookies             store session cookies on disk" << endl;
 
281
    out << "  --shared-cookies                    share cookies with other webapps using the same account" << endl;
275
282
    out << "  --enable-media-hub-audio            enable media-hub for audio playback" << endl;
276
283
    out << "  --user-agent-string=USER_AGENT      overrides the default User Agent with the provided one." << endl;
277
284
    out << "Chrome options (if none specified, no chrome is shown by default):" << endl;
311
318
            clearCookiesHack(m_accountProvider);
312
319
        } else if (argument == "--store-session-cookies") {
313
320
            m_storeSessionCookies = true;
 
321
        } else if (argument == "--shared-cookies") {
 
322
            m_sharedCookies = true;
314
323
        } else if (argument == "--enable-back-forward") {
315
324
            m_backForwardButtonsVisible = true;
316
325
        } else if (argument == "--enable-addressbar") {