Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller.h

Issue 2020553003: Hook up TABLET_MODE switch to maximize_mode_controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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.
Daniel Erat 2016/06/03 15:00:19 what's "tablet_mode" referring to here? if it's a
jcliang 2016/06/06 04:39:22 Done.
175 // When the tablet_mode switch is on we force maximize mode no matter what the
176 // lid angle is.
177 bool tablet_mode_;
Daniel Erat 2016/06/03 15:00:18 how about something like "tablet_mode_switch_is_on
jcliang 2016/06/06 04:39:22 Done.
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_
OLDNEW
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_controller.cc » ('j') | ash/wm/maximize_mode/maximize_mode_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698