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

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

Issue 1071353003: Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 5 #ifndef ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_
6 #define ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 6 #define ASH_CONTENT_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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // True if |rotation_lock_| has been set and accelerometer updates should not 64 // True if |rotation_lock_| has been set and accelerometer updates should not
65 // rotate the display. 65 // rotate the display.
66 bool rotation_locked() const { return rotation_locked_; } 66 bool rotation_locked() const { return rotation_locked_; }
67 67
68 // If |rotation_locked| future accelerometer updates should not change the 68 // If |rotation_locked| future accelerometer updates should not change the
69 // display rotation. 69 // display rotation.
70 void SetRotationLocked(bool rotation_locked); 70 void SetRotationLocked(bool rotation_locked);
71 71
72 // Sets the display rotation and suppresses display notifications. 72 // Sets the display rotation and suppresses display notifications.
73 void SetDisplayRotation(gfx::Display::Rotation rotation); 73 void SetDisplayRotation(gfx::Display::Rotation rotation,
74 gfx::Display::RotationSource source);
74 75
75 // aura::client::ActivationChangeObserver: 76 // aura::client::ActivationChangeObserver:
76 void OnWindowActivated(aura::Window* gained_active, 77 void OnWindowActivated(aura::Window* gained_active,
77 aura::Window* lost_active) override; 78 aura::Window* lost_active) override;
78 79
79 // aura::WindowObserver: 80 // aura::WindowObserver:
80 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; 81 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override;
81 void OnWindowDestroying(aura::Window* window) override; 82 void OnWindowDestroying(aura::Window* window) override;
82 83
83 // chromeos::AccelerometerReader::Observer: 84 // chromeos::AccelerometerReader::Observer:
(...skipping 11 matching lines...) Expand all
95 void OnDisplayConfigurationChanged() override; 96 void OnDisplayConfigurationChanged() override;
96 97
97 // ShellObserver: 98 // ShellObserver:
98 void OnMaximizeModeStarted() override; 99 void OnMaximizeModeStarted() override;
99 void OnMaximizeModeEnded() override; 100 void OnMaximizeModeEnded() override;
100 101
101 private: 102 private:
102 // Sets the display rotation to |rotation|. Future accelerometer updates 103 // Sets the display rotation to |rotation|. Future accelerometer updates
103 // should not be used to change the rotation. SetRotationLocked(false) removes 104 // should not be used to change the rotation. SetRotationLocked(false) removes
104 // the rotation lock. 105 // the rotation lock.
105 void LockRotation(gfx::Display::Rotation rotation); 106 void LockRotation(gfx::Display::Rotation rotation,
107 gfx::Display::RotationSource source);
106 108
107 // Sets the display rotation based on |lock_orientation|. Future accelerometer 109 // Sets the display rotation based on |lock_orientation|. Future accelerometer
108 // updates should not be used to change the rotation. SetRotationLocked(false) 110 // updates should not be used to change the rotation. SetRotationLocked(false)
109 // removes the rotation lock. 111 // removes the rotation lock.
110 void LockRotationToOrientation( 112 void LockRotationToOrientation(
111 blink::WebScreenOrientationLockType lock_orientation); 113 blink::WebScreenOrientationLockType lock_orientation);
112 114
113 // Locks rotation to the angle matching the primary orientation for 115 // Locks rotation to the angle matching the primary orientation for
114 // |lock_orientation|. 116 // |lock_orientation|.
115 void LockRotationToPrimaryOrientation( 117 void LockRotationToPrimaryOrientation(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Tracks all windows that have requested a lock, as well as the requested 182 // Tracks all windows that have requested a lock, as well as the requested
181 // orientation. 183 // orientation.
182 std::map<aura::Window*, blink::WebScreenOrientationLockType> locking_windows_; 184 std::map<aura::Window*, blink::WebScreenOrientationLockType> locking_windows_;
183 185
184 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); 186 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController);
185 }; 187 };
186 188
187 } // namespace ash 189 } // namespace ash
188 190
189 #endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_ 191 #endif // ASH_CONTENT_DISPLAY_SCREEN_ORIENTATION_CONTROLLER_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698