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

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

Issue 759063002: Move Screen Rotation from MaximizeModeController to ScreenOrientationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change similarity to account for moved files Created 6 years 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.h
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.h b/ash/wm/maximize_mode/maximize_mode_controller.h
index e103548178e153344057d0911bf09e4e5721e319..9d1cf03563c9204b6033aa3212e65b74bf3129f4 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.h
+++ b/ash/wm/maximize_mode/maximize_mode_controller.h
@@ -7,12 +7,9 @@
#include "ash/accelerometer/accelerometer_observer.h"
#include "ash/ash_export.h"
-#include "ash/display/display_controller.h"
-#include "ash/display/display_manager.h"
#include "ash/shell_observer.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
#include "ui/gfx/display.h"
#if defined(OS_CHROMEOS)
@@ -45,46 +42,11 @@ class ASH_EXPORT MaximizeModeController
#if defined(OS_CHROMEOS)
public chromeos::PowerManagerClient::Observer,
#endif // OS_CHROMEOS
- public ShellObserver,
- public DisplayController::Observer {
+ public ShellObserver {
public:
- // Observer that reports changes to the state of MaximizeModeController's
- // rotation lock.
- class Observer {
- public:
- // Invoked whenever |rotation_locked_| is changed.
- virtual void OnRotationLockChanged(bool rotation_locked) {}
-
- protected:
- virtual ~Observer() {}
- };
-
MaximizeModeController();
~MaximizeModeController() override;
- bool ignore_display_configuration_updates() const {
- return ignore_display_configuration_updates_;
- }
-
- // True if |rotation_lock_| has been set, and OnAccelerometerUpdated will not
- // change the display rotation.
- bool rotation_locked() {
- return rotation_locked_;
- }
-
- // If |rotation_locked| future calls to OnAccelerometerUpdated will not
- // change the display rotation.
- void SetRotationLocked(bool rotation_locked);
-
- // Sets the display rotation to |rotation| and prevents future calls to
- // OnAccelerometerUpdated from changing the rotation. SetRotationLocked(false)
- // removes the rotation lock.
- void LockRotation(gfx::Display::Rotation rotation);
-
- // Add/Remove observers.
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
-
// True if it is possible to enter maximize mode in the current
// configuration. If this returns false, it should never be the case that
// maximize mode becomes enabled.
@@ -106,13 +68,6 @@ class ASH_EXPORT MaximizeModeController
// If the maximize mode is not enabled no action will be performed.
void AddWindow(aura::Window* window);
- // TODO(jonross): move this into the destructor. Currently separated as
- // ShellOberver notifies of maximize mode ending, and the observers end up
- // attempting to access MaximizeModeController via the Shell. If done in
- // destructor the controller is null, and the observers segfault.
- // Shuts down down the MaximizeModeWindowManager and notifies all observers.
- void Shutdown();
-
// AccelerometerObserver:
void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override;
@@ -121,15 +76,11 @@ class ASH_EXPORT MaximizeModeController
void OnMaximizeModeStarted() override;
void OnMaximizeModeEnded() override;
- // DisplayController::Observer:
- void OnDisplayConfigurationChanged() override;
-
#if defined(OS_CHROMEOS)
// PowerManagerClient::Observer:
- virtual void LidEventReceived(bool open,
- const base::TimeTicks& time) override;
- virtual void SuspendImminent() override;
- virtual void SuspendDone(const base::TimeDelta& sleep_duration) override;
+ void LidEventReceived(bool open, const base::TimeTicks& time) override;
+ void SuspendImminent() override;
+ void SuspendDone(const base::TimeDelta& sleep_duration) override;
#endif // OS_CHROMEOS
private:
@@ -146,14 +97,6 @@ class ASH_EXPORT MaximizeModeController
void HandleHingeRotation(const gfx::Vector3dF& base,
const gfx::Vector3dF& lid);
- // Detect screen rotation from |lid| accelerometer and automatically rotate
- // screen.
- void HandleScreenRotation(const gfx::Vector3dF& lid);
-
- // Sets the display rotation and suppresses display notifications.
- void SetDisplayRotation(DisplayManager* display_manager,
- gfx::Display::Rotation rotation);
-
// Returns true if the lid was recently opened.
bool WasLidOpenedRecently() const;
@@ -168,10 +111,6 @@ class ASH_EXPORT MaximizeModeController
// Record UMA stats tracking touchview usage.
void RecordTouchViewStateTransition();
- // Checks DisplayManager for registered rotation lock, and rotation,
- // preferences. These are then applied.
- void LoadDisplayRotationProperties();
-
// The maximized window manager (if enabled).
scoped_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_;
@@ -179,36 +118,12 @@ class ASH_EXPORT MaximizeModeController
// internal keyboard and touchpad.
scoped_ptr<ScopedDisableInternalMouseAndKeyboard> event_blocker_;
- // When true calls to OnAccelerometerUpdated will not rotate the display.
- bool rotation_locked_;
-
// Whether we have ever seen accelerometer data.
bool have_seen_accelerometer_data_;
- // True when changes being applied cause OnDisplayConfigurationChanged() to be
- // called, and for which these changes should be ignored.
- bool ignore_display_configuration_updates_;
-
// True when the hinge angle has been detected past 180 degrees.
bool lid_open_past_180_;
- // True when Shutdown has been called. When shutting down the non maximize
- // mode state should be restored, however user preferences should not be
- // altered.
- bool shutting_down_;
-
- // The rotation of the display set by the user. This rotation will be
- // restored upon exiting maximize mode.
- gfx::Display::Rotation user_rotation_;
-
- // The current rotation set by MaximizeModeController for the internal
- // display. Compared in OnDisplayConfigurationChanged to determine user
- // display setting changes.
- gfx::Display::Rotation current_rotation_;
-
- // Rotation Lock observers.
- ObserverList<Observer> observers_;
-
// Tracks time spent in (and out of) touchview mode.
base::Time last_touchview_transition_time_;
base::TimeDelta total_touchview_time_;

Powered by Google App Engine
This is Rietveld 408576698