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

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

Issue 289583002: Lock rotation when screen is manually rotated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Block saving directly Created 6 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.h
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.h b/ash/wm/maximize_mode/maximize_mode_controller.h
index 9810d4d5bfc93019de796aec98baeb65790b1d66..6bdc4c485463cdddfa15397d5ed17651d5b1fdbc 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.h
+++ b/ash/wm/maximize_mode/maximize_mode_controller.h
@@ -9,6 +9,7 @@
#include "ash/ash_export.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/display.h"
namespace ui {
class EventHandler;
@@ -26,6 +27,13 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver {
MaximizeModeController();
virtual ~MaximizeModeController();
+ // True if OnAccelerometerUpdated has led to a call to
+ // DisplayManager::SetDisplayRotation. If true display configuration changes
+ // should not be saved to user preferences.
+ bool accelerometer_setting_rotation() {
oshima 2014/05/22 17:14:29 vconst
+ return accelerometer_setting_rotation_;
+ }
+
// True if |rotation_lock_| has been set, and OnAccelerometerUpdated will not
// change the display rotation.
bool rotation_locked() {
@@ -57,6 +65,14 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver {
// screen.
void HandleScreenRotation(const gfx::Vector3dF& lid);
+ // Enables MaximizeModeWindowManager, and determines the current state of
+ // rotation lock.
+ void EnterMaximizeMode();
+
+ // Removes MaximizeModeWindowManager and resets the display rotation if there
+ // is no rotation lock.
+ void LeaveMaximizeMode();
+
// An event targeter controller which traps mouse and keyboard events while
// maximize mode is engaged.
scoped_ptr<MaximizeModeEventBlocker> event_blocker_;
@@ -64,12 +80,19 @@ class ASH_EXPORT MaximizeModeController : public AccelerometerObserver {
// An event handler used to detect screenshot actions while in maximize mode.
scoped_ptr<ui::EventHandler> event_handler_;
+ // True when OnAccelerometerUpdated leads to changes to the display rotation.
+ bool accelerometer_setting_rotation_;
oshima 2014/05/22 17:14:29 optional: how about is_rotated_by_accelerometer? (
jonross 2014/05/23 19:07:20 No longer necessary. A lock around rotation has be
+
// 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_;
+ // The rotation of the display set by the user. This rotation will be
+ // restored upon exiting maximize mode.
+ gfx::Display::Rotation user_rotation_;
+
DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
};
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_controller.cc » ('j') | ash/wm/maximize_mode/maximize_mode_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698