Index: ui/gfx/display.cc |
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
index 5b375891ad0fa271aae4cc990c0f116a724eabc7..82b1f929a99655d78024899039afc6f915841bb8 100644 |
--- a/ui/gfx/display.cc |
+++ b/ui/gfx/display.cc |
@@ -9,25 +9,33 @@ |
#include "base/string_number_conversions.h" |
#include "base/stringprintf.h" |
#include "ui/base/ui_base_switches.h" |
+#include "ui/base/win/dpi.h" |
#include "ui/gfx/insets.h" |
#include "ui/gfx/size_conversions.h" |
namespace gfx { |
namespace { |
-bool HasForceDeviceScaleFactor() { |
+bool HasForceDeviceScaleFactorImpl() { |
return CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kForceDeviceScaleFactor); |
} |
float GetForcedDeviceScaleFactorImpl() { |
double scale_in_double = 1.0; |
- if (HasForceDeviceScaleFactor()) { |
+ if (HasForceDeviceScaleFactorImpl()) { |
std::string value = CommandLine::ForCurrentProcess()-> |
GetSwitchValueASCII(switches::kForceDeviceScaleFactor); |
if (!base::StringToDouble(value, &scale_in_double)) |
LOG(ERROR) << "Failed to parse the deafult device scale factor:" << value; |
} |
+#if defined(OS_WIN) |
pkotwicz
2013/01/23 19:39:23
I think that this block of code should be in GetDe
kevers
2013/01/23 21:37:00
Done.
|
+ else { |
+ static double os_scale = ui::GetDPIScale(); |
+ scale_in_double = os_scale; |
+ } |
+#endif |
+ |
return static_cast<float>(scale_in_double); |
} |
@@ -41,6 +49,10 @@ float Display::GetForcedDeviceScaleFactor() { |
GetForcedDeviceScaleFactorImpl(); |
return kForcedDeviceScaleFactor; |
} |
+//static |
pkotwicz
2013/01/23 19:39:23
Nit: newline before static
kevers
2013/01/23 21:37:00
Done.
|
+bool Display::HasForceDeviceScaleFactor() { |
+ return HasForceDeviceScaleFactorImpl(); |
+} |
// static |
int64 Display::GetID(uint16 manufacturer_id, uint32 serial_number) { |