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

Unified Diff: ash/display/display_info.cc

Issue 21297003: Add ability to set resolution on external display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adraddressed comment, adjusted test Created 7 years, 5 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_manager.h » ('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 d886a5962a19c1150bf05199ac2adb6cfe824f92..8f71e6d0c8014e4f2e4a449e00d797519e44d94b 100644
--- a/ash/display/display_info.cc
+++ b/ash/display/display_info.cc
@@ -22,6 +22,11 @@
namespace ash {
namespace internal {
+Resolution::Resolution(const gfx::Size& size, bool interlaced)
+ : size(size),
+ interlaced(interlaced) {
+}
+
// satic
DisplayInfo DisplayInfo::CreateFromSpec(const std::string& spec) {
return CreateFromSpecWithID(spec, gfx::Display::kInvalidDisplayID);
@@ -148,6 +153,7 @@ void DisplayInfo::Copy(const DisplayInfo& native_info) {
bounds_in_pixel_ = native_info.bounds_in_pixel_;
size_in_pixel_ = native_info.size_in_pixel_;
device_scale_factor_ = native_info.device_scale_factor_;
+ resolutions_ = native_info.resolutions_;
// Copy overscan_insets_in_dip_ if it's not empty. This is for test
// cases which use "/o" annotation which sets the overscan inset
@@ -214,5 +220,18 @@ std::string DisplayInfo::ToString() const {
ui_scale_);
}
+std::string DisplayInfo::ToFullString() const {
+ std::string resolutions_str;
+ std::vector<Resolution>::const_iterator iter = resolutions_.begin();
+ for (; iter != resolutions_.end(); ++iter) {
+ if (!resolutions_str.empty())
+ resolutions_str += ",";
+ resolutions_str += iter->size.ToString();
+ if (iter->interlaced)
+ resolutions_str += "(i)";
+ }
+ return ToString() + ", resolutions=" + resolutions_str;
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/display/display_info.h ('k') | ash/display/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698