| 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/display/screen_orientation_controller_chromeos.h" | 5 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 8 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 for (auto pair : locking_windows_) | 113 for (auto pair : locking_windows_) |
| 114 pair.first->aura_window()->RemoveObserver(this); | 114 pair.first->aura_window()->RemoveObserver(this); |
| 115 locking_windows_.clear(); | 115 locking_windows_.clear(); |
| 116 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 116 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
| 117 SetRotationLocked(false); | 117 SetRotationLocked(false); |
| 118 if (user_rotation_ != current_rotation_) | 118 if (user_rotation_ != current_rotation_) |
| 119 SetDisplayRotation(user_rotation_, display::Display::ROTATION_SOURCE_USER); | 119 SetDisplayRotation(user_rotation_, display::Display::ROTATION_SOURCE_USER); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool ScreenOrientationController::ScreenOrientationProviderSupported() const { | 122 bool ScreenOrientationController::ScreenOrientationProviderSupported() const { |
| 123 return WmShell::Get() | 123 return Shell::Get() |
| 124 ->maximize_mode_controller() | 124 ->maximize_mode_controller() |
| 125 ->IsMaximizeModeWindowManagerEnabled() && | 125 ->IsMaximizeModeWindowManagerEnabled() && |
| 126 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 126 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 127 switches::kAshDisableScreenOrientationLock); | 127 switches::kAshDisableScreenOrientationLock); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ScreenOrientationController::SetRotationLocked(bool rotation_locked) { | 130 void ScreenOrientationController::SetRotationLocked(bool rotation_locked) { |
| 131 if (rotation_locked_ == rotation_locked) | 131 if (rotation_locked_ == rotation_locked) |
| 132 return; | 132 return; |
| 133 rotation_locked_ = rotation_locked; | 133 rotation_locked_ = rotation_locked; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool ScreenOrientationController::CanRotateInLockedState() { | 423 bool ScreenOrientationController::CanRotateInLockedState() { |
| 424 return rotation_locked_orientation_ == | 424 return rotation_locked_orientation_ == |
| 425 blink::WebScreenOrientationLockLandscape || | 425 blink::WebScreenOrientationLockLandscape || |
| 426 rotation_locked_orientation_ == | 426 rotation_locked_orientation_ == |
| 427 blink::WebScreenOrientationLockPortrait; | 427 blink::WebScreenOrientationLockPortrait; |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace ash | 430 } // namespace ash |
| OLD | NEW |