Index: chrome/browser/chromeos/printing/specifics_translation.h |
diff --git a/chrome/browser/chromeos/printing/specifics_translation.h b/chrome/browser/chromeos/printing/specifics_translation.h |
index 382f766c3c7fec1253f1decdc23d154eacfa158a..386b944b5bdad9e145a4a85a861c9f5d00ae67ca 100644 |
--- a/chrome/browser/chromeos/printing/specifics_translation.h |
+++ b/chrome/browser/chromeos/printing/specifics_translation.h |
@@ -13,13 +13,21 @@ |
namespace chromeos { |
namespace printing { |
+// Convert |printer| into its local representation. Enforces that only one |
+// field in PpdReference is filled in. In order of preference, we populate |
+// autoconf, user_supplied_ppd_url, or effective_make_and_model. |
std::unique_ptr<Printer> SpecificsToPrinter( |
const sync_pb::PrinterSpecifics& printer); |
+// Convert |printer| into its proto representation. |
std::unique_ptr<sync_pb::PrinterSpecifics> PrinterToSpecifics( |
const Printer& printer); |
-// Merge fields from |printer| into |specifics|. |
+// Merge fields from |printer| into |specifics|. Merge strategy is to only |
+// write non-default fields from |printer| into the appropriate field in |
+// |specifics|. Default fields are skipped to prevent accidentally clearing |
+// |specifics|. Enforces field exclusivity in PpdReference as described in |
+// SpecificsToPrinter. |
void MergePrinterToSpecifics(const Printer& printer, |
sync_pb::PrinterSpecifics* specifics); |