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

Unified Diff: ash/display/display_manager.cc

Issue 106673003: Update the selected resolution to the resolution that is actually selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test Created 6 years, 11 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 | « ash/display/display_manager.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 0377484bede9e3cb145ef3f4206b59eefdcf23f4..2731144a99536a88dbe9322bc2730d9f6f082386 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -551,6 +551,21 @@ void DisplayManager::OnNativeDisplaysChanged(
origins.insert(origin);
new_display_info_list.push_back(*iter);
}
+
+ const gfx::Size& resolution = iter->bounds_in_native().size();
+ const std::vector<Resolution>& resolutions = iter->resolutions();
+ // This is empty the displays are initialized from InitFromCommandLine.
+ if (!resolutions.size())
+ continue;
+ std::vector<Resolution>::const_iterator resolution_iter =
+ std::find_if(resolutions.begin(),
+ resolutions.end(),
+ ResolutionMatcher(resolution));
+ // Update the actual resolution selected as the resolution request may fail.
+ if (resolution_iter == resolutions.begin())
+ resolutions_.erase(iter->id());
+ else if (resolutions_.find(iter->id()) != resolutions_.end())
+ resolutions_[iter->id()] = resolution;
}
if (HasInternalDisplay() &&
!internal_display_connected &&
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698