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

Unified Diff: services/ui/public/cpp/input_devices/input_device_client.cc

Issue 2162653002: Switch input_devices mojom to use_new_wrapper_types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
Index: services/ui/public/cpp/input_devices/input_device_client.cc
diff --git a/services/ui/public/cpp/input_devices/input_device_client.cc b/services/ui/public/cpp/input_devices/input_device_client.cc
index 9a9133d2d3e16a45381743733e3f1b538ec8f26d..4137e2b40ddc7c5511d98ee8bce7b63883adbc8e 100644
--- a/services/ui/public/cpp/input_devices/input_device_client.cc
+++ b/services/ui/public/cpp/input_devices/input_device_client.cc
@@ -23,47 +23,47 @@ void InputDeviceClient::Connect(mojom::InputDeviceServerPtr server) {
}
void InputDeviceClient::OnKeyboardDeviceConfigurationChanged(
- mojo::Array<ui::InputDevice> devices) {
- keyboard_devices_ = devices.To<std::vector<ui::InputDevice>>();
+ const std::vector<ui::InputDevice>& devices) {
+ keyboard_devices_ = devices;
FOR_EACH_OBSERVER(ui::InputDeviceEventObserver, observers_,
OnKeyboardDeviceConfigurationChanged());
}
void InputDeviceClient::OnTouchscreenDeviceConfigurationChanged(
- mojo::Array<ui::TouchscreenDevice> devices) {
- touchscreen_devices_ = devices.To<std::vector<ui::TouchscreenDevice>>();
+ const std::vector<ui::TouchscreenDevice>& devices) {
+ touchscreen_devices_ = devices;
FOR_EACH_OBSERVER(ui::InputDeviceEventObserver, observers_,
OnTouchscreenDeviceConfigurationChanged());
}
void InputDeviceClient::OnMouseDeviceConfigurationChanged(
- mojo::Array<ui::InputDevice> devices) {
- mouse_devices_ = devices.To<std::vector<ui::InputDevice>>();
+ const std::vector<ui::InputDevice>& devices) {
+ mouse_devices_ = devices;
FOR_EACH_OBSERVER(ui::InputDeviceEventObserver, observers_,
OnMouseDeviceConfigurationChanged());
}
void InputDeviceClient::OnTouchpadDeviceConfigurationChanged(
- mojo::Array<ui::InputDevice> devices) {
- touchpad_devices_ = devices.To<std::vector<ui::InputDevice>>();
+ const std::vector<ui::InputDevice>& devices) {
+ touchpad_devices_ = devices;
FOR_EACH_OBSERVER(ui::InputDeviceEventObserver, observers_,
OnTouchpadDeviceConfigurationChanged());
}
void InputDeviceClient::OnDeviceListsComplete(
- mojo::Array<ui::InputDevice> keyboard_devices,
- mojo::Array<ui::TouchscreenDevice> touchscreen_devices,
- mojo::Array<ui::InputDevice> mouse_devices,
- mojo::Array<ui::InputDevice> touchpad_devices) {
+ const std::vector<ui::InputDevice>& keyboard_devices,
+ const std::vector<ui::TouchscreenDevice>& touchscreen_devices,
+ const std::vector<ui::InputDevice>& mouse_devices,
+ const std::vector<ui::InputDevice>& touchpad_devices) {
// Update the cached device lists if the received list isn't empty.
if (!keyboard_devices.empty())
- OnKeyboardDeviceConfigurationChanged(std::move(keyboard_devices));
+ OnKeyboardDeviceConfigurationChanged(keyboard_devices);
if (!touchscreen_devices.empty())
- OnTouchscreenDeviceConfigurationChanged(std::move(touchscreen_devices));
+ OnTouchscreenDeviceConfigurationChanged(touchscreen_devices);
if (!mouse_devices.empty())
- OnMouseDeviceConfigurationChanged(std::move(mouse_devices));
+ OnMouseDeviceConfigurationChanged(mouse_devices);
if (!touchpad_devices.empty())
- OnTouchpadDeviceConfigurationChanged(std::move(touchpad_devices));
+ OnTouchpadDeviceConfigurationChanged(touchpad_devices);
if (!device_lists_complete_) {
device_lists_complete_ = true;
« no previous file with comments | « services/ui/public/cpp/input_devices/input_device_client.h ('k') | services/ui/public/interfaces/input_devices/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698