| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // On Windows high dpi, this returns the dpi scale for the display. | 46 // On Windows high dpi, this returns the dpi scale for the display. |
| 47 UI_BASE_EXPORT float GetImageScale(ScaleFactor scale_factor); | 47 UI_BASE_EXPORT float GetImageScale(ScaleFactor scale_factor); |
| 48 | 48 |
| 49 // Returns the supported ScaleFactor which most closely matches |scale|. | 49 // Returns the supported ScaleFactor which most closely matches |scale|. |
| 50 // Converting from float to ScaleFactor is inefficient and should be done as | 50 // Converting from float to ScaleFactor is inefficient and should be done as |
| 51 // little as possible. | 51 // little as possible. |
| 52 // TODO(oshima): Make ScaleFactor a class and remove this. | 52 // TODO(oshima): Make ScaleFactor a class and remove this. |
| 53 UI_BASE_EXPORT ScaleFactor GetSupportedScaleFactor(float image_scale); | 53 UI_BASE_EXPORT ScaleFactor GetSupportedScaleFactor(float image_scale); |
| 54 | 54 |
| 55 // Returns the ScaleFactor used by |view|. | 55 // Returns the ScaleFactor used by |view|. |
| 56 UI_BASE_EXPORT ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view); | 56 UI_BASE_EXPORT float GetScaleFactorForNativeView(gfx::NativeView view); |
| 57 | 57 |
| 58 // Returns true if |scale_factor| is supported by this platform. | 58 // Returns true if |scale_factor| is supported by this platform. |
| 59 UI_BASE_EXPORT bool IsScaleFactorSupported(ScaleFactor scale_factor); | 59 UI_BASE_EXPORT bool IsScaleFactorSupported(ScaleFactor scale_factor); |
| 60 | 60 |
| 61 // Returns the scale factor closest to |scale| from the full list of factors. | 61 // Returns the scale factor closest to |scale| from the full list of factors. |
| 62 // Note that it does NOT rely on the list of supported scale factors. | 62 // Note that it does NOT rely on the list of supported scale factors. |
| 63 // Finding the closest match is inefficient and shouldn't be done frequently. | 63 // Finding the closest match is inefficient and shouldn't be done frequently. |
| 64 UI_BASE_EXPORT ScaleFactor FindClosestScaleFactorUnsafe(float scale); | 64 UI_BASE_EXPORT ScaleFactor FindClosestScaleFactorUnsafe(float scale); |
| 65 | 65 |
| 66 // Returns the image scale for the scale factor passed in. | 66 // Returns the image scale for the scale factor passed in. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 std::vector<ui::ScaleFactor>* original_scale_factors_; | 79 std::vector<ui::ScaleFactor>* original_scale_factors_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(ScopedSetSupportedScaleFactors); | 81 DISALLOW_COPY_AND_ASSIGN(ScopedSetSupportedScaleFactors); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace test | 84 } // namespace test |
| 85 | 85 |
| 86 } // namespace ui | 86 } // namespace ui |
| 87 | 87 |
| 88 #endif // UI_BASE_LAYOUT_H_ | 88 #endif // UI_BASE_LAYOUT_H_ |
| OLD | NEW |