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

Side by Side 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: Define sources for rotation 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
7 7
8 #include "ash/accelerometer/accelerometer_observer.h" 8 #include "ash/accelerometer/accelerometer_observer.h"
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 private: 50 private:
51 // Detect hinge rotation from |base| and |lid| accelerometers and 51 // Detect hinge rotation from |base| and |lid| accelerometers and
52 // automatically start / stop maximize mode. 52 // automatically start / stop maximize mode.
53 void HandleHingeRotation(const gfx::Vector3dF& base, 53 void HandleHingeRotation(const gfx::Vector3dF& base,
54 const gfx::Vector3dF& lid); 54 const gfx::Vector3dF& lid);
55 55
56 // Detect screen rotation from |lid| accelerometer and automatically rotate 56 // Detect screen rotation from |lid| accelerometer and automatically rotate
57 // screen. 57 // screen.
58 void HandleScreenRotation(const gfx::Vector3dF& lid); 58 void HandleScreenRotation(const gfx::Vector3dF& lid);
59 59
60 // Enables MaximizeModeWindowManager, and determines the current state of
61 // rotation lock.
62 void EnterMaximizeMode();
63
64 // Removes MaximizeModeWindowManager and resets the display rotation if there
65 // is no rotation lock.
66 void LeaveMaximizeMode();
67
60 // An event targeter controller which traps mouse and keyboard events while 68 // An event targeter controller which traps mouse and keyboard events while
61 // maximize mode is engaged. 69 // maximize mode is engaged.
62 scoped_ptr<MaximizeModeEventBlocker> event_blocker_; 70 scoped_ptr<MaximizeModeEventBlocker> event_blocker_;
63 71
64 // An event handler used to detect screenshot actions while in maximize mode. 72 // An event handler used to detect screenshot actions while in maximize mode.
65 scoped_ptr<ui::EventHandler> event_handler_; 73 scoped_ptr<ui::EventHandler> event_handler_;
66 74
67 // When true calls to OnAccelerometerUpdated will not rotate the display. 75 // When true calls to OnAccelerometerUpdated will not rotate the display.
68 bool rotation_locked_; 76 bool rotation_locked_;
69 77
70 // Whether we have ever seen accelerometer data. 78 // Whether we have ever seen accelerometer data.
71 bool have_seen_accelerometer_data_; 79 bool have_seen_accelerometer_data_;
72 80
73 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); 81 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
74 }; 82 };
75 83
76 } // namespace ash 84 } // namespace ash
77 85
78 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ 86 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698