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

Unified Diff: chromeos/printing/printer_configuration.cc

Issue 2459943002: Use printer id to populate CUPS instead of printer name. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/printing/printer_configuration.cc
diff --git a/chromeos/printing/printer_configuration.cc b/chromeos/printing/printer_configuration.cc
index 12d860f9beb71ccdab93978a470e2c4da868bbf2..3101d15ee9c12cd5afea5cce9abd746514791299 100644
--- a/chromeos/printing/printer_configuration.cc
+++ b/chromeos/printing/printer_configuration.cc
@@ -6,11 +6,18 @@
#include <string>
+#include "base/guid.h"
+
namespace chromeos {
-Printer::Printer() {}
+Printer::Printer() {
+ id_ = base::GenerateGUID();
+}
-Printer::Printer(const std::string& id) : id_(id) {}
+Printer::Printer(const std::string& id) : id_(id) {
+ if (id_.empty())
+ id_ = base::GenerateGUID();
+}
Printer::Printer(const Printer& other) = default;
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698