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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2218843003: mustash chrome: Change how mus connection is set up in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4f0bf8e06a13e0812c4e0735fdfa0a73d1440560..86e97c4a1afe38a1b051110199bc2f93928be07e 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -246,6 +246,13 @@
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
#endif
+#if defined(USE_AURA)
+#include "base/run_loop.h"
+#include "content/public/common/mojo_shell_connection.h"
+#include "services/shell/runner/common/client_util.h"
+#include "ui/views/mus/window_manager_connection.h"
+#endif
+
#if defined(USE_ASH)
#include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h"
#endif
@@ -767,6 +774,10 @@ ChromeContentBrowserClient::ChromeContentBrowserClient()
}
ChromeContentBrowserClient::~ChromeContentBrowserClient() {
+ // Attempting to destroy the WindowManagerConnection here results in a crash,
+ // since the thread is shutting down and the AtExitManager is running the tear
+ // down callbacks. So let it leak.
+ window_manager_connection_.release();
for (int i = static_cast<int>(extra_parts_.size()) - 1; i >= 0; --i)
delete extra_parts_[i];
extra_parts_.clear();
@@ -2857,6 +2868,19 @@ void ChromeContentBrowserClient::RegisterOutOfProcessMojoApplications(
apps->insert(std::make_pair("mojo:media",
base::ASCIIToUTF16("Media App")));
#endif
+#if defined(USE_AURA)
Ben Goodger (Google) 2016/08/05 23:01:21 this seems like a really arbitrary place to do thi
jam 2016/08/05 23:07:07 I was asking Sadrul if there are ways of doing thi
sadrul 2016/08/05 23:24:39 ChromeContentBrowserClient does create ChromeBrows
+ if (shell::ShellIsRemote()) {
+ content::MojoShellConnection* connection =
+ content::MojoShellConnection::GetForProcess();
+ // TODO(rockot): Remove the blocking wait for init.
+ // http://crbug.com/594852.
+ base::RunLoop wait_loop;
+ connection->SetInitializeHandler(wait_loop.QuitClosure());
+ wait_loop.Run();
+ window_manager_connection_ = views::WindowManagerConnection::Create(
+ connection->GetConnector(), connection->GetIdentity());
+ }
+#endif
}
void ChromeContentBrowserClient::OpenURL(
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698