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

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

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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/demo/mus_demo.cc ('k') | services/ui/input_devices/input_device_server.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 #ifndef SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_ 5 #ifndef SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_
6 #define SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_ 6 #define SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "mojo/public/cpp/bindings/interface_ptr_set.h" 10 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
11 #include "services/shell/public/cpp/connection.h" 11 #include "services/shell/public/cpp/connection.h"
12 #include "services/shell/public/cpp/interface_factory.h" 12 #include "services/shell/public/cpp/interface_factory.h"
13 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom. h" 13 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom. h"
14 #include "ui/events/devices/device_data_manager.h" 14 #include "ui/events/devices/device_data_manager.h"
15 #include "ui/events/devices/input_device_event_observer.h" 15 #include "ui/events/devices/input_device_event_observer.h"
16 16
17 namespace shell {
18 class InterfaceRegistry;
19 }
20
17 namespace ui { 21 namespace ui {
18 22
19 // Listens to DeviceDataManager for updates on input-devices and forwards those 23 // Listens to DeviceDataManager for updates on input-devices and forwards those
20 // updates to any registered InputDeviceObserverMojo in other processes via 24 // updates to any registered InputDeviceObserverMojo in other processes via
21 // Mojo IPC. This runs in the mus-ws process. 25 // Mojo IPC. This runs in the mus-ws process.
22 class InputDeviceServer 26 class InputDeviceServer
23 : public shell::InterfaceFactory<mojom::InputDeviceServer>, 27 : public shell::InterfaceFactory<mojom::InputDeviceServer>,
24 public mojom::InputDeviceServer, 28 public mojom::InputDeviceServer,
25 public ui::InputDeviceEventObserver { 29 public ui::InputDeviceEventObserver {
26 public: 30 public:
27 InputDeviceServer(); 31 InputDeviceServer();
28 ~InputDeviceServer() override; 32 ~InputDeviceServer() override;
29 33
30 // Registers this instance as a local observer with DeviceDataManager. 34 // Registers this instance as a local observer with DeviceDataManager.
31 void RegisterAsObserver(); 35 void RegisterAsObserver();
32 bool IsRegisteredAsObserver() const; 36 bool IsRegisteredAsObserver() const;
33 37
34 // Adds interface with the shell connection so remote observers can connect. 38 // Adds interface with the connection registry so remote observers can
35 // You should have already called RegisterAsObserver() to get local 39 // connect. You should have already called RegisterAsObserver() to get local
36 // input-device event updates and checked it was successful by calling 40 // input-device event updates and checked it was successful by calling
37 // IsRegisteredAsObserver(). 41 // IsRegisteredAsObserver().
38 void AddInterface(shell::Connection* connection); 42 void AddInterface(shell::InterfaceRegistry* registry);
39 43
40 // mojom::InputDeviceServer: 44 // mojom::InputDeviceServer:
41 void AddObserver(mojom::InputDeviceObserverMojoPtr observer) override; 45 void AddObserver(mojom::InputDeviceObserverMojoPtr observer) override;
42 46
43 // ui::InputDeviceEventObserver: 47 // ui::InputDeviceEventObserver:
44 void OnKeyboardDeviceConfigurationChanged() override; 48 void OnKeyboardDeviceConfigurationChanged() override;
45 void OnTouchscreenDeviceConfigurationChanged() override; 49 void OnTouchscreenDeviceConfigurationChanged() override;
46 void OnMouseDeviceConfigurationChanged() override; 50 void OnMouseDeviceConfigurationChanged() override;
47 void OnTouchpadDeviceConfigurationChanged() override; 51 void OnTouchpadDeviceConfigurationChanged() override;
48 void OnDeviceListsComplete() override; 52 void OnDeviceListsComplete() override;
(...skipping 11 matching lines...) Expand all
60 64
61 // DeviceDataManager instance we are registered as an observer with. 65 // DeviceDataManager instance we are registered as an observer with.
62 ui::DeviceDataManager* manager_ = nullptr; 66 ui::DeviceDataManager* manager_ = nullptr;
63 67
64 DISALLOW_COPY_AND_ASSIGN(InputDeviceServer); 68 DISALLOW_COPY_AND_ASSIGN(InputDeviceServer);
65 }; 69 };
66 70
67 } // namespace ui 71 } // namespace ui
68 72
69 #endif // SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_ 73 #endif // SERVICES_UI_INPUT_DEVICES_INPUT_DEVICE_SERVER_H_
OLDNEW
« no previous file with comments | « services/ui/demo/mus_demo.cc ('k') | services/ui/input_devices/input_device_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698