| 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 #ifndef ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 5 #ifndef ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
| 6 #define ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 6 #define ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 109 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
| 110 | 110 |
| 111 // chromeos::AccelerometerReader::Observer: | 111 // chromeos::AccelerometerReader::Observer: |
| 112 void OnAccelerometerUpdated( | 112 void OnAccelerometerUpdated( |
| 113 scoped_refptr<const chromeos::AccelerometerUpdate> update) override; | 113 scoped_refptr<const chromeos::AccelerometerUpdate> update) override; |
| 114 | 114 |
| 115 // WmDisplayObserver: | 115 // WmDisplayObserver: |
| 116 void OnDisplayConfigurationChanged() override; | 116 void OnDisplayConfigurationChanged() override; |
| 117 | 117 |
| 118 // ShellObserver: | 118 // ShellObserver: |
| 119 void OnMaximizeModeStarted() override; | 119 void OnTabletModeStarted() override; |
| 120 void OnMaximizeModeEnding() override; | 120 void OnTabletModeEnding() override; |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 friend class test::ScreenOrientationControllerTestApi; | 123 friend class test::ScreenOrientationControllerTestApi; |
| 124 | 124 |
| 125 struct LockInfo { | 125 struct LockInfo { |
| 126 LockInfo() {} | 126 LockInfo() {} |
| 127 LockInfo(blink::WebScreenOrientationLockType orientation, | 127 LockInfo(blink::WebScreenOrientationLockType orientation, |
| 128 LockCompletionBehavior lock_completion_behavior) | 128 LockCompletionBehavior lock_completion_behavior) |
| 129 : orientation(orientation), | 129 : orientation(orientation), |
| 130 lock_completion_behavior(lock_completion_behavior) {} | 130 lock_completion_behavior(lock_completion_behavior) {} |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // called, and for which these changes should be ignored. | 207 // called, and for which these changes should be ignored. |
| 208 bool ignore_display_configuration_updates_; | 208 bool ignore_display_configuration_updates_; |
| 209 | 209 |
| 210 // When true then accelerometer updates should not rotate the display. | 210 // When true then accelerometer updates should not rotate the display. |
| 211 bool rotation_locked_; | 211 bool rotation_locked_; |
| 212 | 212 |
| 213 // The orientation to which the current |rotation_locked_| was applied. | 213 // The orientation to which the current |rotation_locked_| was applied. |
| 214 blink::WebScreenOrientationLockType rotation_locked_orientation_; | 214 blink::WebScreenOrientationLockType rotation_locked_orientation_; |
| 215 | 215 |
| 216 // The rotation of the display set by the user. This rotation will be | 216 // The rotation of the display set by the user. This rotation will be |
| 217 // restored upon exiting maximize mode. | 217 // restored upon exiting tablet mode. |
| 218 display::Display::Rotation user_rotation_; | 218 display::Display::Rotation user_rotation_; |
| 219 | 219 |
| 220 // The orientation of the device locked by the user. | 220 // The orientation of the device locked by the user. |
| 221 blink::WebScreenOrientationLockType user_locked_orientation_ = | 221 blink::WebScreenOrientationLockType user_locked_orientation_ = |
| 222 blink::kWebScreenOrientationLockAny; | 222 blink::kWebScreenOrientationLockAny; |
| 223 | 223 |
| 224 // The current rotation set by ScreenOrientationController for the internal | 224 // The current rotation set by ScreenOrientationController for the internal |
| 225 // display. | 225 // display. |
| 226 display::Display::Rotation current_rotation_; | 226 display::Display::Rotation current_rotation_; |
| 227 | 227 |
| 228 // Rotation Lock observers. | 228 // Rotation Lock observers. |
| 229 base::ObserverList<Observer> observers_; | 229 base::ObserverList<Observer> observers_; |
| 230 | 230 |
| 231 // Tracks all windows that have requested a lock, as well as the requested | 231 // Tracks all windows that have requested a lock, as well as the requested |
| 232 // orientation. | 232 // orientation. |
| 233 std::unordered_map<aura::Window*, LockInfo> lock_info_map_; | 233 std::unordered_map<aura::Window*, LockInfo> lock_info_map_; |
| 234 | 234 |
| 235 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); | 235 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 } // namespace ash | 238 } // namespace ash |
| 239 | 239 |
| 240 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 240 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
| OLD | NEW |