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

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 6fef499542c57632fb6afc58a7d821309ce5d193..f8946a9799cff0b815efdcd97a39402545fa5e23 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -29,6 +29,8 @@
#include "ui/base/resource/resource_bundle.h"
#endif
+#include "base/debug/stack_trace.h"
sky 2012/11/09 23:02:17 remove this
oshima 2012/11/09 23:49:37 Done.
+
namespace ui {
namespace {
@@ -64,7 +66,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 +96,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 +137,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