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

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
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/child_process_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0747cdb99b91103d8d4a778e4b99832b3a45b302 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -170,6 +170,14 @@
#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 "mojo/application/public/cpp/application_impl.h"
+#include "mojo/converters/network/network_type_converters.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 +911,21 @@ int BrowserMainLoop::CreateThreads() {
}
int BrowserMainLoop::PreMainMessageLoopRun() {
+#if defined(MOJO_SHELL_CLIENT)
+ if (IsRunningInMojoShell()) {
+ MojoShellConnectionImpl::Create();
+#if defined(USE_AURA)
+ mus::mojom::WindowManagerPtr window_manager;
+ mojo::ApplicationImpl* application =
+ MojoShellConnection::Get()->GetApplication();
+ application->ConnectToService(
+ mojo::URLRequest::From(std::string("mojo:example_wm")),
+ &window_manager);
+ views::WindowManagerConnection::Create(window_manager.Pass(), application);
+#endif
+ }
+#endif
+
if (parts_) {
TRACE_EVENT0("startup",
"BrowserMainLoop::CreateThreads:PreMainMessageLoopRun");
@@ -949,6 +972,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();
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/child_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698