| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void ScreenOrientationController::SetDisplayRotation( | 145 void ScreenOrientationController::SetDisplayRotation( |
| 146 display::Display::Rotation rotation, | 146 display::Display::Rotation rotation, |
| 147 display::Display::RotationSource source) { | 147 display::Display::RotationSource source) { |
| 148 if (!display::Display::HasInternalDisplay()) | 148 if (!display::Display::HasInternalDisplay()) |
| 149 return; | 149 return; |
| 150 current_rotation_ = rotation; | 150 current_rotation_ = rotation; |
| 151 base::AutoReset<bool> auto_ignore_display_configuration_updates( | 151 base::AutoReset<bool> auto_ignore_display_configuration_updates( |
| 152 &ignore_display_configuration_updates_, true); | 152 &ignore_display_configuration_updates_, true); |
| 153 | 153 |
| 154 Shell::GetInstance()->display_configuration_controller()->SetDisplayRotation( | 154 Shell::GetInstance()->display_configuration_controller()->SetDisplayRotation( |
| 155 display::Display::InternalDisplayId(), rotation, source, | 155 display::Display::InternalDisplayId(), rotation, source); |
| 156 true /* user_action */); | |
| 157 } | 156 } |
| 158 | 157 |
| 159 void ScreenOrientationController::OnWindowActivated(WmWindow* gained_active, | 158 void ScreenOrientationController::OnWindowActivated(WmWindow* gained_active, |
| 160 WmWindow* lost_active) { | 159 WmWindow* lost_active) { |
| 161 ApplyLockForActiveWindow(); | 160 ApplyLockForActiveWindow(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 void ScreenOrientationController::OnWindowDestroying(aura::Window* window) { | 163 void ScreenOrientationController::OnWindowDestroying(aura::Window* window) { |
| 165 UnlockOrientationForWindow(WmWindow::Get(window)); | 164 UnlockOrientationForWindow(WmWindow::Get(window)); |
| 166 } | 165 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 419 } |
| 421 | 420 |
| 422 bool ScreenOrientationController::CanRotateInLockedState() { | 421 bool ScreenOrientationController::CanRotateInLockedState() { |
| 423 return rotation_locked_orientation_ == | 422 return rotation_locked_orientation_ == |
| 424 blink::WebScreenOrientationLockLandscape || | 423 blink::WebScreenOrientationLockLandscape || |
| 425 rotation_locked_orientation_ == | 424 rotation_locked_orientation_ == |
| 426 blink::WebScreenOrientationLockPortrait; | 425 blink::WebScreenOrientationLockPortrait; |
| 427 } | 426 } |
| 428 | 427 |
| 429 } // namespace ash | 428 } // namespace ash |
| OLD | NEW |