diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-06-10 19:33:44 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@digia.com> | 2013-06-10 19:33:44 +0200 |
commit | 6555874455eb23722974b06b388c3cbde0a24f95 (patch) | |
tree | a8d3a3de82ba8c151e8667bec426cc6d21004554 /lib/content_browser_client_qt.cpp | |
parent | d50a091095f49032587fef97034ba1210a1a8f0f (diff) |
And shell is out !
Introduce a few more bits of our own very basic implementations
(URLRequestContextGetter and NetworkDelegate subclasses).
Still need to figure out the appropriate dependancies in blinq.gypi
Diffstat (limited to 'lib/content_browser_client_qt.cpp')
-rw-r--r-- | lib/content_browser_client_qt.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/content_browser_client_qt.cpp b/lib/content_browser_client_qt.cpp index da8f08116..3c02d4359 100644 --- a/lib/content_browser_client_qt.cpp +++ b/lib/content_browser_client_qt.cpp @@ -1,17 +1,13 @@ #include "content_browser_client_qt.h" +#include "content/public/browser/browser_main_parts.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" -#include "content/public/common/main_function_params.h" #include "content/public/browser/render_process_host.h" - -// To be cleaned up -#include "content/shell/shell.h" -#include "content/shell/shell_browser_main_parts.h" -#include "content/shell/shell_browser_context.h" -#include "content/public/browser/browser_main_parts.h" +#include "content/public/common/main_function_params.h" #include "net/base/net_module.h" #include "net/base/net_util.h" + #include "browser_context_qt.h" #include "web_contents_view_qt.h" @@ -44,8 +40,8 @@ public: void PreEarlyInitialization() { } void PreMainMessageLoopRun() { - m_browserContext.reset(new content::ShellBrowserContext(false)); - m_offTheRecordBrowserContext.reset(new content::ShellBrowserContext(true)); + + m_browserContext.reset(new BrowserContextQt()); if (m_parameters.ui_task) { m_parameters.ui_task->Run(); @@ -60,16 +56,14 @@ public: void PostMainMessageLoopRun() { m_browserContext.reset(); - m_offTheRecordBrowserContext.reset(); } - content::ShellBrowserContext* browser_context() const { + BrowserContextQt* browser_context() const { return m_browserContext.get(); } private: - scoped_ptr<content::ShellBrowserContext> m_browserContext; - scoped_ptr<content::ShellBrowserContext> m_offTheRecordBrowserContext; + scoped_ptr<BrowserContextQt> m_browserContext; // For running content_browsertests. const content::MainFunctionParams& m_parameters; @@ -90,20 +84,17 @@ content::WebContentsViewPort* ContentBrowserClientQt::OverrideCreateWebContentsV content::BrowserMainParts *ContentBrowserClientQt::CreateBrowserMainParts(const content::MainFunctionParams ¶meters) { m_browserMainParts = new BrowserMainPartsQt(parameters); - // FIXME: We don't seem to need it yet, the ShellBrowserContext was being used. - // m_browser_context = new BrowserContextQt(); return m_browserMainParts; } -content::ShellBrowserContext* ContentBrowserClientQt::browser_context() { - return m_browserMainParts->browser_context(); - // return m_browser_context; +BrowserContextQt* ContentBrowserClientQt::browser_context() { + return static_cast<BrowserMainPartsQt*>(m_browserMainParts)->browser_context(); } net::URLRequestContextGetter* ContentBrowserClientQt::CreateRequestContext(content::BrowserContext* content_browser_context, content::ProtocolHandlerMap* protocol_handlers) { if (content_browser_context != browser_context()) fprintf(stderr, "Warning: off the record browser context not implemented !\n"); - return browser_context()->CreateRequestContext(protocol_handlers); + return static_cast<BrowserContextQt*>(browser_context())->CreateRequestContext(protocol_handlers); } |