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

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

Issue 2445583002: Relocate display_manager from ash to ui (Closed)
Patch Set: fix windows build Created 4 years, 1 month 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 | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/touch/touchscreen_util_unittest.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 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"
8 #include "ash/display/window_tree_host_manager.h" 7 #include "ash/display/window_tree_host_manager.h"
9 #include "ash/host/ash_window_tree_host.h" 8 #include "ash/host/ash_window_tree_host.h"
10 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
11 #include "ash/shell.h" 10 #include "ash/shell.h"
12 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
13 #include "ui/display/chromeos/display_configurator.h" 12 #include "ui/display/chromeos/display_configurator.h"
14 #include "ui/display/manager/display_layout.h" 13 #include "ui/display/manager/display_layout.h"
14 #include "ui/display/manager/display_manager.h"
15 #include "ui/display/types/display_snapshot.h" 15 #include "ui/display/types/display_snapshot.h"
16 #include "ui/events/devices/device_data_manager.h" 16 #include "ui/events/devices/device_data_manager.h"
17 17
18 namespace ash { 18 namespace ash {
19 19
20 namespace { 20 namespace {
21 21
22 DisplayManager* GetDisplayManager() { 22 display::DisplayManager* GetDisplayManager() {
23 return Shell::GetInstance()->display_manager(); 23 return Shell::GetInstance()->display_manager();
24 } 24 }
25 25
26 ui::TouchscreenDevice FindTouchscreenById(int id) { 26 ui::TouchscreenDevice FindTouchscreenById(int id) {
27 const std::vector<ui::TouchscreenDevice>& touchscreens = 27 const std::vector<ui::TouchscreenDevice>& touchscreens =
28 ui::DeviceDataManager::GetInstance()->GetTouchscreenDevices(); 28 ui::DeviceDataManager::GetInstance()->GetTouchscreenDevices();
29 for (const auto& touchscreen : touchscreens) { 29 for (const auto& touchscreen : touchscreens) {
30 if (touchscreen.id == id) 30 if (touchscreen.id == id)
31 return touchscreen; 31 return touchscreen;
32 } 32 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 int64_t display1_id = display::Display::kInvalidDisplayID; 157 int64_t display1_id = display::Display::kInvalidDisplayID;
158 int64_t display2_id = display::Display::kInvalidDisplayID; 158 int64_t display2_id = display::Display::kInvalidDisplayID;
159 display::ManagedDisplayInfo display1; 159 display::ManagedDisplayInfo display1;
160 display::ManagedDisplayInfo display2; 160 display::ManagedDisplayInfo display2;
161 // Display ID and display::ManagedDisplayInfo for single display mode. 161 // Display ID and display::ManagedDisplayInfo for single display mode.
162 int64_t single_display_id = display::Display::kInvalidDisplayID; 162 int64_t single_display_id = display::Display::kInvalidDisplayID;
163 display::ManagedDisplayInfo single_display; 163 display::ManagedDisplayInfo single_display;
164 164
165 WindowTreeHostManager* window_tree_host_manager = 165 WindowTreeHostManager* window_tree_host_manager =
166 Shell::GetInstance()->window_tree_host_manager(); 166 Shell::GetInstance()->window_tree_host_manager();
167 DisplayManager* display_manager = GetDisplayManager(); 167 display::DisplayManager* display_manager = GetDisplayManager();
168 if (display_manager->num_connected_displays() == 0) { 168 if (display_manager->num_connected_displays() == 0) {
169 return; 169 return;
170 } else if (display_manager->num_connected_displays() == 1 || 170 } else if (display_manager->num_connected_displays() == 1 ||
171 display_manager->IsInUnifiedMode()) { 171 display_manager->IsInUnifiedMode()) {
172 single_display_id = display_manager->first_display_id(); 172 single_display_id = display_manager->first_display_id();
173 DCHECK(single_display_id != display::Display::kInvalidDisplayID); 173 DCHECK(single_display_id != display::Display::kInvalidDisplayID);
174 single_display = display_manager->GetDisplayInfo(single_display_id); 174 single_display = display_manager->GetDisplayInfo(single_display_id);
175 UpdateTouchRadius(single_display); 175 UpdateTouchRadius(single_display);
176 } else { 176 } else {
177 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); 177 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 void TouchTransformerController::OnDisplaysInitialized() { 220 void TouchTransformerController::OnDisplaysInitialized() {
221 UpdateTouchTransformer(); 221 UpdateTouchTransformer();
222 } 222 }
223 223
224 void TouchTransformerController::OnDisplayConfigurationChanged() { 224 void TouchTransformerController::OnDisplayConfigurationChanged() {
225 UpdateTouchTransformer(); 225 UpdateTouchTransformer();
226 } 226 }
227 227
228 } // namespace ash 228 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/touch/touchscreen_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698