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

Unified Diff: ash/common/mojo_interface_factory.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 | « ash/common/mojo_interface_factory.h ('k') | ash/common/shell_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..498ff264f9285f9544fe556fbd00727dc5b8c96c
--- /dev/null
+++ b/ash/common/mojo_interface_factory.cc
@@ -0,0 +1,33 @@
+// 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
+
+namespace mojo_interface_factory {
+
+void RegisterInterfaces(
+ shell::InterfaceRegistry* registry,
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
+ registry->AddInterface(base::Bind(&BindSystemTrayRequestOnMainThread),
+ main_thread_task_runner);
+}
+
+} // namespace mojo_interface_factory
+
+} // namespace ash
« no previous file with comments | « ash/common/mojo_interface_factory.h ('k') | ash/common/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698