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

Unified Diff: ash/display/display_change_observer_chromeos.cc

Issue 1289043002: Hookup device dpi for ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « no previous file | ash/display/display_info.h » ('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 fd2a66d1fa86e2aeb367725a758722e11a40b590..615b36b2b127091d4f0bc1846c5e0e25826ec8bd 100644
--- a/ash/display/display_change_observer_chromeos.cc
+++ b/ash/display/display_change_observer_chromeos.cc
@@ -187,12 +187,11 @@ void DisplayChangeObserver::OnDisplayModeChanged(
continue;
float device_scale_factor = 1.0f;
+ float dpi =
+ kInchInMm * mode_info->size().width() / state->physical_size().width();
oshima 2015/09/15 17:34:24 can you check against black listed size and fallba
if (state->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL) {
- if (!ui::IsDisplaySizeBlackListed(state->physical_size())) {
- device_scale_factor =
- FindDeviceScaleFactor((kInchInMm * mode_info->size().width() /
- state->physical_size().width()));
- }
+ if (!ui::IsDisplaySizeBlackListed(state->physical_size()))
+ device_scale_factor = FindDeviceScaleFactor(dpi);
} else {
DisplayMode mode;
if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId(
@@ -234,6 +233,7 @@ void DisplayChangeObserver::OnDisplayModeChanged(
new_info.set_native(true);
new_info.set_is_aspect_preserving_scaling(
state->is_aspect_preserving_scaling());
+ new_info.set_device_dpi(dpi);
std::vector<DisplayMode> display_modes =
(state->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL)
« no previous file with comments | « no previous file | ash/display/display_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698