| Index: chrome/browser/chromeos/printing/specifics_translation.cc
|
| diff --git a/chrome/browser/chromeos/printing/specifics_translation.cc b/chrome/browser/chromeos/printing/specifics_translation.cc
|
| index 6f5cbae08387434ebea3d3826f6d666bcf82a73a..4719092f42219221ea3a5c14088d49f8ac1bcb41 100644
|
| --- a/chrome/browser/chromeos/printing/specifics_translation.cc
|
| +++ b/chrome/browser/chromeos/printing/specifics_translation.cc
|
| @@ -21,24 +21,30 @@ namespace {
|
| Printer::PpdReference SpecificsToPpd(
|
| const sync_pb::PrinterPPDReference& specifics) {
|
| Printer::PpdReference ref;
|
| - if (specifics.has_user_supplied_ppd_url()) {
|
| + if (specifics.autoconf()) {
|
| + ref.autoconf = specifics.autoconf();
|
| + } else if (specifics.has_user_supplied_ppd_url()) {
|
| ref.user_supplied_ppd_url = specifics.user_supplied_ppd_url();
|
| - }
|
| -
|
| - if (specifics.has_effective_make_and_model()) {
|
| + } else if (specifics.has_effective_make_and_model()) {
|
| ref.effective_make_and_model = specifics.effective_make_and_model();
|
| }
|
|
|
| return ref;
|
| }
|
|
|
| +// Overwrite fields in |specifics| with an appropriately filled field from
|
| +// |ref|. If |ref| is the default object, nothing will be changed in
|
| +// |specifics|.
|
| void MergeReferenceToSpecifics(sync_pb::PrinterPPDReference* specifics,
|
| const Printer::PpdReference& ref) {
|
| - if (!ref.user_supplied_ppd_url.empty()) {
|
| + if (ref.autoconf) {
|
| + specifics->Clear();
|
| + specifics->set_autoconf(ref.autoconf);
|
| + } else if (!ref.user_supplied_ppd_url.empty()) {
|
| + specifics->Clear();
|
| specifics->set_user_supplied_ppd_url(ref.user_supplied_ppd_url);
|
| - }
|
| -
|
| - if (!ref.effective_make_and_model.empty()) {
|
| + } else if (!ref.effective_make_and_model.empty()) {
|
| + specifics->Clear();
|
| specifics->set_effective_make_and_model(ref.effective_make_and_model);
|
| }
|
| }
|
|
|