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

Unified Diff: ui/base/layout.cc

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « ui/base/layout.h ('k') | ui/base/layout_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index 98df1e1ff187ddc222cc61de33651d8c35943909..a17ffc638219b87c75ff8b9ecc3a74935e25a157 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -64,7 +64,7 @@ bool UseTouchOptimizedUI() {
}
#endif // defined(OS_WIN)
-const float kScaleFactorScales[] = {1.0f, 1.4f, 1.8f, 2.0f};
+const float kScaleFactorScales[] = {1.0f, 1.0f, 1.4f, 1.8f, 2.0f};
COMPILE_ASSERT(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales),
kScaleFactorScales_incorrect_size);
const size_t kScaleFactorScalesLength = arraysize(kScaleFactorScales);
@@ -94,7 +94,8 @@ std::vector<ScaleFactor>& GetSupportedScaleFactorsInternal() {
supported_scale_factors->push_back(SCALE_FACTOR_140P);
supported_scale_factors->push_back(SCALE_FACTOR_180P);
}
-#elif defined(USE_ASH)
+#elif defined(OS_CHROMEOS)
+ // TODO(oshima): Include 200P only if the device support 200P
supported_scale_factors->push_back(SCALE_FACTOR_200P);
#endif
std::sort(supported_scale_factors->begin(),
@@ -134,6 +135,7 @@ ScaleFactor GetScaleFactorFromScale(float scale) {
smallest_diff = diff;
}
}
+ DCHECK_NE(closest_match, SCALE_FACTOR_NONE);
return closest_match;
}
« no previous file with comments | « ui/base/layout.h ('k') | ui/base/layout_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698