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

Unified Diff: trunk/src/ui/base/layout.h

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | « trunk/src/ui/base/cursor/cursors_aura.cc ('k') | trunk/src/ui/base/layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/base/layout.h
===================================================================
--- trunk/src/ui/base/layout.h (revision 224498)
+++ trunk/src/ui/base/layout.h (working copy)
@@ -46,37 +46,36 @@
NUM_SCALE_FACTORS // This always appears last.
};
-// Changes the value of GetSupportedScaleFactors() to |scale_factors|.
-// Use ScopedSetSupportedScaleFactors for unit tests as not to affect the
-// state of other tests.
-UI_EXPORT void SetSupportedScaleFactors(
- const std::vector<ScaleFactor>& scale_factors);
-
-// Returns a vector with the scale factors which are supported by this
-// platform, in ascending order.
-UI_EXPORT const std::vector<ScaleFactor>& GetSupportedScaleFactors();
-
// Returns the float scale value for |scale_factor|.
-UI_EXPORT float GetImageScale(ScaleFactor scale_factor);
+UI_EXPORT float GetScaleFactorScale(ScaleFactor scale_factor);
// Returns the supported ScaleFactor which most closely matches |scale|.
// Converting from float to ScaleFactor is inefficient and should be done as
// little as possible.
// TODO(oshima): Make ScaleFactor a class and remove this.
-UI_EXPORT ScaleFactor GetSupportedScaleFactor(float image_scale);
+UI_EXPORT ScaleFactor GetScaleFactorFromScale(float scale);
// Returns the ScaleFactor used by |view|.
UI_EXPORT ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view);
+// Returns the maximum device scale factor supported by this platform.
+UI_EXPORT ScaleFactor GetMaxScaleFactor();
+
+// Returns a vector with the scale factors which are supported by this
+// platform, in ascending order.
+UI_EXPORT std::vector<ScaleFactor> GetSupportedScaleFactors();
+
// Returns true if |scale_factor| is supported by this platform.
UI_EXPORT bool IsScaleFactorSupported(ScaleFactor scale_factor);
-// 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.
-UI_EXPORT ScaleFactor FindClosestScaleFactorUnsafe(float scale);
-
namespace test {
+
+// Changes the value of GetSupportedScaleFactors() to |scale_factors|.
+// Use ScopedSetSupportedScaleFactors for unit tests as not to affect the
+// state of other tests.
+UI_EXPORT void SetSupportedScaleFactors(
+ const std::vector<ScaleFactor>& scale_factors);
+
// Class which changes the value of GetSupportedScaleFactors() to
// |new_scale_factors| for the duration of its lifetime.
class UI_EXPORT ScopedSetSupportedScaleFactors {
@@ -86,7 +85,7 @@
~ScopedSetSupportedScaleFactors();
private:
- std::vector<ui::ScaleFactor>* original_scale_factors_;
+ const std::vector<ui::ScaleFactor> original_scale_factors_;
DISALLOW_COPY_AND_ASSIGN(ScopedSetSupportedScaleFactors);
};
« no previous file with comments | « trunk/src/ui/base/cursor/cursors_aura.cc ('k') | trunk/src/ui/base/layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698