summaryrefslogtreecommitdiffstats
path: root/lib/content_browser_client_qt.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-05-31 16:01:09 +0200
committerPierre Rossi <pierre.rossi@digia.com>2013-06-04 17:16:33 +0200
commit43ccfd1f398c06556340dbbbcbaaf68ee36ca1b4 (patch)
tree4e7dccc98e9727e0f5dd58905ea1828515a72357 /lib/content_browser_client_qt.cpp
parent6933621d6967a516f4800f27a71d45f088af3089 (diff)
Stop relying on ShellBrowserClient
We now have our own minimalistic subclass, which still makes use of some shell parts.
Diffstat (limited to 'lib/content_browser_client_qt.cpp')
-rw-r--r--lib/content_browser_client_qt.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/content_browser_client_qt.cpp b/lib/content_browser_client_qt.cpp
new file mode 100644
index 000000000..4251a9fe1
--- /dev/null
+++ b/lib/content_browser_client_qt.cpp
@@ -0,0 +1,41 @@
+#include "content_browser_client_qt.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_browser_main_parts.h"
+
+#include "browser_context_qt.h"
+#include "web_contents_view_qt.h"
+
+
+content::WebContentsViewPort* ContentBrowserClientQt::OverrideCreateWebContentsView(content::WebContents* web_contents, content::RenderViewHostDelegateView** render_view_host_delegate_view)
+{
+ fprintf(stderr, "OverrideCreateWebContentsView\n");
+ WebContentsViewQt* rv = new WebContentsViewQt(web_contents);
+ *render_view_host_delegate_view = rv;
+ return rv;
+}
+
+content::BrowserMainParts *ContentBrowserClientQt::CreateBrowserMainParts(const content::MainFunctionParams &parameters)
+{
+ m_browserMainParts = new content::ShellBrowserMainParts(parameters);
+ m_browser_context = new BrowserContextQt();
+ return m_browserMainParts;
+}
+
+
+BrowserContextQt* ContentBrowserClientQt::browser_context() {
+
+ return m_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);
+}