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

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

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, 7 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
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 9d8b18dae29de82390b61d4e439eca666dfd59db..f03ad8a362923daded2e741226d52a7a9c5c3f81 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller.cc
@@ -103,6 +103,9 @@ MaximizeModeController::MaximizeModeController()
lid_open_past_180_(false),
touchview_usage_interval_start_time_(base::Time::Now()),
tick_clock_(new base::DefaultTickClock()),
+#if defined(OS_CHROMEOS)
+ force_maximize_mode_(false),
+#endif
lid_is_closed_(false) {
Shell* shell = Shell::GetInstance();
shell->AddShellObserver(this);
@@ -224,6 +227,20 @@ void MaximizeModeController::LidEventReceived(bool open,
LeaveMaximizeMode();
}
+void MaximizeModeController::TabletModeEventReceived(
+ bool on,
+ const base::TimeTicks& time) {
+ if (on) {
+ force_maximize_mode_ = true;
+ EnterMaximizeMode();
+ } else {
+ force_maximize_mode_ = false;
+ // Set lid_open_past_180_ so that we get a chance to decide whether to
+ // leave maximize mode.
+ lid_open_past_180_ = true;
jonross 2016/06/03 03:27:19 I think that this should be set when the tablet mo
jcliang 2016/06/03 05:28:49 If lid_open_past_180_ is set when the tablet mode
+ }
+}
+
void MaximizeModeController::SuspendImminent() {
// The system is about to suspend, so record TouchView usage interval metrics
// based on whether TouchView mode is currently active.
@@ -332,6 +349,10 @@ void MaximizeModeController::LeaveMaximizeMode() {
return;
}
+#if defined(OS_CHROMEOS)
+ if (force_maximize_mode_)
+ return;
jonross 2016/06/03 03:27:19 With this here it is possible for the tablet mode
jcliang 2016/06/03 05:28:49 Done.
+#endif
if (!IsMaximizeModeWindowManagerEnabled())
return;
EnableMaximizeModeWindowManager(false);

Powered by Google App Engine
This is Rietveld 408576698