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

Side by Side Diff: services/ui/input_devices/input_device_server.cc

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « services/ui/input_devices/input_device_server.h ('k') | services/ui/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/ui/input_devices/input_device_server.h" 5 #include "services/ui/input_devices/input_device_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "mojo/public/cpp/bindings/array.h" 10 #include "mojo/public/cpp/bindings/array.h"
(...skipping 16 matching lines...) Expand all
27 if (!manager_ && ui::DeviceDataManager::HasInstance()) { 27 if (!manager_ && ui::DeviceDataManager::HasInstance()) {
28 manager_ = ui::DeviceDataManager::GetInstance(); 28 manager_ = ui::DeviceDataManager::GetInstance();
29 manager_->AddObserver(this); 29 manager_->AddObserver(this);
30 } 30 }
31 } 31 }
32 32
33 bool InputDeviceServer::IsRegisteredAsObserver() const { 33 bool InputDeviceServer::IsRegisteredAsObserver() const {
34 return manager_ != nullptr; 34 return manager_ != nullptr;
35 } 35 }
36 36
37 void InputDeviceServer::AddInterface(shell::InterfaceRegistry* registry) { 37 void InputDeviceServer::AddInterface(
38 service_manager::InterfaceRegistry* registry) {
38 DCHECK(IsRegisteredAsObserver()); 39 DCHECK(IsRegisteredAsObserver());
39 registry->AddInterface<mojom::InputDeviceServer>(this); 40 registry->AddInterface<mojom::InputDeviceServer>(this);
40 } 41 }
41 42
42 void InputDeviceServer::AddObserver( 43 void InputDeviceServer::AddObserver(
43 mojom::InputDeviceObserverMojoPtr observer) { 44 mojom::InputDeviceObserverMojoPtr observer) {
44 // We only want to send this message once, so we need to check to make sure 45 // We only want to send this message once, so we need to check to make sure
45 // device lists are actually complete before sending it to a new observer. 46 // device lists are actually complete before sending it to a new observer.
46 if (manager_->AreDeviceListsComplete()) 47 if (manager_->AreDeviceListsComplete())
47 SendDeviceListsComplete(observer.get()); 48 SendDeviceListsComplete(observer.get());
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 void InputDeviceServer::SendDeviceListsComplete( 104 void InputDeviceServer::SendDeviceListsComplete(
104 mojom::InputDeviceObserverMojo* observer) { 105 mojom::InputDeviceObserverMojo* observer) {
105 DCHECK(manager_->AreDeviceListsComplete()); 106 DCHECK(manager_->AreDeviceListsComplete());
106 107
107 observer->OnDeviceListsComplete( 108 observer->OnDeviceListsComplete(
108 manager_->GetKeyboardDevices(), manager_->GetTouchscreenDevices(), 109 manager_->GetKeyboardDevices(), manager_->GetTouchscreenDevices(),
109 manager_->GetMouseDevices(), manager_->GetTouchpadDevices()); 110 manager_->GetMouseDevices(), manager_->GetTouchpadDevices());
110 } 111 }
111 112
112 void InputDeviceServer::Create(const shell::Identity& remote_identity, 113 void InputDeviceServer::Create(const service_manager::Identity& remote_identity,
113 mojom::InputDeviceServerRequest request) { 114 mojom::InputDeviceServerRequest request) {
114 bindings_.AddBinding(this, std::move(request)); 115 bindings_.AddBinding(this, std::move(request));
115 } 116 }
116 117
117 } // namespace ui 118 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/input_devices/input_device_server.h ('k') | services/ui/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698