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

Side by Side Diff: ui/gfx/display.h

Issue 1071353003: Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GFX_DISPLAY_H_ 5 #ifndef UI_GFX_DISPLAY_H_
6 #define UI_GFX_DISPLAY_H_ 6 #define UI_GFX_DISPLAY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 12 matching lines...) Expand all
23 class GFX_EXPORT Display { 23 class GFX_EXPORT Display {
24 public: 24 public:
25 // Screen Rotation in clock-wise degrees. 25 // Screen Rotation in clock-wise degrees.
26 enum Rotation { 26 enum Rotation {
27 ROTATE_0 = 0, 27 ROTATE_0 = 0,
28 ROTATE_90, 28 ROTATE_90,
29 ROTATE_180, 29 ROTATE_180,
30 ROTATE_270, 30 ROTATE_270,
31 }; 31 };
32 32
33 // The display rotation can have multiple causes for change. A user can set a
34 // preference. On devices with accelerometers, they can change the rotation.
35 // RotationSource allows for the tracking of a Rotation per source of the
36 // change. ROTATION_SOURCE_ACTIVE is the current rotation of the display.
37 // Rotation changes not due to an accelerometer, nor the user, are to use this
38 // source directly.
39 enum RotationSource {
40 ROTATION_SOURCE_ACCELEROMETER = 0,
41 ROTATION_SOURCE_ACTIVE,
42 ROTATION_SOURCE_USER,
43 };
44
33 // Touch support for the display. 45 // Touch support for the display.
34 enum TouchSupport { 46 enum TouchSupport {
35 TOUCH_SUPPORT_UNKNOWN, 47 TOUCH_SUPPORT_UNKNOWN,
36 TOUCH_SUPPORT_AVAILABLE, 48 TOUCH_SUPPORT_AVAILABLE,
37 TOUCH_SUPPORT_UNAVAILABLE, 49 TOUCH_SUPPORT_UNAVAILABLE,
38 }; 50 };
39 51
40 // Creates a display with kInvalidDisplayID as default. 52 // Creates a display with kInvalidDisplayID as default.
41 Display(); 53 Display();
42 explicit Display(int64 id); 54 explicit Display(int64 id);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 Rect bounds_; 144 Rect bounds_;
133 Rect work_area_; 145 Rect work_area_;
134 float device_scale_factor_; 146 float device_scale_factor_;
135 Rotation rotation_; 147 Rotation rotation_;
136 TouchSupport touch_support_; 148 TouchSupport touch_support_;
137 }; 149 };
138 150
139 } // namespace gfx 151 } // namespace gfx
140 152
141 #endif // UI_GFX_DISPLAY_H_ 153 #endif // UI_GFX_DISPLAY_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698