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

Unified Diff: ui/base/layout.cc

Issue 291073002: Move IsScaleFactorSupported, FindClosestScaleFactorUnsafe to ui/base/resource_bundle.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 | « ui/base/layout.h ('k') | ui/base/resource/resource_bundle.h » ('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 6ce0ccc2f46c1a38bd12bfd52902ae4bcea92528..2c4baee9aa42493371831c5b24e10b926598c38a 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -90,30 +90,6 @@ float GetImageScale(ScaleFactor scale_factor) {
return GetScaleForScaleFactor(scale_factor);
}
-bool IsScaleFactorSupported(ScaleFactor scale_factor) {
- DCHECK(g_supported_scale_factors != NULL);
- return std::find(g_supported_scale_factors->begin(),
- g_supported_scale_factors->end(),
- scale_factor) != g_supported_scale_factors->end();
-}
-
-// Returns the scale factor closest to |scale| from the full list of factors.
-// Note that it does NOT rely on the list of supported scale factors.
-// Finding the closest match is inefficient and shouldn't be done frequently.
-ScaleFactor FindClosestScaleFactorUnsafe(float scale) {
- float smallest_diff = std::numeric_limits<float>::max();
- ScaleFactor closest_match = SCALE_FACTOR_100P;
- for (int i = SCALE_FACTOR_100P; i < NUM_SCALE_FACTORS; ++i) {
- const ScaleFactor scale_factor = static_cast<ScaleFactor>(i);
- float diff = std::abs(kScaleFactorScales[scale_factor] - scale);
- if (diff < smallest_diff) {
- closest_match = scale_factor;
- smallest_diff = diff;
- }
- }
- return closest_match;
-}
-
float GetScaleForScaleFactor(ScaleFactor scale_factor) {
return kScaleFactorScales[scale_factor];
}
« no previous file with comments | « ui/base/layout.h ('k') | ui/base/resource/resource_bundle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698