diff options
author | oshima <oshima@chromium.org> | 2014-12-17 18:02:29 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-18 02:03:04 +0000 |
commit | 3de5c004da8dc9c1548057cdf02d08df46deb264 (patch) | |
tree | 4f6c34344af7058d1d1582aa59054f59eebc5a02 /ash/display/display_manager.h | |
parent | b86b8b1a1cd213734f58a4282269f89c8a285d32 (diff) | |
download | chromium_src-3de5c004da8dc9c1548057cdf02d08df46deb264.zip chromium_src-3de5c004da8dc9c1548057cdf02d08df46deb264.tar.gz chromium_src-3de5c004da8dc9c1548057cdf02d08df46deb264.tar.bz2 |
Generate mode list for internal display in test or on desktop as well.
The list was empty on test and desktop. This CL makes the behavior close to one on real device.
notable changes
* move sorting logic to DisplayInfo.
* tests now needs to use test api to change the primary display id, as the mode list has to be updated when primary display changes.
BUG=401044
TEST=no functional change. all test should pass.
Review URL: https://codereview.chromium.org/799423003
Cr-Commit-Position: refs/heads/master@{#308925}
Diffstat (limited to 'ash/display/display_manager.h')
-rw-r--r-- | ash/display/display_manager.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ash/display/display_manager.h b/ash/display/display_manager.h index 188e5d8..ec45589 100644 --- a/ash/display/display_manager.h +++ b/ash/display/display_manager.h @@ -77,8 +77,10 @@ class ASH_EXPORT DisplayManager MIRRORING }; - // Returns the list of possible UI scales for the display. - static std::vector<float> GetScalesForDisplay(const DisplayInfo& info); + // Creates the display modes list for internal display given + // by |native_mode|. + static std::vector<DisplayMode> CreateInternalDisplayModeList( + const DisplayMode& native_mode); // Returns next valid UI scale. static float GetNextUIScale(const DisplayInfo& info, bool up); @@ -163,9 +165,10 @@ class ASH_EXPORT DisplayManager // Sets the display's rotation. void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); - // Sets the display's ui scale. - // TODO(mukai): remove this and merge into SetDisplayMode. - void SetDisplayUIScale(int64 display_id, float ui_scale); + // Sets the display's ui scale. Returns true if it's successful, or + // false otherwise. TODO(mukai): remove this and merge into + // SetDisplayMode. + bool SetDisplayUIScale(int64 display_id, float ui_scale); // Sets the display's resolution. // TODO(mukai): remove this and merge into SetDisplayMode. @@ -306,6 +309,11 @@ class ASH_EXPORT DisplayManager // Create a screen instance to be used during shutdown. void CreateScreenForShutdown() const; + // A unit test may change the internal display id (which never happens on + // a real device). This will update the mode list for internal display + // for this test scenario. + void UpdateInternalDisplayModeListForTest(); + private: FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); |