OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/display/display_change_observer_chromeos.h" | 5 #include "ash/display/display_change_observer_chromeos.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); | 248 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); |
249 | 249 |
250 // For the purposes of user activity detection, ignore synthetic mouse events | 250 // For the purposes of user activity detection, ignore synthetic mouse events |
251 // that are triggered by screen resizes: http://crbug.com/360634 | 251 // that are triggered by screen resizes: http://crbug.com/360634 |
252 ui::UserActivityDetector* user_activity_detector = | 252 ui::UserActivityDetector* user_activity_detector = |
253 ui::UserActivityDetector::Get(); | 253 ui::UserActivityDetector::Get(); |
254 if (user_activity_detector) | 254 if (user_activity_detector) |
255 user_activity_detector->OnDisplayPowerChanging(); | 255 user_activity_detector->OnDisplayPowerChanging(); |
256 } | 256 } |
257 | 257 |
| 258 void DisplayChangeObserver::OnDisplayModeChangeFailed( |
| 259 const ui::DisplayConfigurator::DisplayStateList& displays, |
| 260 ui::MultipleDisplayState failed_new_state) { |
| 261 // If display configuration failed during startup, simply update the display |
| 262 // manager with detected displays. If no display is detected, it will |
| 263 // create a pseudo display. |
| 264 if (Shell::GetInstance()->display_manager()->GetNumDisplays() == 0) |
| 265 OnDisplayModeChanged(displays); |
| 266 } |
| 267 |
258 void DisplayChangeObserver::OnAppTerminating() { | 268 void DisplayChangeObserver::OnAppTerminating() { |
259 #if defined(USE_ASH) | 269 #if defined(USE_ASH) |
260 // Stop handling display configuration events once the shutdown | 270 // Stop handling display configuration events once the shutdown |
261 // process starts. crbug.com/177014. | 271 // process starts. crbug.com/177014. |
262 Shell::GetInstance()->display_configurator()->PrepareForExit(); | 272 Shell::GetInstance()->display_configurator()->PrepareForExit(); |
263 #endif | 273 #endif |
264 } | 274 } |
265 | 275 |
266 // static | 276 // static |
267 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { | 277 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { |
(...skipping 12 matching lines...) Expand all Loading... |
280 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() { | 290 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() { |
281 } | 291 } |
282 | 292 |
283 void DisplayChangeObserver::OnMouseDeviceConfigurationChanged() { | 293 void DisplayChangeObserver::OnMouseDeviceConfigurationChanged() { |
284 } | 294 } |
285 | 295 |
286 void DisplayChangeObserver::OnTouchpadDeviceConfigurationChanged() { | 296 void DisplayChangeObserver::OnTouchpadDeviceConfigurationChanged() { |
287 } | 297 } |
288 | 298 |
289 } // namespace ash | 299 } // namespace ash |
OLD | NEW |