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

Side by Side Diff: services/ui/ws/touch_controller.cc

Issue 2189893004: Unify display ids between Display and PlatformDisplay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to pure virtual. 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/ws/test_utils.cc ('k') | services/ui/ws/user_display_manager.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 #include "services/ui/ws/touch_controller.h" 5 #include "services/ui/ws/touch_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const std::vector<ui::TouchscreenDevice>& touch_devices = 75 const std::vector<ui::TouchscreenDevice>& touch_devices =
76 device_manager->GetTouchscreenDevices(); 76 device_manager->GetTouchscreenDevices();
77 77
78 // Mash can only handle a single display so this doesn't implement support for 78 // Mash can only handle a single display so this doesn't implement support for
79 // matching touchscreens with multiple displays. 79 // matching touchscreens with multiple displays.
80 // TODO(kylechar): Implement support for multiple displays when needed. 80 // TODO(kylechar): Implement support for multiple displays when needed.
81 if (touch_displays.size() == 1 && touch_devices.size() == 1) { 81 if (touch_displays.size() == 1 && touch_devices.size() == 1) {
82 const Display* touch_display = *touch_displays.begin(); 82 const Display* touch_display = *touch_displays.begin();
83 const ui::TouchscreenDevice& touch_device = touch_devices[0]; 83 const ui::TouchscreenDevice& touch_device = touch_devices[0];
84 84
85 int64_t touch_display_id = touch_display->GetPlatformDisplayId(); 85 int64_t touch_display_id = touch_display->GetId();
86 int touch_device_id = touch_device.id; 86 int touch_device_id = touch_device.id;
87 87
88 if (touch_device_id != ui::InputDevice::kInvalidId) { 88 if (touch_device_id != ui::InputDevice::kInvalidId) {
89 device_manager->UpdateTouchRadiusScale( 89 device_manager->UpdateTouchRadiusScale(
90 touch_device_id, 90 touch_device_id,
91 ComputeTouchResolutionScale(touch_display, touch_device)); 91 ComputeTouchResolutionScale(touch_display, touch_device));
92 92
93 device_manager->UpdateTouchInfoForDisplay( 93 device_manager->UpdateTouchInfoForDisplay(
94 touch_display_id, touch_device_id, 94 touch_display_id, touch_device_id,
95 ComputeTouchTransform(touch_display, touch_device)); 95 ComputeTouchTransform(touch_display, touch_device));
96 } 96 }
97 } 97 }
98 } 98 }
99 99
100 void TouchController::OnTouchscreenDeviceConfigurationChanged() { 100 void TouchController::OnTouchscreenDeviceConfigurationChanged() {
101 UpdateTouchTransforms(); 101 UpdateTouchTransforms();
102 } 102 }
103 103
104 } // namespace ws 104 } // namespace ws
105 } // namespace ui 105 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/user_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698