| 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 5c11a35fd2b568fdae6cf75c3265344281b0456c..10afdd4340d9ff6cfd80c3706442db31e95dda33 100644
|
| --- a/ash/display/screen_orientation_controller_chromeos.cc
|
| +++ b/ash/display/screen_orientation_controller_chromeos.cc
|
| @@ -112,6 +112,16 @@ void ScreenOrientationController::UnlockOrientationForWindow(
|
| ApplyLockForActiveWindow();
|
| }
|
|
|
| +void ScreenOrientationController::UnlockAll() {
|
| + for (auto pair : locking_windows_)
|
| + pair.first->RemoveObserver(this);
|
| + locking_windows_.clear();
|
| + Shell::GetInstance()->activation_client()->RemoveObserver(this);
|
| + SetRotationLocked(false);
|
| + if (user_rotation_ != current_rotation_)
|
| + SetDisplayRotation(user_rotation_, display::Display::ROTATION_SOURCE_USER);
|
| +}
|
| +
|
| bool ScreenOrientationController::ScreenOrientationProviderSupported() const {
|
| return WmShell::Get()
|
| ->maximize_mode_controller()
|
| @@ -386,11 +396,13 @@ void ScreenOrientationController::LoadDisplayRotationProperties() {
|
| void ScreenOrientationController::ApplyLockForActiveWindow() {
|
| aura::Window* active_window =
|
| Shell::GetInstance()->activation_client()->GetActiveWindow();
|
| - for (auto const& windows : locking_windows_) {
|
| - if (windows.first->TargetVisibility() &&
|
| - active_window->Contains(windows.first)) {
|
| - LockRotationToOrientation(windows.second);
|
| - return;
|
| + if (active_window) {
|
| + for (auto const& windows : locking_windows_) {
|
| + if (windows.first->TargetVisibility() &&
|
| + active_window->Contains(windows.first)) {
|
| + LockRotationToOrientation(windows.second);
|
| + return;
|
| + }
|
| }
|
| }
|
| SetRotationLocked(false);
|
|
|