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

Side by Side Diff: ui/events/device_data_manager.cc

Issue 618283003: Adds special support to the device manager for keyboards devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/events/device_data_manager.h" 5 #include "ui/events/device_data_manager.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/events/input_device_event_observer.h" 10 #include "ui/events/input_device_event_observer.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const { 106 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const {
107 if (IsTouchDeviceIdValid(touch_device_id)) 107 if (IsTouchDeviceIdValid(touch_device_id))
108 return touch_device_to_display_map_[touch_device_id]; 108 return touch_device_to_display_map_[touch_device_id];
109 return gfx::Display::kInvalidDisplayID; 109 return gfx::Display::kInvalidDisplayID;
110 } 110 }
111 111
112 void DeviceDataManager::OnTouchscreenDevicesUpdated( 112 void DeviceDataManager::OnTouchscreenDevicesUpdated(
113 const std::vector<TouchscreenDevice>& devices) { 113 const std::vector<TouchscreenDevice>& devices) {
114 touchscreen_devices_ = devices; 114 touchscreen_devices_ = devices;
115 }
115 116
117 void DeviceDataManager::OnKeyboardDevicesUpdated(
118 const std::vector<KeyboardDevice>& devices) {
119 keyboard_devices_ = devices;
120 }
sadrul 2014/10/02 15:53:53 You should explicitly call into OnInputDeviceConfi
rsadam 2014/10/02 22:52:27 Changed to two methods as discussed offline.
121
122 void DeviceDataManager::OnInputDeviceConfigurationChanged() {
116 FOR_EACH_OBSERVER(InputDeviceEventObserver, 123 FOR_EACH_OBSERVER(InputDeviceEventObserver,
117 observers_, 124 observers_,
118 OnInputDeviceConfigurationChanged()); 125 OnInputDeviceConfigurationChanged());
119 } 126 }
120 127
121 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { 128 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) {
122 observers_.AddObserver(observer); 129 observers_.AddObserver(observer);
123 } 130 }
124 131
125 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { 132 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) {
126 observers_.RemoveObserver(observer); 133 observers_.RemoveObserver(observer);
127 } 134 }
128 135
129 } // namespace ui 136 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698