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

Unified Diff: ash/display/display_change_observer_chromeos.cc

Issue 227593011: Modifies the threshold for hidpi displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos/display_options.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_change_observer_chromeos.cc
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc
index cfc23017e3d9124f96d97cd41b50ccacf8fd6828..7105477614655850f9f879ee9af7ea3cb9a9b151 100644
--- a/ash/display/display_change_observer_chromeos.cc
+++ b/ash/display/display_change_observer_chromeos.cc
@@ -30,13 +30,6 @@ using ui::DisplayConfigurator;
namespace {
-// The DPI threshold to detect high density screen.
-// Higher DPI than this will use device_scale_factor=2.
-const unsigned int kHighDensityDPIThreshold = 170;
-
-// 1 inch in mm.
-const float kInchInMm = 25.4f;
-
// Display mode list is sorted by (in descending priority):
// * the area in pixels.
// * refresh rate.
@@ -133,12 +126,8 @@ void DisplayChangeObserver::OnDisplayModeChanged(
if (!mode_info)
continue;
- float device_scale_factor = 1.0f;
- if (!ui::IsDisplaySizeBlackListed(state.display->physical_size()) &&
- (kInchInMm * mode_info->size().width() /
- state.display->physical_size().width()) > kHighDensityDPIThreshold) {
- device_scale_factor = 2.0f;
- }
+ float device_scale_factor = ui::GetScaleFactor(
+ state.display->physical_size(), mode_info->size());
gfx::Rect display_bounds(state.display->origin(), mode_info->size());
std::vector<DisplayMode> display_modes = GetDisplayModeList(state);
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos/display_options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698