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

Unified Diff: ui/base/layout.cc

Issue 12257016: (Not ready for review!) Toolbar and views high dpi support. Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleaned up more useless diffs. Created 7 years, 10 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 | « skia/ext/platform_device_win.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index a0381592961ce47ed5ac6798b410b68833a8b27c..7e1f403f0ee2c4b4e90a0fc31e9471c6fd3e9be2 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -14,6 +14,7 @@
#include "build/build_config.h"
#include "ui/base/touch/touch_device.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/base/win/dpi.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -119,10 +120,14 @@ std::vector<ScaleFactor>& GetSupportedScaleFactorsInternal() {
if (base::mac::IsOSLionOrLater())
supported_scale_factors->push_back(SCALE_FACTOR_200P);
#elif defined(OS_WIN) && defined(ENABLE_HIDPI)
- if (base::win::IsMetroProcess() && ui::IsTouchDevicePresent()) {
- supported_scale_factors->push_back(SCALE_FACTOR_140P);
+ float scale = ui::GetDPIScale();
+ if (scale > 1.6)
supported_scale_factors->push_back(SCALE_FACTOR_180P);
- }
+ else if (scale > 1.2)
+ supported_scale_factors->push_back(SCALE_FACTOR_140P);
+ else
+#elif defined(OS_WIN)
+ supported_scale_factors->push_back(SCALE_FACTOR_100P);
#elif defined(OS_CHROMEOS)
// TODO(oshima): Include 200P only if the device support 200P
supported_scale_factors->push_back(SCALE_FACTOR_200P);
« no previous file with comments | « skia/ext/platform_device_win.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698