Chromium Code Reviews| Index: ash/content/display/screen_orientation_controller_chromeos.cc |
| diff --git a/ash/content/display/screen_orientation_controller_chromeos.cc b/ash/content/display/screen_orientation_controller_chromeos.cc |
| index 07659d7c131d282c85a13f8f4a985b153b72b28b..2083aa98c056c11eb509cd8fc51d610e175ef363 100644 |
| --- a/ash/content/display/screen_orientation_controller_chromeos.cc |
| +++ b/ash/content/display/screen_orientation_controller_chromeos.cc |
| @@ -196,10 +196,11 @@ void ScreenOrientationController::Unlock(content::WebContents* web_contents) { |
| void ScreenOrientationController::OnDisplayConfigurationChanged() { |
| if (ignore_display_configuration_updates_) |
| return; |
| + DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| + if (!display_manager->HasInternalDisplay()) |
| + return; |
| gfx::Display::Rotation user_rotation = |
| - Shell::GetInstance() |
| - ->display_manager() |
| - ->GetDisplayInfo(gfx::Display::InternalDisplayId()) |
| + display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId()) |
| .rotation(); |
| if (user_rotation != current_rotation_) { |
| // A user may change other display configuration settings. When the user |
| @@ -212,11 +213,13 @@ void ScreenOrientationController::OnDisplayConfigurationChanged() { |
| void ScreenOrientationController::OnMaximizeModeStarted() { |
| DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| - if (!display_manager->HasInternalDisplay()) |
| - return; |
| - current_rotation_ = user_rotation_ = |
| - display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId()) |
| - .rotation(); |
| + // Do not exit early, as the internal display can be determined after Maximize |
| + // Mode has started. Always start observing. |
|
oshima
2015/04/15 18:47:47
Can you add reference to EDID bug?
|
| + if (display_manager->HasInternalDisplay()) { |
| + current_rotation_ = user_rotation_ = |
| + display_manager->GetDisplayInfo(gfx::Display::InternalDisplayId()) |
| + .rotation(); |
| + } |
| if (!rotation_locked_) |
| LoadDisplayRotationProperties(); |
| chromeos::AccelerometerReader::GetInstance()->AddObserver(this); |
| @@ -224,8 +227,6 @@ void ScreenOrientationController::OnMaximizeModeStarted() { |
| } |
| void ScreenOrientationController::OnMaximizeModeEnded() { |
| - if (!Shell::GetInstance()->display_manager()->HasInternalDisplay()) |
| - return; |
| chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); |
| Shell::GetInstance()->display_controller()->RemoveObserver(this); |
| if (current_rotation_ != user_rotation_) |