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

Unified Diff: ui/aura/monitor_manager.cc

Issue 10254011: Add flag to experiments to force high DPI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698