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

Unified Diff: ui/display/util/x11/edid_parser_x11.cc

Issue 1671223002: Revert of Give user ability to file a feedback report from the display error notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « ui/display/util/x11/edid_parser_x11.h ('k') | ui/ozone/common/display_snapshot_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/util/x11/edid_parser_x11.cc
diff --git a/ui/display/util/x11/edid_parser_x11.cc b/ui/display/util/x11/edid_parser_x11.cc
index 01b6f00e94b9c06b662a00ed753526b817d41c7d..13059f0fea1a4abf4c09fa0d4a37c73429597da4 100644
--- a/ui/display/util/x11/edid_parser_x11.cc
+++ b/ui/display/util/x11/edid_parser_x11.cc
@@ -75,35 +75,48 @@
return true;
}
+// Gets some useful data from the specified output device, such like
+// manufacturer's ID, product code, and human readable name. Returns false if it
+// fails to get those data and doesn't touch manufacturer ID/product code/name.
+// nullptr can be passed for unwanted output parameters.
+bool GetOutputDeviceData(XID output,
+ uint16_t* manufacturer_id,
+ std::string* human_readable_name) {
+ std::vector<uint8_t> edid;
+ if (!GetEDIDProperty(output, &edid))
+ return false;
+
+ return ParseOutputDeviceData(edid, manufacturer_id, nullptr,
+ human_readable_name, nullptr, nullptr);
+}
+
} // namespace
-EDIDParserX11::EDIDParserX11(XID output_id)
- : output_id_(output_id) {
- GetEDIDProperty(output_id_, &edid_);
+bool GetDisplayId(XID output_id,
+ uint8_t output_index,
+ int64_t* display_id_out) {
+ std::vector<uint8_t> edid;
+ if (!GetEDIDProperty(output_id, &edid))
+ return false;
+
+ bool result =
+ GetDisplayIdFromEDID(edid, output_index, display_id_out, nullptr);
+ return result;
}
-EDIDParserX11::~EDIDParserX11() {
-}
-
-bool EDIDParserX11::GetDisplayId(uint8_t index, int64_t* out_display_id) const {
- if (edid_.empty())
- return false;
-
- return GetDisplayIdFromEDID(edid_, index, out_display_id, nullptr);
-}
-
-std::string EDIDParserX11::GetDisplayName() const {
+std::string GetDisplayName(RROutput output) {
std::string display_name;
- ParseOutputDeviceData(edid_, nullptr, nullptr, &display_name, nullptr,
- nullptr);
+ GetOutputDeviceData(output, nullptr, &display_name);
return display_name;
}
-bool EDIDParserX11::GetOutputOverscanFlag(bool* out_flag) const {
- if (edid_.empty())
+bool GetOutputOverscanFlag(RROutput output, bool* flag) {
+ std::vector<uint8_t> edid;
+ if (!GetEDIDProperty(output, &edid))
return false;
- return ParseOutputOverscanFlag(edid_, out_flag);
+ bool found = ParseOutputOverscanFlag(edid, flag);
+ return found;
}
} // namespace ui
« no previous file with comments | « ui/display/util/x11/edid_parser_x11.h ('k') | ui/ozone/common/display_snapshot_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698