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

Unified Diff: chrome/browser/ui/ash/system_tray_client.cc

Issue 2381753002: Use mojo SystemTray interfaces for both mash and classic ash (Closed)
Patch Set: rebase again Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/ash/system_tray_client.h ('k') | chrome/browser/ui/ash/system_tray_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/system_tray_client.cc
diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client.cc
index ad01971f87d81fcfefb5b692e76b9e38590549c3..dd8a548458c6af6b7599d712e2592ec44887203c 100644
--- a/chrome/browser/ui/ash/system_tray_client.cc
+++ b/chrome/browser/ui/ash/system_tray_client.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chromeos/system/system_clock.h"
+#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/system_tray_common.h"
#include "content/public/common/mojo_shell_connection.h"
#include "services/shell/public/cpp/connector.h"
@@ -44,9 +45,14 @@ void SystemTrayClient::ConnectToSystemTray() {
if (system_tray_.is_bound())
return;
- content::MojoShellConnection::GetForProcess()
- ->GetConnector()
- ->ConnectToInterface("mojo:ash", &system_tray_);
+ shell::Connector* connector =
+ content::MojoShellConnection::GetForProcess()->GetConnector();
+ // Under mash the SystemTray interface is in the ash process. In classic ash
+ // we provide it to ourself.
+ if (chrome::IsRunningInMash())
+ connector->ConnectToInterface("mojo:ash", &system_tray_);
+ else
+ connector->ConnectToInterface("exe:content_browser", &system_tray_);
// Tolerate ash crashing and coming back up.
system_tray_.set_connection_error_handler(base::Bind(
« no previous file with comments | « chrome/browser/ui/ash/system_tray_client.h ('k') | chrome/browser/ui/ash/system_tray_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698