| 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_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 DisplayInfo display2; | 135 DisplayInfo display2; |
| 136 // Display ID and DisplayInfo for single display mode. | 136 // Display ID and DisplayInfo for single display mode. |
| 137 int64 single_display_id = gfx::Display::kInvalidDisplayID; | 137 int64 single_display_id = gfx::Display::kInvalidDisplayID; |
| 138 DisplayInfo single_display; | 138 DisplayInfo single_display; |
| 139 | 139 |
| 140 DisplayController* display_controller = | 140 DisplayController* display_controller = |
| 141 Shell::GetInstance()->display_controller(); | 141 Shell::GetInstance()->display_controller(); |
| 142 DisplayManager* display_manager = GetDisplayManager(); | 142 DisplayManager* display_manager = GetDisplayManager(); |
| 143 if (display_manager->num_connected_displays() == 0) { | 143 if (display_manager->num_connected_displays() == 0) { |
| 144 return; | 144 return; |
| 145 } else if (display_manager->num_connected_displays() == 1) { | 145 } else if (display_manager->num_connected_displays() == 1 || |
| 146 display_manager->multi_display_mode() == DisplayManager::UNIFIED) { |
| 146 single_display_id = display_manager->first_display_id(); | 147 single_display_id = display_manager->first_display_id(); |
| 147 DCHECK(single_display_id != gfx::Display::kInvalidDisplayID); | 148 DCHECK(single_display_id != gfx::Display::kInvalidDisplayID); |
| 148 single_display = display_manager->GetDisplayInfo(single_display_id); | 149 single_display = display_manager->GetDisplayInfo(single_display_id); |
| 149 device_manager->UpdateTouchRadiusScale( | 150 device_manager->UpdateTouchRadiusScale( |
| 150 single_display.touch_device_id(), | 151 single_display.touch_device_id(), |
| 151 GetTouchResolutionScale( | 152 GetTouchResolutionScale( |
| 152 single_display, | 153 single_display, |
| 153 FindTouchscreenById(single_display.touch_device_id()))); | 154 FindTouchscreenById(single_display.touch_device_id()))); |
| 154 } else { | 155 } else { |
| 155 DisplayIdPair id_pair = display_manager->GetCurrentDisplayIdPair(); | 156 DisplayIdPair id_pair = display_manager->GetCurrentDisplayIdPair(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 237 |
| 237 void TouchTransformerController::OnDisplaysInitialized() { | 238 void TouchTransformerController::OnDisplaysInitialized() { |
| 238 UpdateTouchTransformer(); | 239 UpdateTouchTransformer(); |
| 239 } | 240 } |
| 240 | 241 |
| 241 void TouchTransformerController::OnDisplayConfigurationChanged() { | 242 void TouchTransformerController::OnDisplayConfigurationChanged() { |
| 242 UpdateTouchTransformer(); | 243 UpdateTouchTransformer(); |
| 243 } | 244 } |
| 244 | 245 |
| 245 } // namespace ash | 246 } // namespace ash |
| OLD | NEW |