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

Unified Diff: ash/wm/maximize_mode/maximize_mode_controller.cc

Issue 895993002: Correcly Report CanEnterMaximizeMode on devices without accelerometers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_mode/maximize_mode_controller.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.cc b/ash/wm/maximize_mode/maximize_mode_controller.cc
index 1463a501561d815c07b30ba6d588145174658dfd..83cbc745df39839912baa58bb378cc543b5abd48 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller.cc
@@ -132,12 +132,12 @@ void MaximizeModeController::AddWindow(aura::Window* window) {
#if defined(OS_CHROMEOS)
void MaximizeModeController::OnAccelerometerUpdated(
const ui::AccelerometerUpdate& update) {
- bool first_accelerometer_update = !have_seen_accelerometer_data_;
- have_seen_accelerometer_data_ = true;
-
if (!update.has(ui::ACCELEROMETER_SOURCE_SCREEN))
return;
+ bool first_accelerometer_update = !have_seen_accelerometer_data_;
+ have_seen_accelerometer_data_ = true;
+
// Whether or not we enter maximize mode affects whether we handle screen
// rotation, so determine whether to enter maximize mode first.
if (!update.has(ui::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD)) {
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698