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

Unified Diff: ash/display/display_info.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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_info.h
diff --git a/ash/display/display_info.h b/ash/display/display_info.h
index 427355b801296d1033c0e6da0872d04c3060ed9b..2fd74a4b013cf0505fc52f34c72e67c14f9534e1 100644
--- a/ash/display/display_info.h
+++ b/ash/display/display_info.h
@@ -5,6 +5,7 @@
#ifndef ASH_DISPLAY_DISPLAY_INFO_H_
#define ASH_DISPLAY_DISPLAY_INFO_H_
+#include <map>
#include <string>
#include <vector>
@@ -103,9 +104,6 @@ class ASH_EXPORT DisplayInfo {
// actual overscan automatically, but used in the message.
bool has_overscan() const { return has_overscan_; }
- void set_rotation(gfx::Display::Rotation rotation) { rotation_ = rotation; }
- gfx::Display::Rotation rotation() const { return rotation_; }
-
void set_touch_support(gfx::Display::TouchSupport support) {
touch_support_ = support;
}
@@ -139,6 +137,17 @@ class ASH_EXPORT DisplayInfo {
float configured_ui_scale() const { return configured_ui_scale_; }
void set_configured_ui_scale(float scale) { configured_ui_scale_ = scale; }
+ // Sets the rotation for the given |source|. Setting a new rotation will also
+ // have it become the active rotation.
+ void SetRotation(gfx::Display::Rotation rotation,
+ gfx::Display::RotationSource source);
+
+ // Returns the currently active rotation for this display.
+ gfx::Display::Rotation ActiveRotation() const;
oshima 2015/04/17 17:52:44 GetActiveRotation()
jonross 2015/04/17 19:40:04 Done.
+
+ // Returns the rotation set by a given |source|.
+ gfx::Display::Rotation GetRotation(gfx::Display::RotationSource source) const;
+
// Returns the ui scale and device scale factor actually used to create
// display that chrome sees. This can be different from one obtained
// from dispaly or one specified by a user in following situation.
@@ -231,7 +240,7 @@ class ASH_EXPORT DisplayInfo {
int64 id_;
std::string name_;
bool has_overscan_;
- gfx::Display::Rotation rotation_;
+ std::map<gfx::Display::RotationSource, gfx::Display::Rotation> rotations_;
gfx::Display::TouchSupport touch_support_;
// If the display is also a touch device, it will have a positive

Powered by Google App Engine
This is Rietveld 408576698