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); |