summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--blinq.gypi1
-rw-r--r--lib/blinqpage.cpp13
2 files changed, 12 insertions, 2 deletions
diff --git a/blinq.gypi b/blinq.gypi
index dcdba86ad..58346a323 100644
--- a/blinq.gypi
+++ b/blinq.gypi
@@ -13,6 +13,7 @@
},
'dependencies': [
'<(chromium_src_dir)/content/content.gyp:content',
+ '<(chromium_src_dir)/content/content.gyp:content_shell_lib',
'<(chromium_src_dir)/content/content_resources.gyp:content_resources',
'<(chromium_src_dir)/base/base.gyp:base',
'<(chromium_src_dir)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
diff --git a/lib/blinqpage.cpp b/lib/blinqpage.cpp
index ecf7215db..2964cf089 100644
--- a/lib/blinqpage.cpp
+++ b/lib/blinqpage.cpp
@@ -1,5 +1,8 @@
#include "blinqpage.h"
+// Needed to get access to content::GetContentClient()
+#define CONTENT_IMPLEMENTATION
+
#include "content/public/browser/web_contents.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/resource_context.h"
@@ -8,6 +11,7 @@
#include "content/public/browser/web_contents_view.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/app/content_main_runner.h"
+#include "content/public/app/content_main_delegate.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/main_function_params.h"
#include "net/url_request/url_request_context_getter.h"
@@ -24,6 +28,9 @@
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#include "ui/gfx/screen.h"
#include "base/threading/thread_restrictions.h"
+#include "content/shell/shell_browser_context.h"
+#include "content/shell/shell_main_delegate.h"
+#include "content/shell/shell_content_browser_client.h"
#include <QByteArray>
#include <QWindow>
@@ -291,7 +298,7 @@ BlinqPage::BlinqPage(int argc, char **argv)
static content::ContentMainRunner *runner = 0;
if (!runner) {
runner = content::ContentMainRunner::Create();
- runner->Initialize(0, 0, 0);
+ runner->Initialize(0, 0, new content::ShellMainDelegate);
}
initializeBlinkPaths();
@@ -320,7 +327,9 @@ BlinqPage::BlinqPage(int argc, char **argv)
params.host = d->rootWindowHost.get();
d->rootWindow.reset(new aura::RootWindow(params));
}
- d->context.reset(new Context);
+ //d->context.reset(new Context);
+ //d->context.reset(new content::ShellBrowserContext(/*off the record*/false));
+ d->context.reset(static_cast<content::ShellContentBrowserClient*>(content::GetContentClient()->browser())->browser_context());
d->contents.reset(content::WebContents::Create(content::WebContents::CreateParams(d->context.get())));
d->rootWindow->Init();
d->rootWindow->AddChild(d->contents->GetView()->GetNativeView());