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

Unified Diff: ash/common/mojo_interface_factory.cc

Issue 2381753002: Use mojo SystemTray interfaces for both mash and classic ash (Closed)
Patch Set: review comments 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
Index: ash/common/mojo_interface_factory.cc
diff --git a/ash/common/mojo_interface_factory.cc b/ash/common/mojo_interface_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a50a40cc76d679db4b45b4f587c4b965340ff8d6
--- /dev/null
+++ b/ash/common/mojo_interface_factory.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/common/mojo_interface_factory.h"
+
+#include "ash/common/system/tray/system_tray_controller.h"
+#include "ash/common/wm_shell.h"
+#include "base/bind.h"
+#include "services/shell/public/cpp/interface_registry.h"
+
+namespace ash {
+
+namespace {
+
+void BindSystemTrayRequestOnMainThread(mojom::SystemTrayRequest request) {
+ WmShell::Get()->system_tray_controller()->BindRequest(std::move(request));
+}
+
+} // namespace
+
+// static
+void MojoInterfaceFactory::RegisterInterfaces(
+ shell::InterfaceRegistry* registry,
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
+ registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
+ main_thread_task_runner);
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698