OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_LAYOUT_H_ | 5 #ifndef UI_BASE_LAYOUT_H_ |
6 #define UI_BASE_LAYOUT_H_ | 6 #define UI_BASE_LAYOUT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Changes the value of GetSupportedScaleFactors() to |scale_factors|. | 35 // Changes the value of GetSupportedScaleFactors() to |scale_factors|. |
36 // Use ScopedSetSupportedScaleFactors for unit tests as not to affect the | 36 // Use ScopedSetSupportedScaleFactors for unit tests as not to affect the |
37 // state of other tests. | 37 // state of other tests. |
38 UI_BASE_EXPORT void SetSupportedScaleFactors( | 38 UI_BASE_EXPORT void SetSupportedScaleFactors( |
39 const std::vector<ScaleFactor>& scale_factors); | 39 const std::vector<ScaleFactor>& scale_factors); |
40 | 40 |
41 // Returns a vector with the scale factors which are supported by this | 41 // Returns a vector with the scale factors which are supported by this |
42 // platform, in ascending order. | 42 // platform, in ascending order. |
43 UI_BASE_EXPORT const std::vector<ScaleFactor>& GetSupportedScaleFactors(); | 43 UI_BASE_EXPORT const std::vector<ScaleFactor>& GetSupportedScaleFactors(); |
44 | 44 |
45 // OBSOLETE: Use GetScaleForScaleFactor instead. | |
46 // TODO(oshima): Remove this. | |
47 // Returns the actual image scale to be used for the scale factor passed in. | |
48 // On Windows high dpi, this returns the dpi scale for the display. | |
49 UI_BASE_EXPORT float GetImageScale(ScaleFactor scale_factor); | |
50 | |
51 // Returns the supported ScaleFactor which most closely matches |scale|. | 45 // Returns the supported ScaleFactor which most closely matches |scale|. |
52 // Converting from float to ScaleFactor is inefficient and should be done as | 46 // Converting from float to ScaleFactor is inefficient and should be done as |
53 // little as possible. | 47 // little as possible. |
54 UI_BASE_EXPORT ScaleFactor GetSupportedScaleFactor(float image_scale); | 48 UI_BASE_EXPORT ScaleFactor GetSupportedScaleFactor(float image_scale); |
55 | 49 |
56 // Returns the ScaleFactor used by |view|. | 50 // Returns the ScaleFactor used by |view|. |
57 UI_BASE_EXPORT float GetScaleFactorForNativeView(gfx::NativeView view); | 51 UI_BASE_EXPORT float GetScaleFactorForNativeView(gfx::NativeView view); |
58 | 52 |
59 // Returns the image scale for the scale factor passed in. | 53 // Returns the image scale for the scale factor passed in. |
60 UI_BASE_EXPORT float GetScaleForScaleFactor(ScaleFactor scale_factor); | 54 UI_BASE_EXPORT float GetScaleForScaleFactor(ScaleFactor scale_factor); |
(...skipping 11 matching lines...) Expand all Loading... |
72 std::vector<ui::ScaleFactor>* original_scale_factors_; | 66 std::vector<ui::ScaleFactor>* original_scale_factors_; |
73 | 67 |
74 DISALLOW_COPY_AND_ASSIGN(ScopedSetSupportedScaleFactors); | 68 DISALLOW_COPY_AND_ASSIGN(ScopedSetSupportedScaleFactors); |
75 }; | 69 }; |
76 | 70 |
77 } // namespace test | 71 } // namespace test |
78 | 72 |
79 } // namespace ui | 73 } // namespace ui |
80 | 74 |
81 #endif // UI_BASE_LAYOUT_H_ | 75 #endif // UI_BASE_LAYOUT_H_ |
OLD | NEW |