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

Side by Side Diff: ui/base/layout.h

Issue 293563002: GetScaleFactorForNativeView should return scale factor in float (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/app_list_main_view.cc ('k') | ui/base/layout.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_main_view.cc ('k') | ui/base/layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698