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

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

Issue 2649553004: Do not enter Maximize Mode while docked (Closed)
Patch Set: Unittests and associated fixes Created 3 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/common/wm/maximize_mode/maximize_mode_controller.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_controller.cc b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
index ef07902244ecc33649b4b503a17bb766184afe73..171d5938093dabffd9492a3658c4022974be5c48 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -226,6 +226,13 @@ void MaximizeModeController::TabletModeEventReceived(
bool on,
const base::TimeTicks& time) {
tablet_mode_switch_is_on_ = on;
+ // Do not change if docked.
+ if (!display::Display::HasInternalDisplay())
+ return;
+ if (!WmShell::Get()->IsActiveDisplayId(
+ display::Display::InternalDisplayId())) {
+ return;
oshima 2017/01/25 22:13:19 optional: you may keep if you prefer that way. if
jonross 2017/01/26 00:58:39 Done.
+ }
if (on && !IsMaximizeModeWindowManagerEnabled())
EnterMaximizeMode();
}
@@ -359,6 +366,14 @@ void MaximizeModeController::OnDisplayConfigurationChanged() {
!WmShell::Get()->IsActiveDisplayId(
display::Display::InternalDisplayId())) {
LeaveMaximizeMode();
+ } else if (tablet_mode_switch_is_on_ &&
+ !IsMaximizeModeWindowManagerEnabled()) {
+ // The internal display has returned, as we are exiting docked mode.
+ // The device is still in tablet mode, so trigger maximize mode, as this
+ // switch leads to the ignoring of accelerometer events. When the switch is
+ // not set the next stable accelerometer readings will trigger maximize
+ // mode.
+ EnterMaximizeMode();
}
}
« 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