Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 NUM_SCALE_FACTORS // This always appears last. | 45 NUM_SCALE_FACTORS // This always appears last. |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // Returns the float scale value for |scale_factor|. | 48 // Returns the float scale value for |scale_factor|. |
| 49 UI_EXPORT float GetScaleFactorScale(ScaleFactor scale_factor); | 49 UI_EXPORT float GetScaleFactorScale(ScaleFactor scale_factor); |
| 50 | 50 |
| 51 // Returns the ScaleFactor which most closely matches |scale|. | 51 // Returns the ScaleFactor which most closely matches |scale|. |
| 52 // Converting from float to ScaleFactor is inefficient and should be done as | 52 // Converting from float to ScaleFactor is inefficient and should be done as |
| 53 // little as possible. | 53 // little as possible. |
| 54 UI_EXPORT ScaleFactor GetScaleFactorFromScale(float scale); | 54 UI_EXPORT ScaleFactor GetScaleFactorFromScale(float scale); |
|
oshima
2012/09/19 07:06:35
This shouldn't return unsupported scale factor, sh
| |
| 55 | 55 |
| 56 // Similar to GetScaleFactorFromScale but returns only supported ScaleFactor. | |
| 57 UI_EXPORT ScaleFactor GetSupportedScaleFactorFromScale(float scale); | |
| 58 | |
| 56 // Returns the ScaleFactor used by |view|. | 59 // Returns the ScaleFactor used by |view|. |
| 57 UI_EXPORT ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view); | 60 UI_EXPORT ScaleFactor GetScaleFactorForNativeView(gfx::NativeView view); |
| 58 | 61 |
| 59 // Returns a vector with the scale factors which are supported by this | 62 // Returns a vector with the scale factors which are supported by this |
| 60 // platform, in ascending order. | 63 // platform, in ascending order. |
| 61 UI_EXPORT std::vector<ScaleFactor> GetSupportedScaleFactors(); | 64 UI_EXPORT std::vector<ScaleFactor> GetSupportedScaleFactors(); |
| 62 | 65 |
| 63 // Returns true if |scale_factor| is supported by this platform. | 66 // Returns true if |scale_factor| is supported by this platform. |
| 64 UI_EXPORT bool IsScaleFactorSupported(ScaleFactor scale_factor); | 67 UI_EXPORT bool IsScaleFactorSupported(ScaleFactor scale_factor); |
| 65 | 68 |
| 66 namespace test { | 69 namespace test { |
| 67 | 70 |
| 68 UI_EXPORT void SetSupportedScaleFactors( | 71 UI_EXPORT void SetSupportedScaleFactors( |
| 69 const std::vector<ScaleFactor>& scale_factors); | 72 const std::vector<ScaleFactor>& scale_factors); |
| 70 | 73 |
| 71 } // namespace test | 74 } // namespace test |
| 72 | 75 |
| 73 } // namespace ui | 76 } // namespace ui |
| 74 | 77 |
| 75 #endif // UI_BASE_LAYOUT_H_ | 78 #endif // UI_BASE_LAYOUT_H_ |
| OLD | NEW |