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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller.h

Issue 267743010: Suppressed screen rotation notifications triggeres by the accelerometer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Rob's comments from patch set 1 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 "ash/display/display_manager.h"
flackr 2014/05/05 20:26:54 Forward declare DisplayManager class, or perhaps n
bruthig 2014/05/05 20:57:22 Done.
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 13
13 namespace ash { 14 namespace ash {
14 15
15 class MaximizeModeEventBlocker; 16 class MaximizeModeEventBlocker;
16 17
17 // MaximizeModeController listens to accelerometer events and automatically 18 // MaximizeModeController listens to accelerometer events and automatically
18 // enters and exits maximize mode when the lid is opened beyond the triggering 19 // enters and exits maximize mode when the lid is opened beyond the triggering
19 // angle and rotates the display to match the device when in maximize mode. 20 // angle and rotates the display to match the device when in maximize mode.
(...skipping 21 matching lines...) Expand all
41 private: 42 private:
42 // Detect hinge rotation from |base| and |lid| accelerometers and 43 // Detect hinge rotation from |base| and |lid| accelerometers and
43 // automatically start / stop maximize mode. 44 // automatically start / stop maximize mode.
44 void HandleHingeRotation(const gfx::Vector3dF& base, 45 void HandleHingeRotation(const gfx::Vector3dF& base,
45 const gfx::Vector3dF& lid); 46 const gfx::Vector3dF& lid);
46 47
47 // Detect screen rotation from |lid| accelerometer and automatically rotate 48 // Detect screen rotation from |lid| accelerometer and automatically rotate
48 // screen. 49 // screen.
49 void HandleScreenRotation(const gfx::Vector3dF& lid); 50 void HandleScreenRotation(const gfx::Vector3dF& lid);
50 51
52 // Sets the display's rotation.
53 void SetDisplayRotation(DisplayManager* display_manager,
flackr 2014/05/05 20:26:54 Since this doesn't need anything from the class, p
bruthig 2014/05/05 20:57:22 Done.
54 int64 display_id,
55 gfx::Display::Rotation rotation) const;
56
51 // An event handler which traps mouse and keyboard events while maximize 57 // An event handler which traps mouse and keyboard events while maximize
52 // mode is engaged. 58 // mode is engaged.
53 scoped_ptr<MaximizeModeEventBlocker> event_blocker_; 59 scoped_ptr<MaximizeModeEventBlocker> event_blocker_;
54 60
55 // When true calls to OnAccelerometerUpdated will not rotate the display. 61 // When true calls to OnAccelerometerUpdated will not rotate the display.
56 bool rotation_locked_; 62 bool rotation_locked_;
57 63
58 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); 64 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
59 }; 65 };
60 66
61 } // namespace ash 67 } // namespace ash
62 68
63 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ 69 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
OLDNEW
« 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