| 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 "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 private: | 41 private: |
| 42 // Detect hinge rotation from |base| and |lid| accelerometers and | 42 // Detect hinge rotation from |base| and |lid| accelerometers and |
| 43 // automatically start / stop maximize mode. | 43 // automatically start / stop maximize mode. |
| 44 void HandleHingeRotation(const gfx::Vector3dF& base, | 44 void HandleHingeRotation(const gfx::Vector3dF& base, |
| 45 const gfx::Vector3dF& lid); | 45 const gfx::Vector3dF& lid); |
| 46 | 46 |
| 47 // Detect screen rotation from |lid| accelerometer and automatically rotate | 47 // Detect screen rotation from |lid| accelerometer and automatically rotate |
| 48 // screen. | 48 // screen. |
| 49 void HandleScreenRotation(const gfx::Vector3dF& lid); | 49 void HandleScreenRotation(const gfx::Vector3dF& lid); |
| 50 | 50 |
| 51 // Enables MaximizeModeWindowManager, and determines the current state of | |
| 52 // rotation lock. | |
| 53 void EnterMaximizeMode(); | |
| 54 | |
| 55 // Removes MaximizeModeWindowManager and resets the display rotation if there | |
| 56 // is no rotation lock. | |
| 57 void LeaveMaximizeMode(); | |
| 58 | |
| 59 // An event handler which traps mouse and keyboard events while maximize | 51 // An event handler which traps mouse and keyboard events while maximize |
| 60 // mode is engaged. | 52 // mode is engaged. |
| 61 scoped_ptr<MaximizeModeEventBlocker> event_blocker_; | 53 scoped_ptr<MaximizeModeEventBlocker> event_blocker_; |
| 62 | 54 |
| 63 // When true calls to OnAccelerometerUpdated will not rotate the display. | 55 // When true calls to OnAccelerometerUpdated will not rotate the display. |
| 64 bool rotation_locked_; | 56 bool rotation_locked_; |
| 65 | 57 |
| 66 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 58 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 67 }; | 59 }; |
| 68 | 60 |
| 69 } // namespace ash | 61 } // namespace ash |
| 70 | 62 |
| 71 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 63 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |