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

Unified Diff: ash/display/display_info.cc

Issue 22662005: Don't remember best resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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_info.h ('k') | ash/display/display_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_info.cc
diff --git a/ash/display/display_info.cc b/ash/display/display_info.cc
index 8f71e6d0c8014e4f2e4a449e00d797519e44d94b..5e89a0d97f6e640685711cabaaee73165f1ec6d9 100644
--- a/ash/display/display_info.cc
+++ b/ash/display/display_info.cc
@@ -96,6 +96,20 @@ DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec,
&device_scale_factor) >= 4) {
bounds_in_pixel.SetRect(x, y, width, height);
}
+
+ std::vector<Resolution> resolutions;
+ if (Tokenize(main_spec, "#", &parts) == 2) {
+ main_spec = parts[0];
+ std::string resolution_list = parts[1];
+ count = Tokenize(resolution_list, "|", &parts);
+ for (size_t i = 0; i < count; ++i) {
+ std::string resolution = parts[i];
+ int width, height;
+ if (sscanf(resolution.c_str(), "%dx%d", &width, &height) == 2)
+ resolutions.push_back(Resolution(gfx::Size(width, height), false));
+ }
+ }
+
if (id == gfx::Display::kInvalidDisplayID)
id = synthesized_display_id++;
DisplayInfo display_info(
@@ -104,6 +118,7 @@ DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec,
display_info.set_rotation(rotation);
display_info.set_ui_scale(ui_scale);
display_info.SetBounds(bounds_in_pixel);
+ display_info.set_resolutions(resolutions);
// To test the overscan, it creates the default 5% overscan.
if (has_overscan) {
« no previous file with comments | « ash/display/display_info.h ('k') | ash/display/display_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698