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

Unified Diff: content/browser/browser_main_loop.cc

Issue 1442893002: Move Shell connection to content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i2
Patch Set: . Created 5 years, 1 month 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/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 8566b99432e0192e6b8ffe63d551019c19d95cab..9c94024ed6a4388db81af57a6ac49a3244cf81cb 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -170,6 +170,12 @@
#include "crypto/nss_util.h"
#endif
+#if defined(MOJO_SHELL_CLIENT)
+#include "components/mus/public/interfaces/window_manager.mojom.h"
+#include "content/common/mojo/mojo_shell_connection_impl.h"
+#include "ui/views/mus/window_manager_connection.h"
+#endif
+
// One of the linux specific headers defines this as a macro.
#ifdef DestroyAll
#undef DestroyAll
@@ -903,6 +909,17 @@ int BrowserMainLoop::CreateThreads() {
}
int BrowserMainLoop::PreMainMessageLoopRun() {
+#if defined(MOJO_SHELL_CLIENT)
+ if (IsRunningInMojoShell()) {
+ MojoShellConnectionImpl::Create();
+ mus::mojom::WindowManagerPtr window_manager;
+ application->ConnectToService(
+ mojo::URLRequest::From(std::string("mojo:example_wm")),
+ &window_manager);
+ views::WindowManagerConnection::Create(window_manager.Pass(), application);
+ }
+#endif
+
if (parts_) {
TRACE_EVENT0("startup",
"BrowserMainLoop::CreateThreads:PreMainMessageLoopRun");
@@ -949,6 +966,9 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed),
true));
+#if defined(MOJO_SHELL_CLIENT)
+ MojoShellConnection::Destroy();
+#endif
mojo_ipc_support_.reset();
mojo_shell_context_.reset();

Powered by Google App Engine
This is Rietveld 408576698