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

Side by Side Diff: services/ui/public/cpp/input_devices/input_device_client.h

Issue 2196563004: Add tests for InputDeviceServer/InputDeviceClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_
6 #define SERVICES_UI_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_ 6 #define SERVICES_UI_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 29 matching lines...) Expand all
40 const override; 40 const override;
41 const std::vector<ui::InputDevice>& GetMouseDevices() const override; 41 const std::vector<ui::InputDevice>& GetMouseDevices() const override;
42 const std::vector<ui::InputDevice>& GetTouchpadDevices() const override; 42 const std::vector<ui::InputDevice>& GetTouchpadDevices() const override;
43 43
44 bool AreDeviceListsComplete() const override; 44 bool AreDeviceListsComplete() const override;
45 bool AreTouchscreensEnabled() const override; 45 bool AreTouchscreensEnabled() const override;
46 46
47 void AddObserver(ui::InputDeviceEventObserver* observer) override; 47 void AddObserver(ui::InputDeviceEventObserver* observer) override;
48 void RemoveObserver(ui::InputDeviceEventObserver* observer) override; 48 void RemoveObserver(ui::InputDeviceEventObserver* observer) override;
49 49
50 private: 50 protected:
51 // Default constructor registers as InputDeviceManager. Can be subclassed in
52 // tests to avoid this.
53 InputDeviceClient(bool is_input_device_manager);
sadrul 2016/08/02 15:16:14 explicit
kylechar 2016/08/02 17:46:57 Done.
54 mojom::InputDeviceObserverMojoPtr GetIntefacePtr();
55
51 // mojom::InputDeviceObserverMojo: 56 // mojom::InputDeviceObserverMojo:
52 void OnKeyboardDeviceConfigurationChanged( 57 void OnKeyboardDeviceConfigurationChanged(
53 const std::vector<ui::InputDevice>& devices) override; 58 const std::vector<ui::InputDevice>& devices) override;
54 void OnTouchscreenDeviceConfigurationChanged( 59 void OnTouchscreenDeviceConfigurationChanged(
55 const std::vector<ui::TouchscreenDevice>& devices) override; 60 const std::vector<ui::TouchscreenDevice>& devices) override;
56 void OnMouseDeviceConfigurationChanged( 61 void OnMouseDeviceConfigurationChanged(
57 const std::vector<ui::InputDevice>& devices) override; 62 const std::vector<ui::InputDevice>& devices) override;
58 void OnTouchpadDeviceConfigurationChanged( 63 void OnTouchpadDeviceConfigurationChanged(
59 const std::vector<ui::InputDevice>& devices) override; 64 const std::vector<ui::InputDevice>& devices) override;
60 void OnDeviceListsComplete( 65 void OnDeviceListsComplete(
61 const std::vector<ui::InputDevice>& keyboard_devices, 66 const std::vector<ui::InputDevice>& keyboard_devices,
62 const std::vector<ui::TouchscreenDevice>& touchscreen_devices, 67 const std::vector<ui::TouchscreenDevice>& touchscreen_devices,
63 const std::vector<ui::InputDevice>& mouse_devices, 68 const std::vector<ui::InputDevice>& mouse_devices,
64 const std::vector<ui::InputDevice>& touchpad_devices) override; 69 const std::vector<ui::InputDevice>& touchpad_devices) override;
65 70
71 private:
66 mojo::Binding<mojom::InputDeviceObserverMojo> binding_; 72 mojo::Binding<mojom::InputDeviceObserverMojo> binding_;
67 73
74 bool is_input_device_manager_ = false;
75
68 // Holds the list of input devices and signal that we have received the lists 76 // Holds the list of input devices and signal that we have received the lists
69 // after initialization. 77 // after initialization.
70 std::vector<ui::InputDevice> keyboard_devices_; 78 std::vector<ui::InputDevice> keyboard_devices_;
71 std::vector<ui::TouchscreenDevice> touchscreen_devices_; 79 std::vector<ui::TouchscreenDevice> touchscreen_devices_;
72 std::vector<ui::InputDevice> mouse_devices_; 80 std::vector<ui::InputDevice> mouse_devices_;
73 std::vector<ui::InputDevice> touchpad_devices_; 81 std::vector<ui::InputDevice> touchpad_devices_;
74 bool device_lists_complete_ = false; 82 bool device_lists_complete_ = false;
75 83
76 // List of in-process observers. 84 // List of in-process observers.
77 base::ObserverList<ui::InputDeviceEventObserver> observers_; 85 base::ObserverList<ui::InputDeviceEventObserver> observers_;
78 86
79 DISALLOW_COPY_AND_ASSIGN(InputDeviceClient); 87 DISALLOW_COPY_AND_ASSIGN(InputDeviceClient);
80 }; 88 };
81 89
82 } // namespace ui 90 } // namespace ui
83 91
84 #endif // SERVICES_UI_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_ 92 #endif // SERVICES_UI_PUBLIC_CPP_INPUT_DEVICES_INPUT_DEVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698