| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; | 128 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 129 #endif // OS_CHROMEOS | 129 #endif // OS_CHROMEOS |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 friend class MaximizeModeControllerTest; | 132 friend class MaximizeModeControllerTest; |
| 133 friend class MaximizeModeWindowManagerTest; | 133 friend class MaximizeModeWindowManagerTest; |
| 134 friend class test::MultiUserWindowManagerChromeOSTest; | 134 friend class test::MultiUserWindowManagerChromeOSTest; |
| 135 | 135 |
| 136 // Set the TickClock. This is only to be used by tests that need to | 136 // Set the TickClock. This is only to be used by tests that need to |
| 137 // artificially and deterministically control the current time. | 137 // artificially and deterministically control the current time. |
| 138 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); | 138 void SetTickClockForTest(const scoped_refptr<base::TickClock>& tick_clock); |
| 139 | 139 |
| 140 // Detect hinge rotation from |base| and |lid| accelerometers and | 140 // Detect hinge rotation from |base| and |lid| accelerometers and |
| 141 // automatically start / stop maximize mode. | 141 // automatically start / stop maximize mode. |
| 142 void HandleHingeRotation(const gfx::Vector3dF& base, | 142 void HandleHingeRotation(const gfx::Vector3dF& base, |
| 143 const gfx::Vector3dF& lid); | 143 const gfx::Vector3dF& lid); |
| 144 | 144 |
| 145 // Detect screen rotation from |lid| accelerometer and automatically rotate | 145 // Detect screen rotation from |lid| accelerometer and automatically rotate |
| 146 // screen. | 146 // screen. |
| 147 void HandleScreenRotation(const gfx::Vector3dF& lid); | 147 void HandleScreenRotation(const gfx::Vector3dF& lid); |
| 148 | 148 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 base::Time last_touchview_transition_time_; | 206 base::Time last_touchview_transition_time_; |
| 207 base::TimeDelta total_touchview_time_; | 207 base::TimeDelta total_touchview_time_; |
| 208 base::TimeDelta total_non_touchview_time_; | 208 base::TimeDelta total_non_touchview_time_; |
| 209 | 209 |
| 210 // Tracks the last time we received a lid open event. This is used to suppress | 210 // Tracks the last time we received a lid open event. This is used to suppress |
| 211 // erroneous accelerometer readings as the lid is opened but the accelerometer | 211 // erroneous accelerometer readings as the lid is opened but the accelerometer |
| 212 // reports readings that make the lid to appear near fully open. | 212 // reports readings that make the lid to appear near fully open. |
| 213 base::TimeTicks last_lid_open_time_; | 213 base::TimeTicks last_lid_open_time_; |
| 214 | 214 |
| 215 // Source for the current time in base::TimeTicks. | 215 // Source for the current time in base::TimeTicks. |
| 216 scoped_ptr<base::TickClock> tick_clock_; | 216 scoped_refptr<base::TickClock> tick_clock_; |
| 217 | 217 |
| 218 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 218 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
| 219 bool lid_is_closed_; | 219 bool lid_is_closed_; |
| 220 | 220 |
| 221 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 221 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 } // namespace ash | 224 } // namespace ash |
| 225 | 225 |
| 226 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 226 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |