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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class Observer { | 53 class Observer { |
54 public: | 54 public: |
55 // Invoked whenever |rotation_locked_| is changed. | 55 // Invoked whenever |rotation_locked_| is changed. |
56 virtual void OnRotationLockChanged(bool rotation_locked) {} | 56 virtual void OnRotationLockChanged(bool rotation_locked) {} |
57 | 57 |
58 protected: | 58 protected: |
59 virtual ~Observer() {} | 59 virtual ~Observer() {} |
60 }; | 60 }; |
61 | 61 |
62 MaximizeModeController(); | 62 MaximizeModeController(); |
63 virtual ~MaximizeModeController(); | 63 ~MaximizeModeController() override; |
64 | 64 |
65 bool ignore_display_configuration_updates() const { | 65 bool ignore_display_configuration_updates() const { |
66 return ignore_display_configuration_updates_; | 66 return ignore_display_configuration_updates_; |
67 } | 67 } |
68 | 68 |
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 } |
(...skipping 28 matching lines...) Expand all Loading... |
102 void AddWindow(aura::Window* window); | 102 void AddWindow(aura::Window* window); |
103 | 103 |
104 // TODO(jonross): move this into the destructor. Currently separated as | 104 // TODO(jonross): move this into the destructor. Currently separated as |
105 // ShellOberver notifies of maximize mode ending, and the observers end up | 105 // ShellOberver notifies of maximize mode ending, and the observers end up |
106 // attempting to access MaximizeModeController via the Shell. If done in | 106 // attempting to access MaximizeModeController via the Shell. If done in |
107 // destructor the controller is null, and the observers segfault. | 107 // destructor the controller is null, and the observers segfault. |
108 // Shuts down down the MaximizeModeWindowManager and notifies all observers. | 108 // Shuts down down the MaximizeModeWindowManager and notifies all observers. |
109 void Shutdown(); | 109 void Shutdown(); |
110 | 110 |
111 // AccelerometerObserver: | 111 // AccelerometerObserver: |
112 virtual void OnAccelerometerUpdated( | 112 void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override; |
113 const ui::AccelerometerUpdate& update) override; | |
114 | 113 |
115 // ShellObserver: | 114 // ShellObserver: |
116 virtual void OnAppTerminating() override; | 115 void OnAppTerminating() override; |
117 virtual void OnMaximizeModeStarted() override; | 116 void OnMaximizeModeStarted() override; |
118 virtual void OnMaximizeModeEnded() override; | 117 void OnMaximizeModeEnded() override; |
119 | 118 |
120 // DisplayController::Observer: | 119 // DisplayController::Observer: |
121 virtual void OnDisplayConfigurationChanged() override; | 120 void OnDisplayConfigurationChanged() override; |
122 | 121 |
123 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
124 // PowerManagerClient::Observer: | 123 // PowerManagerClient::Observer: |
125 virtual void LidEventReceived(bool open, | 124 virtual void LidEventReceived(bool open, |
126 const base::TimeTicks& time) override; | 125 const base::TimeTicks& time) override; |
127 virtual void SuspendImminent() override; | 126 virtual void SuspendImminent() override; |
128 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; | 127 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; |
129 #endif // OS_CHROMEOS | 128 #endif // OS_CHROMEOS |
130 | 129 |
131 private: | 130 private: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 219 |
221 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 220 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
222 bool lid_is_closed_; | 221 bool lid_is_closed_; |
223 | 222 |
224 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 223 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
225 }; | 224 }; |
226 | 225 |
227 } // namespace ash | 226 } // namespace ash |
228 | 227 |
229 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 228 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
OLD | NEW |