Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: content/shell/shell_browser_main_parts.cc

Issue 10035034: Implement the skeleton of an android content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed drawable png as it was checked in separately. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/shell_browser_main_parts.cc
diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc
index 10743885cb8c7a1c159823b750846741784bc08d..c7d0b4ba6ab36a6b0d6d068e1914156d4b191177 100644
--- a/content/shell/shell_browser_main_parts.cc
+++ b/content/shell/shell_browser_main_parts.cc
@@ -19,6 +19,10 @@
#include "net/base/net_module.h"
#include "ui/base/clipboard/clipboard.h"
+#if defined(OS_ANDROID)
+#include "base/message_pump_android.h"
+#endif
+
namespace content {
static GURL GetStartupURL() {
@@ -30,6 +34,12 @@ static GURL GetStartupURL() {
return GURL(args[0]);
}
+#if defined(OS_ANDROID)
+static base::MessagePump* CreateMessagePumpForShell() {
+ return new base::MessagePumpForUI();
+}
+#endif
+
ShellBrowserMainParts::ShellBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts(),
@@ -41,6 +51,10 @@ ShellBrowserMainParts::~ShellBrowserMainParts() {
#if !defined(OS_MACOSX)
void ShellBrowserMainParts::PreMainMessageLoopStart() {
+#if defined(OS_ANDROID)
+ MessageLoopForUI::InitMessagePumpForUIFactory(&CreateMessagePumpForShell);
+ MessageLoopForUI::current()->Start();
+#endif
}
#endif
@@ -48,6 +62,12 @@ int ShellBrowserMainParts::PreCreateThreads() {
return 0;
}
+void ShellBrowserMainParts::PreEarlyInitialization() {
+#if defined(OS_ANDROID)
+ // TODO(tedchoc): Setup the NetworkChangeNotifier here.
+#endif
+}
+
void ShellBrowserMainParts::PreMainMessageLoopRun() {
browser_context_.reset(new ShellBrowserContext);

Powered by Google App Engine
This is Rietveld 408576698