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

Side by Side Diff: ash/touch/touch_transformer_controller.cc

Issue 1924703002: Rename gfx::Display/Screen to display::Display/Screen in ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 "ash/touch/touch_transformer_controller.h" 5 #include "ash/touch/touch_transformer_controller.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/display/window_tree_host_manager.h" 8 #include "ash/display/window_tree_host_manager.h"
9 #include "ash/host/ash_window_tree_host.h" 9 #include "ash/host/ash_window_tree_host.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 GetTouchTransform(target_display, touch_display, 148 GetTouchTransform(target_display, touch_display,
149 FindTouchscreenById(device_id), fb_size)); 149 FindTouchscreenById(device_id), fb_size));
150 } 150 }
151 } 151 }
152 152
153 void TouchTransformerController::UpdateTouchTransformer() const { 153 void TouchTransformerController::UpdateTouchTransformer() const {
154 ui::DeviceDataManager* device_manager = ui::DeviceDataManager::GetInstance(); 154 ui::DeviceDataManager* device_manager = ui::DeviceDataManager::GetInstance();
155 device_manager->ClearTouchDeviceAssociations(); 155 device_manager->ClearTouchDeviceAssociations();
156 156
157 // Display IDs and DisplayInfo for mirror or extended mode. 157 // Display IDs and DisplayInfo for mirror or extended mode.
158 int64_t display1_id = gfx::Display::kInvalidDisplayID; 158 int64_t display1_id = display::Display::kInvalidDisplayID;
159 int64_t display2_id = gfx::Display::kInvalidDisplayID; 159 int64_t display2_id = display::Display::kInvalidDisplayID;
160 DisplayInfo display1; 160 DisplayInfo display1;
161 DisplayInfo display2; 161 DisplayInfo display2;
162 // Display ID and DisplayInfo for single display mode. 162 // Display ID and DisplayInfo for single display mode.
163 int64_t single_display_id = gfx::Display::kInvalidDisplayID; 163 int64_t single_display_id = display::Display::kInvalidDisplayID;
164 DisplayInfo single_display; 164 DisplayInfo single_display;
165 165
166 WindowTreeHostManager* window_tree_host_manager = 166 WindowTreeHostManager* window_tree_host_manager =
167 Shell::GetInstance()->window_tree_host_manager(); 167 Shell::GetInstance()->window_tree_host_manager();
168 DisplayManager* display_manager = GetDisplayManager(); 168 DisplayManager* display_manager = GetDisplayManager();
169 if (display_manager->num_connected_displays() == 0) { 169 if (display_manager->num_connected_displays() == 0) {
170 return; 170 return;
171 } else if (display_manager->num_connected_displays() == 1 || 171 } else if (display_manager->num_connected_displays() == 1 ||
172 display_manager->IsInUnifiedMode()) { 172 display_manager->IsInUnifiedMode()) {
173 single_display_id = display_manager->first_display_id(); 173 single_display_id = display_manager->first_display_id();
174 DCHECK(single_display_id != gfx::Display::kInvalidDisplayID); 174 DCHECK(single_display_id != display::Display::kInvalidDisplayID);
175 single_display = display_manager->GetDisplayInfo(single_display_id); 175 single_display = display_manager->GetDisplayInfo(single_display_id);
176 UpdateTouchRadius(single_display); 176 UpdateTouchRadius(single_display);
177 } else { 177 } else {
178 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); 178 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList();
179 display1_id = list[0]; 179 display1_id = list[0];
180 display2_id = list[1]; 180 display2_id = list[1];
181 DCHECK(display1_id != gfx::Display::kInvalidDisplayID && 181 DCHECK(display1_id != display::Display::kInvalidDisplayID &&
182 display2_id != gfx::Display::kInvalidDisplayID); 182 display2_id != display::Display::kInvalidDisplayID);
183 display1 = display_manager->GetDisplayInfo(display1_id); 183 display1 = display_manager->GetDisplayInfo(display1_id);
184 display2 = display_manager->GetDisplayInfo(display2_id); 184 display2 = display_manager->GetDisplayInfo(display2_id);
185 UpdateTouchRadius(display1); 185 UpdateTouchRadius(display1);
186 UpdateTouchRadius(display2); 186 UpdateTouchRadius(display2);
187 } 187 }
188 188
189 gfx::Size fb_size = 189 gfx::Size fb_size =
190 Shell::GetInstance()->display_configurator()->framebuffer_size(); 190 Shell::GetInstance()->display_configurator()->framebuffer_size();
191 191
192 if (display_manager->IsInMirrorMode()) { 192 if (display_manager->IsInMirrorMode()) {
(...skipping 30 matching lines...) Expand all
223 223
224 void TouchTransformerController::OnDisplaysInitialized() { 224 void TouchTransformerController::OnDisplaysInitialized() {
225 UpdateTouchTransformer(); 225 UpdateTouchTransformer();
226 } 226 }
227 227
228 void TouchTransformerController::OnDisplayConfigurationChanged() { 228 void TouchTransformerController::OnDisplayConfigurationChanged() {
229 UpdateTouchTransformer(); 229 UpdateTouchTransformer();
230 } 230 }
231 231
232 } // namespace ash 232 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/touch/touch_transformer_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698