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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 ScreenOrientationController::ScreenOrientationController() | 64 ScreenOrientationController::ScreenOrientationController() |
65 : natural_orientation_(GetDisplayNaturalOrientation()), | 65 : natural_orientation_(GetDisplayNaturalOrientation()), |
66 ignore_display_configuration_updates_(false), | 66 ignore_display_configuration_updates_(false), |
67 rotation_locked_(false), | 67 rotation_locked_(false), |
68 rotation_locked_orientation_(blink::WebScreenOrientationLockAny), | 68 rotation_locked_orientation_(blink::WebScreenOrientationLockAny), |
69 user_rotation_(display::Display::ROTATE_0), | 69 user_rotation_(display::Display::ROTATE_0), |
70 current_rotation_(display::Display::ROTATE_0) { | 70 current_rotation_(display::Display::ROTATE_0) { |
71 WmShell::Get()->AddShellObserver(this); | 71 Shell::GetInstance()->AddShellObserver(this); |
72 } | 72 } |
73 | 73 |
74 ScreenOrientationController::~ScreenOrientationController() { | 74 ScreenOrientationController::~ScreenOrientationController() { |
75 WmShell::Get()->RemoveShellObserver(this); | 75 Shell::GetInstance()->RemoveShellObserver(this); |
76 chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); | 76 chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); |
77 WmShell::Get()->RemoveDisplayObserver(this); | 77 WmShell::Get()->RemoveDisplayObserver(this); |
78 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 78 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
79 for (auto& windows : locking_windows_) | 79 for (auto& windows : locking_windows_) |
80 windows.first->aura_window()->RemoveObserver(this); | 80 windows.first->aura_window()->RemoveObserver(this); |
81 } | 81 } |
82 | 82 |
83 void ScreenOrientationController::AddObserver(Observer* observer) { | 83 void ScreenOrientationController::AddObserver(Observer* observer) { |
84 observers_.AddObserver(observer); | 84 observers_.AddObserver(observer); |
85 } | 85 } |
(...skipping 335 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 |