| 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_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/accelerometer/accelerometer_observer.h" | 8 #include "ash/accelerometer/accelerometer_observer.h" |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // True if |rotation_lock_| has been set, and OnAccelerometerUpdated will not | 69 // True if |rotation_lock_| has been set, and OnAccelerometerUpdated will not |
| 70 // change the display rotation. | 70 // change the display rotation. |
| 71 bool rotation_locked() { | 71 bool rotation_locked() { |
| 72 return rotation_locked_; | 72 return rotation_locked_; |
| 73 } | 73 } |
| 74 | 74 |
| 75 // If |rotation_locked| future calls to OnAccelerometerUpdated will not | 75 // If |rotation_locked| future calls to OnAccelerometerUpdated will not |
| 76 // change the display rotation. | 76 // change the display rotation. |
| 77 void SetRotationLocked(bool rotation_locked); | 77 void SetRotationLocked(bool rotation_locked); |
| 78 | 78 |
| 79 // Sets the display rotation to |rotation| and prevents future calls to |
| 80 // OnAccelerometerUpdated from changing the rotation. SetRotationLocked(false) |
| 81 // removes the rotation lock. |
| 82 void LockRotation(gfx::Display::Rotation rotation); |
| 83 |
| 79 // Add/Remove observers. | 84 // Add/Remove observers. |
| 80 void AddObserver(Observer* observer); | 85 void AddObserver(Observer* observer); |
| 81 void RemoveObserver(Observer* observer); | 86 void RemoveObserver(Observer* observer); |
| 82 | 87 |
| 83 // True if it is possible to enter maximize mode in the current | 88 // True if it is possible to enter maximize mode in the current |
| 84 // configuration. If this returns false, it should never be the case that | 89 // configuration. If this returns false, it should never be the case that |
| 85 // maximize mode becomes enabled. | 90 // maximize mode becomes enabled. |
| 86 bool CanEnterMaximizeMode(); | 91 bool CanEnterMaximizeMode(); |
| 87 | 92 |
| 88 // TODO(jonross): Merge this with EnterMaximizeMode. Currently these are | 93 // TODO(jonross): Merge this with EnterMaximizeMode. Currently these are |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 222 |
| 218 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 223 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
| 219 bool lid_is_closed_; | 224 bool lid_is_closed_; |
| 220 | 225 |
| 221 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 226 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 222 }; | 227 }; |
| 223 | 228 |
| 224 } // namespace ash | 229 } // namespace ash |
| 225 | 230 |
| 226 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 231 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |