Chromium Code Reviews| Index: ash/display/screen_orientation_controller_chromeos.cc |
| diff --git a/ash/display/screen_orientation_controller_chromeos.cc b/ash/display/screen_orientation_controller_chromeos.cc |
| index 43663a511df5d730862a028d5aa661bddf537ebe..24b540ae70e881948474d5a9a419cc51c5f67f2e 100644 |
| --- a/ash/display/screen_orientation_controller_chromeos.cc |
| +++ b/ash/display/screen_orientation_controller_chromeos.cc |
| @@ -232,14 +232,13 @@ void ScreenOrientationController::ToggleUserRotationLock() { |
| .GetActiveRotation(); |
| user_locked_orientation_ = RotationToOrientation(current_rotation); |
| } |
| - base::AutoReset<bool> auto_ignore_display_configuration_updates( |
| - &ignore_display_configuration_updates_, true); |
| - Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties( |
| - user_rotation_locked(), OrientationToRotation(user_locked_orientation_)); |
| + SetLockToOrientation(user_locked_orientation_); |
| +} |
| - ApplyLockForActiveWindow(); |
| - for (auto& observer : observers_) |
| - observer.OnUserRotationLockChanged(); |
| +void ScreenOrientationController::SetLockToRotation( |
| + display::Display::Rotation rotation) { |
| + user_locked_orientation_ = RotationToOrientation(rotation); |
| + SetLockToOrientation(user_locked_orientation_); |
| } |
| void ScreenOrientationController::OnWindowActivated(ActivationReason reason, |
| @@ -357,6 +356,21 @@ void ScreenOrientationController::SetRotationLockedInternal( |
| rotation_locked_orientation_ = blink::WebScreenOrientationLockAny; |
| } |
| +void ScreenOrientationController::SetLockToOrientation( |
| + blink::WebScreenOrientationLockType orientation) { |
|
oshima
2017/03/30 04:46:00
this should be either
SetLockToOrientation(orient
|
| + if (!display::Display::HasInternalDisplay()) |
| + return; |
|
oshima
2017/03/30 04:46:00
you need to do this in SetLockToRotation if you up
|
| + |
| + base::AutoReset<bool> auto_ignore_display_configuration_updates( |
| + &ignore_display_configuration_updates_, true); |
| + Shell::GetInstance()->display_manager()->RegisterDisplayRotationProperties( |
| + user_rotation_locked(), OrientationToRotation(user_locked_orientation_)); |
| + |
| + ApplyLockForActiveWindow(); |
| + for (auto& observer : observers_) |
| + observer.OnUserRotationLockChanged(); |
| +} |
| + |
| void ScreenOrientationController::LockRotation( |
| display::Display::Rotation rotation, |
| display::Display::RotationSource source) { |