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_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 5 #ifndef ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
6 #define ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 6 #define ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 // True if |rotation_lock_| has been set and accelerometer updates should not | 64 // True if |rotation_lock_| has been set and accelerometer updates should not |
65 // rotate the display. | 65 // rotate the display. |
66 bool rotation_locked() const { return rotation_locked_; } | 66 bool rotation_locked() const { return rotation_locked_; } |
67 | 67 |
68 // If |rotation_locked| future accelerometer updates should not change the | 68 // If |rotation_locked| future accelerometer updates should not change the |
69 // display rotation. | 69 // display rotation. |
70 void SetRotationLocked(bool rotation_locked); | 70 void SetRotationLocked(bool rotation_locked); |
71 | 71 |
72 // Sets the display rotation for the given |source|. The new |rotation| will | 72 // Sets the display rotation and suppresses display notifications. |
73 // also become active. Display changed notifications are surpressed for this | 73 void SetDisplayRotation(gfx::Display::Rotation rotation); |
74 // change. | |
75 void SetDisplayRotation(gfx::Display::Rotation rotation, | |
76 gfx::Display::RotationSource source); | |
77 | 74 |
78 // aura::client::ActivationChangeObserver: | 75 // aura::client::ActivationChangeObserver: |
79 void OnWindowActivated(aura::Window* gained_active, | 76 void OnWindowActivated(aura::Window* gained_active, |
80 aura::Window* lost_active) override; | 77 aura::Window* lost_active) override; |
81 | 78 |
82 // aura::WindowObserver: | 79 // aura::WindowObserver: |
83 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 80 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
84 void OnWindowDestroying(aura::Window* window) override; | 81 void OnWindowDestroying(aura::Window* window) override; |
85 | 82 |
86 // chromeos::AccelerometerReader::Observer: | 83 // chromeos::AccelerometerReader::Observer: |
(...skipping 11 matching lines...) Expand all Loading... |
98 void OnDisplayConfigurationChanged() override; | 95 void OnDisplayConfigurationChanged() override; |
99 | 96 |
100 // ShellObserver: | 97 // ShellObserver: |
101 void OnMaximizeModeStarted() override; | 98 void OnMaximizeModeStarted() override; |
102 void OnMaximizeModeEnded() override; | 99 void OnMaximizeModeEnded() override; |
103 | 100 |
104 private: | 101 private: |
105 // Sets the display rotation to |rotation|. Future accelerometer updates | 102 // Sets the display rotation to |rotation|. Future accelerometer updates |
106 // should not be used to change the rotation. SetRotationLocked(false) removes | 103 // should not be used to change the rotation. SetRotationLocked(false) removes |
107 // the rotation lock. | 104 // the rotation lock. |
108 void LockRotation(gfx::Display::Rotation rotation, | 105 void LockRotation(gfx::Display::Rotation rotation); |
109 gfx::Display::RotationSource source); | |
110 | 106 |
111 // Sets the display rotation based on |lock_orientation|. Future accelerometer | 107 // Sets the display rotation based on |lock_orientation|. Future accelerometer |
112 // updates should not be used to change the rotation. SetRotationLocked(false) | 108 // updates should not be used to change the rotation. SetRotationLocked(false) |
113 // removes the rotation lock. | 109 // removes the rotation lock. |
114 void LockRotationToOrientation( | 110 void LockRotationToOrientation( |
115 blink::WebScreenOrientationLockType lock_orientation); | 111 blink::WebScreenOrientationLockType lock_orientation); |
116 | 112 |
117 // Locks rotation to the angle matching the primary orientation for | 113 // Locks rotation to the angle matching the primary orientation for |
118 // |lock_orientation|. | 114 // |lock_orientation|. |
119 void LockRotationToPrimaryOrientation( | 115 void LockRotationToPrimaryOrientation( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Tracks all windows that have requested a lock, as well as the requested | 180 // Tracks all windows that have requested a lock, as well as the requested |
185 // orientation. | 181 // orientation. |
186 std::map<aura::Window*, blink::WebScreenOrientationLockType> locking_windows_; | 182 std::map<aura::Window*, blink::WebScreenOrientationLockType> locking_windows_; |
187 | 183 |
188 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); | 184 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); |
189 }; | 185 }; |
190 | 186 |
191 } // namespace ash | 187 } // namespace ash |
192 | 188 |
193 #endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ | 189 #endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ |
OLD | NEW |