Chromium Code Reviews| Index: ui/aura/monitor_manager.cc |
| diff --git a/ui/aura/monitor_manager.cc b/ui/aura/monitor_manager.cc |
| index 8cf70bc8e5b8bdf66ca381fa42d7f8e456659e5d..07947492dd0d38046f347b9bf6001f915036e187 100644 |
| --- a/ui/aura/monitor_manager.cc |
| +++ b/ui/aura/monitor_manager.cc |
| @@ -6,7 +6,10 @@ |
| #include <stdio.h> |
| +#include "base/command_line.h" |
| #include "base/logging.h" |
| +#include "base/string_number_conversions.h" |
| +#include "content/public/common/content_switches.h" |
| #include "ui/aura/env.h" |
| #include "ui/aura/monitor_observer.h" |
| #include "ui/aura/root_window.h" |
| @@ -41,6 +44,17 @@ gfx::Monitor MonitorManager::CreateMonitorFromSpec(const std::string& spec) { |
| } else if (use_fullscreen_host_window_) { |
| bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize()); |
| } |
| + |
| + // Setting a default device scale factor overrides the monitor scale factor. |
| + if (CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDefaultDeviceScaleFactor)) { |
| + int default_device_scale_factor; |
| + base::StringToInt(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
|
sky
2012/04/27 19:44:46
check return value.
flackr
2012/04/30 14:05:15
Done.
|
| + switches::kDefaultDeviceScaleFactor), |
| + &default_device_scale_factor); |
| + scale = default_device_scale_factor; |
| + } |
| + |
| gfx::Monitor monitor(synthesized_monitor_id++, bounds); |
| monitor.set_device_scale_factor(scale); |
| DVLOG(1) << "Monitor bounds=" << bounds.ToString() << ", scale=" << scale; |