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

Side by Side Diff: ash/display/screen_orientation_controller_chromeos.h

Issue 2795103003: Revert of [Merge to M58] cros: Treat set rotation for chrome.system.display API in touchview mode as if user … (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | ash/display/screen_orientation_controller_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 5 #ifndef ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_
6 #define ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 6 #define ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool user_rotation_locked() const { 72 bool user_rotation_locked() const {
73 return user_locked_orientation_ != blink::WebScreenOrientationLockAny; 73 return user_locked_orientation_ != blink::WebScreenOrientationLockAny;
74 } 74 }
75 75
76 // Trun on/off the user rotation lock. When turned on, it will lock 76 // Trun on/off the user rotation lock. When turned on, it will lock
77 // the orientation to the current orientation. 77 // the orientation to the current orientation.
78 // |user_rotation_locked()| method returns the current state of the 78 // |user_rotation_locked()| method returns the current state of the
79 // user rotation lock. 79 // user rotation lock.
80 void ToggleUserRotationLock(); 80 void ToggleUserRotationLock();
81 81
82 // Set locked to the given |rotation| and save it.
83 void SetLockToRotation(display::Display::Rotation rotation);
84
85 // WmActivationObserver: 82 // WmActivationObserver:
86 void OnWindowActivated(WmWindow* gained_active, 83 void OnWindowActivated(WmWindow* gained_active,
87 WmWindow* lost_active) override; 84 WmWindow* lost_active) override;
88 85
89 // aura::WindowObserver: 86 // aura::WindowObserver:
90 void OnWindowDestroying(aura::Window* window) override; 87 void OnWindowDestroying(aura::Window* window) override;
91 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; 88 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override;
92 89
93 // chromeos::AccelerometerReader::Observer: 90 // chromeos::AccelerometerReader::Observer:
94 void OnAccelerometerUpdated( 91 void OnAccelerometerUpdated(
(...skipping 10 matching lines...) Expand all
105 friend class test::ScreenOrientationControllerTestApi; 102 friend class test::ScreenOrientationControllerTestApi;
106 103
107 // Sets the display rotation for the given |source|. The new |rotation| will 104 // Sets the display rotation for the given |source|. The new |rotation| will
108 // also become active. Display changed notifications are surpressed for this 105 // also become active. Display changed notifications are surpressed for this
109 // change. 106 // change.
110 void SetDisplayRotation(display::Display::Rotation rotation, 107 void SetDisplayRotation(display::Display::Rotation rotation,
111 display::Display::RotationSource source); 108 display::Display::RotationSource source);
112 109
113 void SetRotationLockedInternal(bool rotation_locked); 110 void SetRotationLockedInternal(bool rotation_locked);
114 111
115 // A helper method that set locked to the given |orientation| and save it.
116 void SetLockToOrientation(blink::WebScreenOrientationLockType orientation);
117
118 // Sets the display rotation to |rotation|. Future accelerometer updates 112 // Sets the display rotation to |rotation|. Future accelerometer updates
119 // should not be used to change the rotation. SetRotationLocked(false) removes 113 // should not be used to change the rotation. SetRotationLocked(false) removes
120 // the rotation lock. 114 // the rotation lock.
121 void LockRotation(display::Display::Rotation rotation, 115 void LockRotation(display::Display::Rotation rotation,
122 display::Display::RotationSource source); 116 display::Display::RotationSource source);
123 117
124 // Sets the display rotation based on |lock_orientation|. Future accelerometer 118 // Sets the display rotation based on |lock_orientation|. Future accelerometer
125 // updates should not be used to change the rotation. SetRotationLocked(false) 119 // updates should not be used to change the rotation. SetRotationLocked(false)
126 // removes the rotation lock. 120 // removes the rotation lock.
127 void LockRotationToOrientation( 121 void LockRotationToOrientation(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Tracks all windows that have requested a lock, as well as the requested 192 // Tracks all windows that have requested a lock, as well as the requested
199 // orientation. 193 // orientation.
200 std::map<WmWindow*, blink::WebScreenOrientationLockType> locking_windows_; 194 std::map<WmWindow*, blink::WebScreenOrientationLockType> locking_windows_;
201 195
202 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); 196 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController);
203 }; 197 };
204 198
205 } // namespace ash 199 } // namespace ash
206 200
207 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 201 #endif // ASH_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_
OLDNEW
« no previous file with comments | « no previous file | ash/display/screen_orientation_controller_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698