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

Side by Side Diff: chrome/browser/chromeos/chrome_interface_factory.cc

Issue 1760743002: Add simple mash context menu support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; use test items; cleanup. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/chrome_interface_factory.h" 5 #include "chrome/browser/chromeos/chrome_interface_factory.h"
6 6
7 #include "chrome/browser/ui/ash/context_menu.h"
7 #include "chrome/browser/ui/ash/keyboard_ui_service.h" 8 #include "chrome/browser/ui/ash/keyboard_ui_service.h"
8 #include "mojo/shell/public/cpp/connection.h" 9 #include "mojo/shell/public/cpp/connection.h"
9 10
10 namespace chromeos { 11 namespace chromeos {
11 12
12 ChromeInterfaceFactory::ChromeInterfaceFactory() {} 13 ChromeInterfaceFactory::ChromeInterfaceFactory() {}
13 ChromeInterfaceFactory::~ChromeInterfaceFactory() {} 14 ChromeInterfaceFactory::~ChromeInterfaceFactory() {}
14 15
15 bool ChromeInterfaceFactory::AcceptConnection(mojo::Connection* connection) { 16 bool ChromeInterfaceFactory::AcceptConnection(mojo::Connection* connection) {
16 connection->AddInterface(this); 17 connection->AddInterface(this);
17 return true; 18 return true;
18 } 19 }
19 20
20 void ChromeInterfaceFactory::Create( 21 void ChromeInterfaceFactory::Create(
21 mojo::Connection* connection, 22 mojo::Connection* connection,
22 mojo::InterfaceRequest<keyboard::mojom::Keyboard> request) { 23 mojo::InterfaceRequest<keyboard::mojom::Keyboard> request) {
23 if (!keyboard_ui_service_) 24 if (!keyboard_ui_service_)
24 keyboard_ui_service_.reset(new KeyboardUIService); 25 keyboard_ui_service_.reset(new KeyboardUIService);
25 keyboard_bindings_.AddBinding(keyboard_ui_service_.get(), std::move(request)); 26 keyboard_bindings_.AddBinding(keyboard_ui_service_.get(), std::move(request));
26 } 27 }
27 28
29 void ChromeInterfaceFactory::Create(
30 mojo::Connection* connection,
31 mojo::InterfaceRequest<mash::shelf::mojom::ContextMenu> request) {
32 if (!context_menu_)
33 context_menu_.reset(new ContextMenu);
34 context_menu_bindings_.AddBinding(context_menu_.get(), std::move(request));
35 }
36
28 } // namespace chromeos 37 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698