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

Unified Diff: ash/display/display_manager.cc

Issue 14710011: Redesign display options for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « ash/display/display_manager.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index c776e79ef689ec3a02088544b5db9ab0c84effdb..d15f2d1c67960eafd847112cff9d10c1ba8bd693 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -86,32 +86,6 @@ struct ScaleComparator {
float scale;
};
-std::vector<float> GetScalesForDisplay(const DisplayInfo& info) {
- std::vector<float> ret;
- if (info.device_scale_factor() == 2.0f) {
- ret.assign(kUIScalesFor2x, kUIScalesFor2x + arraysize(kUIScalesFor2x));
- return ret;
- }
- switch (info.bounds_in_pixel().width()) {
- case 1280:
- ret.assign(kUIScalesFor1280,
- kUIScalesFor1280 + arraysize(kUIScalesFor1280));
- break;
- case 1366:
- ret.assign(kUIScalesFor1366,
- kUIScalesFor1366 + arraysize(kUIScalesFor1366));
- break;
- default:
- ret.assign(kUIScalesFor1280,
- kUIScalesFor1280 + arraysize(kUIScalesFor1280));
-#if defined(OS_CHROMEOS)
- if (base::chromeos::IsRunningOnChromeOS())
- NOTREACHED() << "Unknown resolution:" << info.ToString();
-#endif
- }
- return ret;
-}
-
gfx::Display& GetInvalidDisplay() {
static gfx::Display* invalid_display = new gfx::Display();
return *invalid_display;
@@ -143,6 +117,34 @@ DisplayManager::~DisplayManager() {
}
// static
+std::vector<float> DisplayManager::GetScalesForDisplay(
+ const DisplayInfo& info) {
+ std::vector<float> ret;
+ if (info.device_scale_factor() == 2.0f) {
+ ret.assign(kUIScalesFor2x, kUIScalesFor2x + arraysize(kUIScalesFor2x));
+ return ret;
+ }
+ switch (info.bounds_in_pixel().width()) {
+ case 1280:
+ ret.assign(kUIScalesFor1280,
+ kUIScalesFor1280 + arraysize(kUIScalesFor1280));
+ break;
+ case 1366:
+ ret.assign(kUIScalesFor1366,
+ kUIScalesFor1366 + arraysize(kUIScalesFor1366));
+ break;
+ default:
+ ret.assign(kUIScalesFor1280,
+ kUIScalesFor1280 + arraysize(kUIScalesFor1280));
+#if defined(OS_CHROMEOS)
+ if (base::chromeos::IsRunningOnChromeOS())
+ NOTREACHED() << "Unknown resolution:" << info.ToString();
+#endif
+ }
+ return ret;
+}
+
+// static
float DisplayManager::GetNextUIScale(const DisplayInfo& info, bool up) {
float scale = info.ui_scale();
std::vector<float> scales = GetScalesForDisplay(info);
« no previous file with comments | « ash/display/display_manager.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698