Commit f63817e2 authored by Kalvin Lee's avatar Kalvin Lee Committed by Commit Bot

printing: use ty field

This change modifies the ZeroconfPrinterDetector to use the ty
field specified in the ParsedMetadata class (instead of the
product field) when calling Printer::set_make_and_model().

Bug: chromium:1062865
Fixed: chromium:1062865
Test: chromeos_unittests
Change-Id: I7b1b742b402843cfa6e2d43f6318085ff578b2bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399572Reviewed-by: default avatarSean Kau <skau@chromium.org>
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805942}
parent 371a7d82
...@@ -154,7 +154,7 @@ bool ConvertToPrinter(const std::string& service_type, ...@@ -154,7 +154,7 @@ bool ConvertToPrinter(const std::string& service_type,
printer.set_uuid(metadata.UUID); printer.set_uuid(metadata.UUID);
printer.set_display_name(service_description.instance_name()); printer.set_display_name(service_description.instance_name());
printer.set_description(metadata.note); printer.set_description(metadata.note);
printer.set_make_and_model(metadata.product); printer.set_make_and_model(metadata.ty);
Uri uri; Uri uri;
std::string rp = metadata.rp; std::string rp = metadata.rp;
if (service_type == ZeroconfPrinterDetector::kIppServiceName || if (service_type == ZeroconfPrinterDetector::kIppServiceName ||
......
...@@ -104,10 +104,10 @@ PrinterDetector::DetectedPrinter MakeExpectedPrinter(const std::string& name, ...@@ -104,10 +104,10 @@ PrinterDetector::DetectedPrinter MakeExpectedPrinter(const std::string& name,
printer.set_uuid(base::StrCat({name, "_UUID"})); printer.set_uuid(base::StrCat({name, "_UUID"}));
printer.set_display_name(name); printer.set_display_name(name);
printer.set_description(base::StrCat({name, "_note"})); printer.set_description(base::StrCat({name, "_note"}));
printer.set_make_and_model(base::StrCat({name, "_product"})); printer.set_make_and_model(base::StrCat({name, "_ty"}));
detected.ppd_search_data.make_and_model.push_back(
base::StrCat({name, "_ty"}));
detected.ppd_search_data.make_and_model.push_back(printer.make_and_model()); detected.ppd_search_data.make_and_model.push_back(printer.make_and_model());
detected.ppd_search_data.make_and_model.push_back(
base::StrCat({name, "_product"}));
if (GetUsbFor(name)) { if (GetUsbFor(name)) {
// We should get an effective make and model guess from the usb fields // We should get an effective make and model guess from the usb fields
// if they exist. // if they exist.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment