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

Unified Diff: ash/display/display_manager.cc

Issue 230683003: Allow upgrading to 2x DSF for lower UI scale when 2x resoruces are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 32e0dea5d47004566274bbc9eb1af94ae256dda8..83d747ae108880399fa798a8da5d5228c5e88955 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -24,6 +24,8 @@
#include "base/strings/utf_string_conversions.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/layout.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/display.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
@@ -157,6 +159,10 @@ DisplayManager::DisplayManager()
#if defined(OS_CHROMEOS)
change_display_upon_host_resize_ = !base::SysInfo::IsRunningOnChromeOS();
#endif
+ DisplayInfo::SetAllowUpgradeToHighDPI(
+ ui::ResourceBundle::GetSharedInstance().GetMaxScaleFactor() ==
+ ui::SCALE_FACTOR_200P);
+
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE,
screen_ash_.get());
gfx::Screen* current_native =
@@ -1017,9 +1023,7 @@ gfx::Display DisplayManager::CreateDisplayFromDisplayInfoById(int64 id) {
gfx::Display new_display(display_info.id());
gfx::Rect bounds_in_native(display_info.size_in_pixel());
- float device_scale_factor = display_info.device_scale_factor();
- if (device_scale_factor == 2.0f && display_info.configured_ui_scale() == 2.0f)
- device_scale_factor = 1.0f;
+ float device_scale_factor = display_info.GetEffectiveDeviceScaleFactor();
// Simply set the origin to (0,0). The primary display's origin is
// always (0,0) and the secondary display's bounds will be updated

Powered by Google App Engine
This is Rietveld 408576698