Index: ui/base/win/dpi.cc |
=================================================================== |
--- ui/base/win/dpi.cc (revision 186195) |
+++ ui/base/win/dpi.cc (working copy) |
@@ -8,7 +8,6 @@ |
#include "base/win/scoped_hdc.h" |
#include "ui/base/layout.h" |
-#include "base/win/registry.h" |
#include "ui/gfx/display.h" |
#include "ui/gfx/point_conversions.h" |
#include "ui/gfx/rect_conversions.h" |
@@ -31,24 +30,6 @@ |
#endif |
} |
-FARPROC GetProcAddressWrapper(LPCSTR module_name, LPCSTR proc_name) { |
- HMODULE module = ::GetModuleHandleA(module_name); |
- if (module) { |
- return ::GetProcAddress(module, proc_name); |
- } |
- return NULL; |
-} |
- |
-BOOL IsProcessDPIAwareWrapper() { |
- typedef BOOL(WINAPI *IsProcessDPIAwarePtr)(VOID); |
- IsProcessDPIAwarePtr is_process_dpi_aware_func = |
- reinterpret_cast<IsProcessDPIAwarePtr>( |
- GetProcAddressWrapper("user32.dll", "IsProcessDPIAware")); |
- if (is_process_dpi_aware_func) |
- return is_process_dpi_aware_func(); |
- return FALSE; |
-} |
- |
} // namespace |
namespace ui { |
@@ -84,7 +65,7 @@ |
typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); |
SetProcessDPIAwarePtr set_process_dpi_aware_func = |
reinterpret_cast<SetProcessDPIAwarePtr>( |
- GetProcAddressWrapper("user32.dll", "SetProcessDPIAware")); |
+ GetProcAddress(GetModuleHandleA("user32.dll"), "SetProcessDPIAware")); |
if (set_process_dpi_aware_func) |
set_process_dpi_aware_func(); |
} |
@@ -122,33 +103,6 @@ |
return gfx::ToFlooredSize(gfx::ScaleSize(dip_size, GetDeviceScaleFactor())); |
} |
-double GetDPIScaleFromRegistry() { |
- static double scale = -1.0; |
- if (scale == -1.0) { |
- double result = 1.0; |
- if (!IsProcessDPIAwareWrapper()) { |
- //HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\AppliedDPI |
- base::win::RegKey key(HKEY_CURRENT_USER, |
- L"Control Panel\\Desktop\\WindowMetrics", |
- KEY_QUERY_VALUE); |
- |
- if (key.Valid()) { |
- DWORD value = 0; |
- if (key.ReadValueDW(L"AppliedDPI", &value) == ERROR_SUCCESS) { |
- result = ((double)value) / kDefaultDPIX; |
- } |
- } |
- } |
- scale = result; |
- } |
- |
- // Safety test to ignore invalid settings. |
- if (scale <= 0.0) |
- scale = 1.0; |
- |
- return scale; |
-} |
- |
} // namespace win |
} // namespace ui |