Chromium Code Reviews| Index: ui/gfx/dpi.h |
| diff --git a/ui/gfx/win/dpi.h b/ui/gfx/dpi.h |
| similarity index 89% |
| rename from ui/gfx/win/dpi.h |
| rename to ui/gfx/dpi.h |
| index 19f6a579c79e8f9d055127d4797774693aca0336..ae8b36ef33b24d89776fa64ea742159d4898ff99 100644 |
| --- a/ui/gfx/win/dpi.h |
| +++ b/ui/gfx/dpi.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef UI_GFX_DPI_WIN_H_ |
| -#define UI_GFX_DPI_WIN_H_ |
| +#ifndef UI_GFX_DPI_H_ |
| +#define UI_GFX_DPI_H_ |
| #include "ui/gfx/gfx_export.h" |
| #include "ui/gfx/point.h" |
| @@ -19,26 +19,21 @@ namespace gfx { |
| // have no effect. |
| GFX_EXPORT void InitDeviceScaleFactor(float scale); |
| -GFX_EXPORT Size GetDPI(); |
| - |
| -// Gets the scale factor of the display. For example, if the display DPI is |
| -// 96 then the scale factor is 1.0. |
| -GFX_EXPORT float GetDPIScale(); |
| - |
| -// Tests to see if the command line flag "--high-dpi-support" is set. |
| -GFX_EXPORT bool IsHighDPIEnabled(); |
| - |
| -GFX_EXPORT bool IsInHighDPIMode(); |
| +GFX_EXPORT float GetDeviceScaleFactor(); |
| -GFX_EXPORT void EnableHighDPISupport(); |
| +// Returns true if the global device scale factor has been explicitly set for |
| +// the process. |
| +GFX_EXPORT bool IsDeviceScaleFactorSet(); |
| GFX_EXPORT void ForceHighDPISupportForTesting(float scale); |
| -// TODO(kevers|girard): Move above methods into win namespace. |
| +GFX_EXPORT bool IsInHighDPIMode(); |
|
sky
2014/10/22 21:11:18
Can this function be nuked and callers use GetDPI
|
| -namespace win { |
| +GFX_EXPORT Size GetDPI(); |
| -GFX_EXPORT float GetDeviceScaleFactor(); |
| +// Gets the scale factor of the display. For example, if the display DPI is |
| +// 96 then the scale factor is 1.0. |
| +GFX_EXPORT float GetDPIScale(); |
| GFX_EXPORT Point ScreenToDIPPoint(const Point& pixel_point); |
| @@ -54,18 +49,22 @@ GFX_EXPORT Rect DIPToScreenRect(const Rect& dip_bounds); |
| GFX_EXPORT Size ScreenToDIPSize(const Size& size_in_pixels); |
| GFX_EXPORT Size DIPToScreenSize(const Size& dip_size); |
| +// Tests to see if the command line flag "--high-dpi-support" is set on Windows, |
| +// always true on Linux. |
| +GFX_EXPORT bool IsHighDPIEnabled(); |
|
sky
2014/10/22 21:11:18
Can this be nuked too?
|
| + |
| +#if defined(OS_WIN) |
| +namespace win { |
| + |
| +GFX_EXPORT void EnableHighDPISupport(); |
| + |
| // Win32's GetSystemMetrics uses pixel measures. This function calls |
| // GetSystemMetrics for the given |metric|, then converts the result to DIP. |
| GFX_EXPORT int GetSystemMetricsInDIP(int metric); |
| -// Returns true if the global device scale factor has been explicitly set for |
| -// the process. |
| -GFX_EXPORT bool IsDeviceScaleFactorSet(); |
| - |
| -GFX_EXPORT extern const wchar_t kRegistryProfilePath[]; |
| -GFX_EXPORT extern const wchar_t kHighDPISupportW[]; |
| - |
| } // namespace win |
| +#endif // OS_WIN |
| + |
| } // namespace gfx |
| -#endif // UI_GFX_DPI_WIN_H_ |
| +#endif // UI_GFX_DPI_H_ |