Index: ui/display/util/x11/edid_parser_x11.h |
diff --git a/ui/display/util/x11/edid_parser_x11.h b/ui/display/util/x11/edid_parser_x11.h |
index 55048e699e4a26c1cdbe3b57082c18f606e0fac8..43f8cd1a48fe8c0564b6259495b289f789959466 100644 |
--- a/ui/display/util/x11/edid_parser_x11.h |
+++ b/ui/display/util/x11/edid_parser_x11.h |
@@ -8,7 +8,9 @@ |
#include <stdint.h> |
#include <string> |
+#include <vector> |
+#include "base/macros.h" |
#include "ui/display/types/display_constants.h" |
#include "ui/display/util/display_util_export.h" |
@@ -19,21 +21,39 @@ typedef XID RROutput; |
namespace ui { |
-// Gets the EDID data from |output| and generates the display id through |
-// |GetDisplayIdFromEDID|. |
-DISPLAY_UTIL_EXPORT bool GetDisplayId(XID output, |
- uint8_t index, |
- int64_t* display_id_out); |
- |
-// Generate the human readable string from EDID obtained from |output|. |
-DISPLAY_UTIL_EXPORT std::string GetDisplayName(RROutput output); |
- |
-// Gets the overscan flag from |output| and stores to |flag|. Returns true if |
-// the flag is found. Otherwise returns false and doesn't touch |flag|. The |
-// output will produce overscan if |flag| is set to true, but the output may |
-// still produce overscan even though it returns true and |flag| is set to |
-// false. |
-DISPLAY_UTIL_EXPORT bool GetOutputOverscanFlag(RROutput output, bool* flag); |
+// Xrandr utility class to help get EDID information. |
+class DISPLAY_UTIL_EXPORT EDIDParserX11 { |
+ public: |
+ EDIDParserX11(XID output_id); |
+ ~EDIDParserX11(); |
+ |
+ // Sets |out_display_id| to the display ID from the EDID of this output. |
+ // Returns true if successful, false otherwise. |
+ bool GetDisplayId(uint8_t index, int64_t* out_display_id) const; |
+ |
+ // Generate the human readable string from EDID obtained from |output|. |
+ // Returns an empty string upon error. |
+ std::string GetDisplayName() const; |
+ |
+ // Gets the overscan flag and stores to |out_flag|. Returns true if the flag |
+ // is found. Otherwise returns false and doesn't touch |out_flag|. The output |
+ // will produce overscan if |out_flag| is set to true, but the output may |
+ // still produce overscan even though it returns true and |out_flag| is set to |
+ // false. |
+ bool GetOutputOverscanFlag(bool* out_flag) const; |
+ |
+ XID output_id() const { return output_id_; } |
+ const std::vector<uint8_t>& edid() const { return edid_; } |
+ |
+ private: |
+ XID output_id_; |
+ |
+ // This will be an empty vector upon failure to get the EDID from the |
+ // |output_id_|. |
+ std::vector<uint8_t> edid_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(EDIDParserX11); |
+}; |
} // namespace ui |