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

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

Issue 326143002: Remove ui::GetImageScale (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac build Created 6 years, 6 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 | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | no next file » | 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 24 matching lines...) Expand all
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698