| OLD | NEW |
| 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" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
| 13 #include "ui/display/chromeos/display_configurator.h" | 13 #include "ui/display/chromeos/display_configurator.h" |
| 14 #include "ui/display/manager/display_layout.h" |
| 14 #include "ui/display/types/display_snapshot.h" | 15 #include "ui/display/types/display_snapshot.h" |
| 15 #include "ui/events/devices/device_data_manager.h" | 16 #include "ui/events/devices/device_data_manager.h" |
| 16 | 17 |
| 17 namespace ash { | 18 namespace ash { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 DisplayManager* GetDisplayManager() { | 22 DisplayManager* GetDisplayManager() { |
| 22 return Shell::GetInstance()->display_manager(); | 23 return Shell::GetInstance()->display_manager(); |
| 23 } | 24 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 DisplayManager* display_manager = GetDisplayManager(); | 168 DisplayManager* display_manager = GetDisplayManager(); |
| 168 if (display_manager->num_connected_displays() == 0) { | 169 if (display_manager->num_connected_displays() == 0) { |
| 169 return; | 170 return; |
| 170 } else if (display_manager->num_connected_displays() == 1 || | 171 } else if (display_manager->num_connected_displays() == 1 || |
| 171 display_manager->IsInUnifiedMode()) { | 172 display_manager->IsInUnifiedMode()) { |
| 172 single_display_id = display_manager->first_display_id(); | 173 single_display_id = display_manager->first_display_id(); |
| 173 DCHECK(single_display_id != gfx::Display::kInvalidDisplayID); | 174 DCHECK(single_display_id != gfx::Display::kInvalidDisplayID); |
| 174 single_display = display_manager->GetDisplayInfo(single_display_id); | 175 single_display = display_manager->GetDisplayInfo(single_display_id); |
| 175 UpdateTouchRadius(single_display); | 176 UpdateTouchRadius(single_display); |
| 176 } else { | 177 } else { |
| 177 DisplayIdList list = display_manager->GetCurrentDisplayIdList(); | 178 display::DisplayIdList list = display_manager->GetCurrentDisplayIdList(); |
| 178 display1_id = list[0]; | 179 display1_id = list[0]; |
| 179 display2_id = list[1]; | 180 display2_id = list[1]; |
| 180 DCHECK(display1_id != gfx::Display::kInvalidDisplayID && | 181 DCHECK(display1_id != gfx::Display::kInvalidDisplayID && |
| 181 display2_id != gfx::Display::kInvalidDisplayID); | 182 display2_id != gfx::Display::kInvalidDisplayID); |
| 182 display1 = display_manager->GetDisplayInfo(display1_id); | 183 display1 = display_manager->GetDisplayInfo(display1_id); |
| 183 display2 = display_manager->GetDisplayInfo(display2_id); | 184 display2 = display_manager->GetDisplayInfo(display2_id); |
| 184 UpdateTouchRadius(display1); | 185 UpdateTouchRadius(display1); |
| 185 UpdateTouchRadius(display2); | 186 UpdateTouchRadius(display2); |
| 186 } | 187 } |
| 187 | 188 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 223 |
| 223 void TouchTransformerController::OnDisplaysInitialized() { | 224 void TouchTransformerController::OnDisplaysInitialized() { |
| 224 UpdateTouchTransformer(); | 225 UpdateTouchTransformer(); |
| 225 } | 226 } |
| 226 | 227 |
| 227 void TouchTransformerController::OnDisplayConfigurationChanged() { | 228 void TouchTransformerController::OnDisplayConfigurationChanged() { |
| 228 UpdateTouchTransformer(); | 229 UpdateTouchTransformer(); |
| 229 } | 230 } |
| 230 | 231 |
| 231 } // namespace ash | 232 } // namespace ash |
| OLD | NEW |