Chromium Code Reviews| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 void Shutdown(); | 114 void Shutdown(); |
| 115 | 115 |
| 116 // ShellObserver: | 116 // ShellObserver: |
| 117 void OnAppTerminating() override; | 117 void OnAppTerminating() override; |
| 118 void OnMaximizeModeStarted() override; | 118 void OnMaximizeModeStarted() override; |
| 119 void OnMaximizeModeEnded() override; | 119 void OnMaximizeModeEnded() override; |
| 120 | 120 |
| 121 // DisplayController::Observer: | 121 // DisplayController::Observer: |
| 122 void OnDisplayConfigurationChanged() override; | 122 void OnDisplayConfigurationChanged() override; |
| 123 | 123 |
| 124 // Set the event blocker for testing. | |
| 125 void InstallEventBlockerForTest( | |
| 126 scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker); | |
| 127 | |
| 124 #if defined(OS_CHROMEOS) | 128 #if defined(OS_CHROMEOS) |
| 125 // chromeos::AccelerometerReader::Observer: | 129 // chromeos::AccelerometerReader::Observer: |
| 126 void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override; | 130 void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override; |
| 127 | 131 |
| 128 // PowerManagerClient::Observer: | 132 // PowerManagerClient::Observer: |
| 129 void LidEventReceived(bool open, const base::TimeTicks& time) override; | 133 void LidEventReceived(bool open, const base::TimeTicks& time) override; |
| 130 void SuspendImminent() override; | 134 void SuspendImminent() override; |
| 131 void SuspendDone(const base::TimeDelta& sleep_duration) override; | 135 void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 132 #endif // OS_CHROMEOS | 136 #endif // OS_CHROMEOS |
| 133 | 137 |
| 134 private: | 138 private: |
| 135 friend class MaximizeModeControllerTest; | 139 friend class MaximizeModeControllerTest; |
|
sky
2015/01/06 22:34:04
Friend your test so you don't have to expose a met
rsadam
2015/01/06 23:18:41
Done.
| |
| 136 friend class MaximizeModeWindowManagerTest; | 140 friend class MaximizeModeWindowManagerTest; |
| 137 friend class test::MultiUserWindowManagerChromeOSTest; | 141 friend class test::MultiUserWindowManagerChromeOSTest; |
| 138 | 142 |
| 139 // Set the TickClock. This is only to be used by tests that need to | 143 // Set the TickClock. This is only to be used by tests that need to |
| 140 // artificially and deterministically control the current time. | 144 // artificially and deterministically control the current time. |
| 141 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); | 145 void SetTickClockForTest(scoped_ptr<base::TickClock> tick_clock); |
| 142 | 146 |
| 143 // Detect hinge rotation from |base| and |lid| accelerometers and | 147 // Detect hinge rotation from |base| and |lid| accelerometers and |
| 144 // automatically start / stop maximize mode. | 148 // automatically start / stop maximize mode. |
| 145 void HandleHingeRotation(const gfx::Vector3dF& base, | 149 void HandleHingeRotation(const gfx::Vector3dF& base, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 | 227 |
| 224 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 228 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
| 225 bool lid_is_closed_; | 229 bool lid_is_closed_; |
| 226 | 230 |
| 227 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 231 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 228 }; | 232 }; |
| 229 | 233 |
| 230 } // namespace ash | 234 } // namespace ash |
| 231 | 235 |
| 232 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 236 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |