Chromium Code Reviews| Index: ash/display/display_info.h |
| diff --git a/ash/display/display_info.h b/ash/display/display_info.h |
| index 62f9210078b609c72d5b9c153a9bc54b494db92e..008f7ab3e5f8c80714fec307f0786107aae0dbcc 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> |
| @@ -95,8 +96,15 @@ 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_; } |
| + // Returns the last rotation set through either user actions, or the |
| + // accelerometer. The current active rotation of the display can be found by |
| + // calling |rotation()|. |
| + gfx::Display::Rotation GetRotation(ui::RotationSource source); |
|
flackr
2014/05/16 16:00:22
Do we ever want to get the last saved acceleromete
jonross
2014/05/20 15:24:30
A few potential uses:
- Testing
- Saving as a
|
| + |
| + // Updates the rotation for the given source, and also sets the current |
| + // rotation. |
| + void SetRotation(gfx::Display::Rotation rotation, ui::RotationSource source); |
| + gfx::Display::Rotation rotation() const { return current_rotation_; } |
| void set_touch_support(gfx::Display::TouchSupport support) { |
| touch_support_ = support; |
| @@ -201,7 +209,8 @@ class ASH_EXPORT DisplayInfo { |
| int64 id_; |
| std::string name_; |
| bool has_overscan_; |
| - gfx::Display::Rotation rotation_; |
| + gfx::Display::Rotation current_rotation_; |
| + std::map<ui::RotationSource, gfx::Display::Rotation> rotations_; |
| gfx::Display::TouchSupport touch_support_; |
| // If the display is also a touch device, it will have a positive |