| 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/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace ash { | 30 namespace ash { |
| 31 | 31 |
| 32 class MaximizeModeControllerTest; | 32 class MaximizeModeControllerTest; |
| 33 class ScopedDisableInternalMouseAndKeyboard; | 33 class ScopedDisableInternalMouseAndKeyboard; |
| 34 class MaximizeModeWindowManager; | 34 class MaximizeModeWindowManager; |
| 35 class MaximizeModeWindowManagerTest; | 35 class MaximizeModeWindowManagerTest; |
| 36 namespace test { | 36 namespace test { |
| 37 class MultiUserWindowManagerChromeOSTest; | 37 class MultiUserWindowManagerChromeOSTest; |
| 38 class VirtualKeyboardControllerTest; |
| 38 } | 39 } |
| 39 | 40 |
| 40 // MaximizeModeController listens to accelerometer events and automatically | 41 // MaximizeModeController listens to accelerometer events and automatically |
| 41 // enters and exits maximize mode when the lid is opened beyond the triggering | 42 // enters and exits maximize mode when the lid is opened beyond the triggering |
| 42 // angle and rotates the display to match the device when in maximize mode. | 43 // angle and rotates the display to match the device when in maximize mode. |
| 43 class ASH_EXPORT MaximizeModeController | 44 class ASH_EXPORT MaximizeModeController |
| 44 : public ShellObserver, | 45 : public ShellObserver, |
| 45 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| 46 public chromeos::AccelerometerReader::Observer, | 47 public chromeos::AccelerometerReader::Observer, |
| 47 public chromeos::PowerManagerClient::Observer, | 48 public chromeos::PowerManagerClient::Observer, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // PowerManagerClient::Observer: | 129 // PowerManagerClient::Observer: |
| 129 void LidEventReceived(bool open, const base::TimeTicks& time) override; | 130 void LidEventReceived(bool open, const base::TimeTicks& time) override; |
| 130 void SuspendImminent() override; | 131 void SuspendImminent() override; |
| 131 void SuspendDone(const base::TimeDelta& sleep_duration) override; | 132 void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 132 #endif // OS_CHROMEOS | 133 #endif // OS_CHROMEOS |
| 133 | 134 |
| 134 private: | 135 private: |
| 135 friend class MaximizeModeControllerTest; | 136 friend class MaximizeModeControllerTest; |
| 136 friend class MaximizeModeWindowManagerTest; | 137 friend class MaximizeModeWindowManagerTest; |
| 137 friend class test::MultiUserWindowManagerChromeOSTest; | 138 friend class test::MultiUserWindowManagerChromeOSTest; |
| 139 friend class test::VirtualKeyboardControllerTest; |
| 138 | 140 |
| 139 // Set the TickClock. This is only to be used by tests that need to | 141 // Set the TickClock. This is only to be used by tests that need to |
| 140 // artificially and deterministically control the current time. | 142 // artificially and deterministically control the current time. |
| 141 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); | 143 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); |
| 142 | 144 |
| 143 // Detect hinge rotation from |base| and |lid| accelerometers and | 145 // Detect hinge rotation from |base| and |lid| accelerometers and |
| 144 // automatically start / stop maximize mode. | 146 // automatically start / stop maximize mode. |
| 145 void HandleHingeRotation(const gfx::Vector3dF& base, | 147 void HandleHingeRotation(const gfx::Vector3dF& base, |
| 146 const gfx::Vector3dF& lid); | 148 const gfx::Vector3dF& lid); |
| 147 | 149 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 225 |
| 224 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 226 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
| 225 bool lid_is_closed_; | 227 bool lid_is_closed_; |
| 226 | 228 |
| 227 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 229 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 } // namespace ash | 232 } // namespace ash |
| 231 | 233 |
| 232 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 234 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |