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

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: 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
Index: ash/display/display_info.cc
diff --git a/ash/display/display_info.cc b/ash/display/display_info.cc
index d886a5962a19c1150bf05199ac2adb6cfe824f92..52cf32a28a2ac517b75ac0cde75a2eda9bd97b79 100644
--- a/ash/display/display_info.cc
+++ b/ash/display/display_info.cc
@@ -22,6 +22,10 @@
namespace ash {
namespace internal {
+Resolution::Resolution(const gfx::Size& s, bool i)
+ : size(s), interlaced(i) {
Daniel Erat 2013/07/31 17:34:05 nit: one member per line if they don't all fit on
oshima 2013/07/31 21:59:49 Done.
+}
+
// satic
DisplayInfo DisplayInfo::CreateFromSpec(const std::string& spec) {
return CreateFromSpecWithID(spec, gfx::Display::kInvalidDisplayID);
@@ -148,6 +152,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 +219,16 @@ 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) {
+ resolutions_str += "," + iter->size.ToString();
Daniel Erat 2013/07/31 17:34:05 shouldn't you test for !resolutions_str.empty() be
oshima 2013/07/31 21:59:49 Done.
+ if (iter->interlaced)
+ resolutions_str += "(i)";
+ }
+ return ToString() + ", resolutions=" + resolutions_str;
+}
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698