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

Unified Diff: ash/mus/window_manager_application.cc

Issue 2381753002: Use mojo SystemTray interfaces for both mash and classic ash (Closed)
Patch Set: Restructure based on feedback Created 4 years, 3 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: ash/mus/window_manager_application.cc
diff --git a/ash/mus/window_manager_application.cc b/ash/mus/window_manager_application.cc
index 1eb5843775e34fc169d2227fc29d95611271e976..db363ebf24f1783c2bfdbb69d9c2ad158263d9ac 100644
--- a/ash/mus/window_manager_application.cc
+++ b/ash/mus/window_manager_application.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "ash/common/material_design/material_design_controller.h"
+#include "ash/common/mojo_interface_factory.h"
#include "ash/common/wm_shell.h"
#include "ash/mus/accelerators/accelerator_registrar_impl.h"
#include "ash/mus/native_widget_factory_mus.h"
@@ -30,7 +31,6 @@
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/power/power_status.h"
-#include "ash/mus/system_tray_delegate_mus.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_handler.h"
@@ -156,8 +156,11 @@ void WindowManagerApplication::OnStart(const shell::Identity& identity) {
bool WindowManagerApplication::OnConnect(const shell::Identity& remote_identity,
shell::InterfaceRegistry* registry) {
+ // Register services used in both classic ash and mash.
+ MojoInterfaceFactory::RegisterInterfaces(registry,
+ base::ThreadTaskRunnerHandle::Get());
+
registry->AddInterface<mojom::ShelfController>(this);
- registry->AddInterface<mojom::SystemTray>(this);
registry->AddInterface<mojom::WallpaperController>(this);
registry->AddInterface<ui::mojom::AcceleratorRegistrar>(this);
if (remote_identity.name() == "mojo:mash_session") {
@@ -176,17 +179,6 @@ void WindowManagerApplication::Create(const shell::Identity& remote_identity,
shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request));
}
-void WindowManagerApplication::Create(const shell::Identity& remote_identity,
- mojom::SystemTrayRequest request) {
-#if defined(OS_CHROMEOS)
- // Chrome-with-ash only runs on Chrome OS, so don't provide the SystemTray
- // interface on other platforms.
- mojom::SystemTray* system_tray = SystemTrayDelegateMus::Get();
- DCHECK(system_tray);
- system_tray_bindings_.AddBinding(system_tray, std::move(request));
-#endif
-}
-
void WindowManagerApplication::Create(
const ::shell::Identity& remote_identity,
mojom::WallpaperControllerRequest request) {

Powered by Google App Engine
This is Rietveld 408576698