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

Unified Diff: ash/display/display_info.h

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.h
diff --git a/ash/display/display_info.h b/ash/display/display_info.h
index a679a73807bfbf021b353f62fa95951657a833ae..ebed376739041133ecb52e690eeb65f15f678e63 100644
--- a/ash/display/display_info.h
+++ b/ash/display/display_info.h
@@ -6,6 +6,7 @@
#define ASH_DISPLAY_DISPLAY_INFO_H_
#include <string>
+#include <vector>
#include "ash/ash_export.h"
#include "base/gtest_prod_util.h"
@@ -16,6 +17,14 @@
namespace ash {
namespace internal {
+// A struct that represents the display's resolution and
+// interlaced info.
+struct ASH_EXPORT Resolution {
+ Resolution(const gfx::Size& s, bool i);
Daniel Erat 2013/07/31 17:34:05 nit: name parameters 'size' and 'interlaced' inste
oshima 2013/07/31 21:59:49 Done. I'll keept the constructor in .cc as this ha
+ gfx::Size size;
+ bool interlaced;
+};
+
// DisplayInfo contains metadata for each display. This is used to
// create |gfx::Display| as well as to maintain extra infomation
// to manage displays in ash environment.
@@ -114,9 +123,21 @@ class ASH_EXPORT DisplayInfo {
void set_native(bool native) { native_ = native; }
bool native() const { return native_; }
- // Returns a string representation of the DisplayInfo;
+ const std::vector<Resolution>& resolutions() const {
+ return resolutions_;
+ }
+ void set_resolutions(std::vector<Resolution>& resolution) {
+ resolutions_.swap(resolution);
+ }
+
+ // Returns a string representation of the DisplayInfo
+ // excluding resolutions.
std::string ToString() const;
+ // Returns a string representation of the DisplayInfo
+ // including resolutions.
+ std::string ToFullString() const;
+
private:
int64 id_;
std::string name_;
@@ -134,6 +155,9 @@ class ASH_EXPORT DisplayInfo {
// True if this comes from native platform (DisplayChangeObserverX11).
bool native_;
+
+ // The list of resolutions supported by this display.
+ std::vector<Resolution> resolutions_;
};
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698