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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 // WindowTreeHostManager::Observer: | 86 // WindowTreeHostManager::Observer: |
| 87 void OnDisplayConfigurationChanged() override; | 87 void OnDisplayConfigurationChanged() override; |
| 88 | 88 |
| 89 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
| 90 // chromeos::AccelerometerReader::Observer: | 90 // chromeos::AccelerometerReader::Observer: |
| 91 void OnAccelerometerUpdated( | 91 void OnAccelerometerUpdated( |
| 92 scoped_refptr<const chromeos::AccelerometerUpdate> update) override; | 92 scoped_refptr<const chromeos::AccelerometerUpdate> update) override; |
| 93 | 93 |
| 94 // PowerManagerClient::Observer: | 94 // PowerManagerClient::Observer: |
| 95 void LidEventReceived(bool open, const base::TimeTicks& time) override; | 95 void LidEventReceived(bool open, const base::TimeTicks& time) override; |
| 96 void TabletModeEventReceived(bool on, const base::TimeTicks& time) override; | |
| 96 void SuspendImminent() override; | 97 void SuspendImminent() override; |
| 97 void SuspendDone(const base::TimeDelta& sleep_duration) override; | 98 void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 98 #endif // OS_CHROMEOS | 99 #endif // OS_CHROMEOS |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 friend class MaximizeModeControllerTest; | 102 friend class MaximizeModeControllerTest; |
| 102 friend class MaximizeModeWindowManagerTest; | 103 friend class MaximizeModeWindowManagerTest; |
| 103 friend class test::MultiUserWindowManagerChromeOSTest; | 104 friend class test::MultiUserWindowManagerChromeOSTest; |
| 104 friend class test::VirtualKeyboardControllerTest; | 105 friend class test::VirtualKeyboardControllerTest; |
| 105 | 106 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 base::TimeDelta total_non_touchview_time_; | 163 base::TimeDelta total_non_touchview_time_; |
| 163 | 164 |
| 164 // Tracks the last time we received a lid open event. This is used to suppress | 165 // Tracks the last time we received a lid open event. This is used to suppress |
| 165 // erroneous accelerometer readings as the lid is opened but the accelerometer | 166 // erroneous accelerometer readings as the lid is opened but the accelerometer |
| 166 // reports readings that make the lid to appear near fully open. | 167 // reports readings that make the lid to appear near fully open. |
| 167 base::TimeTicks last_lid_open_time_; | 168 base::TimeTicks last_lid_open_time_; |
| 168 | 169 |
| 169 // Source for the current time in base::TimeTicks. | 170 // Source for the current time in base::TimeTicks. |
| 170 std::unique_ptr<base::TickClock> tick_clock_; | 171 std::unique_ptr<base::TickClock> tick_clock_; |
| 171 | 172 |
| 173 #if defined(OS_CHROMEOS) | |
| 174 // Forces maximize mode. Used along with the tablet_mode switch on Chrome OS. | |
| 175 // When the tablet_mode switch is on we force maximize mode no matter what the | |
| 176 // lid angle is. | |
| 177 bool force_maximize_mode_; | |
|
jonross
2016/06/03 03:27:19
We have ways to forcibly trigger maximize mode, an
jcliang
2016/06/03 05:28:49
Do you mean switches::kAshEnableTouchViewTesting?
jonross
2016/06/03 16:27:24
Yeah we can't use the switch here, I was just brin
| |
| 178 #endif | |
| 179 | |
| 172 // Tracks when the lid is closed. Used to prevent entering maximize mode. | 180 // Tracks when the lid is closed. Used to prevent entering maximize mode. |
| 173 bool lid_is_closed_; | 181 bool lid_is_closed_; |
| 174 | 182 |
| 175 // Tracks smoothed accelerometer data over time. This is done when the hinge | 183 // Tracks smoothed accelerometer data over time. This is done when the hinge |
| 176 // is approaching vertical to remove abrupt acceleration that can lead to | 184 // is approaching vertical to remove abrupt acceleration that can lead to |
| 177 // incorrect calculations of hinge angles. | 185 // incorrect calculations of hinge angles. |
| 178 gfx::Vector3dF base_smoothed_; | 186 gfx::Vector3dF base_smoothed_; |
| 179 gfx::Vector3dF lid_smoothed_; | 187 gfx::Vector3dF lid_smoothed_; |
| 180 | 188 |
| 181 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 189 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 182 }; | 190 }; |
| 183 | 191 |
| 184 } // namespace ash | 192 } // namespace ash |
| 185 | 193 |
| 186 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 194 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |