| Index: ui/events/devices/device_data_manager.cc
|
| diff --git a/ui/events/devices/device_data_manager.cc b/ui/events/devices/device_data_manager.cc
|
| index eb96c46478924f00385b6a865bb33b1580ac7411..11e7f11e759a8aa0da51980affbbad7a074d2555 100644
|
| --- a/ui/events/devices/device_data_manager.cc
|
| +++ b/ui/events/devices/device_data_manager.cc
|
| @@ -31,10 +31,7 @@ DeviceDataManager::DeviceDataManager() {
|
| base::AtExitManager::RegisterTask(
|
| base::Bind(&base::DeletePointer<DeviceDataManager>, this));
|
|
|
| - for (int i = 0; i < kMaxDeviceNum; ++i) {
|
| - touch_device_to_display_map_[i] = gfx::Display::kInvalidDisplayID;
|
| - touch_radius_scale_map_[i] = 1.0;
|
| - }
|
| + ClearTouchDeviceAssociations();
|
| }
|
|
|
| DeviceDataManager::~DeviceDataManager() {
|
| @@ -64,10 +61,11 @@ bool DeviceDataManager::HasInstance() {
|
| return instance_ != NULL;
|
| }
|
|
|
| -void DeviceDataManager::ClearTouchTransformerRecord() {
|
| +void DeviceDataManager::ClearTouchDeviceAssociations() {
|
| + touch_device_to_display_map_.clear();
|
| +
|
| for (int i = 0; i < kMaxDeviceNum; i++) {
|
| touch_device_transformer_map_[i] = gfx::Transform();
|
| - touch_device_to_display_map_[i] = gfx::Display::kInvalidDisplayID;
|
| touch_radius_scale_map_[i] = 1.0;
|
| }
|
| }
|
| @@ -78,11 +76,11 @@ bool DeviceDataManager::IsTouchDeviceIdValid(
|
| }
|
|
|
| void DeviceDataManager::UpdateTouchInfoForDisplay(
|
| - int64_t display_id,
|
| + const gfx::Display& display,
|
| unsigned int touch_device_id,
|
| const gfx::Transform& touch_transformer) {
|
| if (IsTouchDeviceIdValid(touch_device_id)) {
|
| - touch_device_to_display_map_[touch_device_id] = display_id;
|
| + touch_device_to_display_map_[touch_device_id] = display;
|
| touch_device_transformer_map_[touch_device_id] = touch_transformer;
|
| }
|
| }
|
| @@ -112,11 +110,14 @@ void DeviceDataManager::ApplyTouchTransformer(unsigned int touch_device_id,
|
| }
|
| }
|
|
|
| -int64_t DeviceDataManager::GetDisplayForTouchDevice(
|
| +gfx::Display DeviceDataManager::GetDisplayForTouchDevice(
|
| unsigned int touch_device_id) const {
|
| - if (IsTouchDeviceIdValid(touch_device_id))
|
| - return touch_device_to_display_map_[touch_device_id];
|
| - return gfx::Display::kInvalidDisplayID;
|
| + if (!IsTouchDeviceIdValid(touch_device_id))
|
| + return gfx::Display();
|
| +
|
| + std::map<unsigned int, gfx::Display>::const_iterator it =
|
| + touch_device_to_display_map_.find(touch_device_id);
|
| + return it == touch_device_to_display_map_.end() ? gfx::Display() : it->second;
|
| }
|
|
|
| void DeviceDataManager::OnTouchscreenDevicesUpdated(
|
|
|