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

Unified Diff: ui/base/win/dpi_setup.cc

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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
Index: ui/base/win/dpi_setup.cc
diff --git a/ui/base/win/dpi_setup.cc b/ui/base/win/dpi_setup.cc
new file mode 100644
index 0000000000000000000000000000000000000000..947cde3e18175bffead55ca435259daab75dcb26
--- /dev/null
+++ b/ui/base/win/dpi_setup.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/win/dpi_setup.h"
+
+#include "ui/base/layout.h"
+#include "ui/gfx/display.h"
+#include "ui/gfx/win/dpi.h"
+
+namespace ui {
+namespace win {
+
+void InitDeviceScaleFactor() {
+ float scale = 1.0f;
+ if (gfx::IsHighDPIEnabled()) {
+ float scale = gfx::Display::HasForceDeviceScaleFactor() ?
+ gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale();
sky 2013/09/25 19:28:15 nit: indent 2 more.
+ // Quantize to nearest supported scale factor.
+ scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale));
+ }
+ gfx::InitDeviceScaleFactor(scale);
+}
+
+} // namespace win
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698