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

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

Issue 2642853006: Remove the ash-enable-touch-view-testing flag (Closed)
Patch Set: holte's comment. 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 | « ash/common/ash_switches.cc ('k') | ash/content/display/screen_orientation_controller_chromeos_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..1700fab78cb3259d2f7dfb345b8f631e157f7c14 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -98,24 +98,21 @@ MaximizeModeController::MaximizeModeController()
// unavailable. This will require refactoring
// IsMaximizeModeWindowManagerEnabled to check for the existance of the
// controller.
- const bool is_enabled = IsEnabled();
- if (is_enabled)
+ if (IsEnabled()) {
WmShell::Get()->AddDisplayObserver(this);
-
- if (is_enabled)
chromeos::AccelerometerReader::GetInstance()->AddObserver(this);
+ }
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
this);
}
MaximizeModeController::~MaximizeModeController() {
WmShell::Get()->RemoveShellObserver(this);
- const bool is_enabled = IsEnabled();
- if (is_enabled)
- WmShell::Get()->RemoveDisplayObserver(this);
- if (is_enabled)
+ if (IsEnabled()) {
+ WmShell::Get()->RemoveDisplayObserver(this);
chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this);
+ }
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(
this);
}
@@ -123,15 +120,8 @@ MaximizeModeController::~MaximizeModeController() {
bool MaximizeModeController::CanEnterMaximizeMode() {
// If we have ever seen accelerometer data, then HandleHingeRotation may
// trigger maximize mode at some point in the future.
- // The --enable-touch-view-testing switch can also mean that we may enter
- // maximize mode.
- // TODO(mgiuca): This can result in false positives, as it returns true for
- // any device with an accelerometer. Have TouchView-enabled devices explicitly
- // set a flag, and change this implementation to simply return true iff the
- // flag is present (http://crbug.com/457445).
- return have_seen_accelerometer_data_ ||
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAshEnableTouchViewTesting);
+ // All TouchView-enabled devices can enter maximized mode.
+ return have_seen_accelerometer_data_ || IsEnabled();
}
// TODO(jcliang): Hide or remove EnableMaximizeModeWindowManager
@@ -316,13 +306,6 @@ void MaximizeModeController::EnterMaximizeMode() {
event_blocker_ =
WmShell::Get()->CreateScopedDisableInternalMouseAndKeyboard();
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAshEnableTouchViewTesting)) {
- // We don't let accelerometer updates interfere with the maximize mode
- // status as set by the touch-view-testing keyboard shortcut.
- return;
- }
-
if (IsMaximizeModeWindowManagerEnabled())
return;
EnableMaximizeModeWindowManager(true);
@@ -331,13 +314,6 @@ void MaximizeModeController::EnterMaximizeMode() {
void MaximizeModeController::LeaveMaximizeMode() {
event_blocker_.reset();
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAshEnableTouchViewTesting)) {
- // We don't let accelerometer updates interfere with the maximize mode
- // status as set by the touch-view-testing keyboard shortcut.
- return;
- }
-
if (!IsMaximizeModeWindowManagerEnabled())
return;
EnableMaximizeModeWindowManager(false);
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/content/display/screen_orientation_controller_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698