Commit 01c26cb9 authored by Jimmy Gong's avatar Jimmy Gong Committed by Commit Bot

Include printer name for the make/model dialog subtext

- Previously, only discovered printers would show the subtext in the
  make/model dialog.
- This change will enable the subtext in the make/model dialog for manual
  printers.

Bug: 955130
Test: end to end manual
Change-Id: If1421bc0db890bdd8e66aa93abf0dc1a4e007289
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635852Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Commit-Queue: jimmy gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665688}
parent f089e106
...@@ -172,16 +172,16 @@ ...@@ -172,16 +172,16 @@
<style include="cups-printer-shared"> <style include="cups-printer-shared">
.subtext { .subtext {
margin-bottom: 10px; margin-bottom: 10px;
padding-inline-end: 20px;
padding-inline-start: 20px; padding-inline-start: 20px;
} }
</style> </style>
<add-printer-dialog> <add-printer-dialog>
<div slot="dialog-title">$i18n{manufacturerAndModelDialogTitle}</div> <div slot="dialog-title">$i18n{manufacturerAndModelDialogTitle}</div>
<div slot="dialog-body"> <div slot="dialog-body">
<div class="subtext" id="makeModelTextInfo" <div class="subtext" id="makeModelTextInfo">
hidden="[[!activePrinter.printerMakeAndModel]]"> <span>[[getManufacturerAndModelSubtext_(activePrinter.*)]]
<span>[[getManufacturerAndModelSubtext_( </span>
activePrinter.printerMakeAndModel)]]</span>
<a href="$i18n{printingCUPSPrintLearnMoreUrl}" target="_blank"> <a href="$i18n{printingCUPSPrintLearnMoreUrl}" target="_blank">
$i18n{learnMore} $i18n{learnMore}
</a> </a>
......
...@@ -263,14 +263,21 @@ Polymer({ ...@@ -263,14 +263,21 @@ Polymer({
}, },
/** /**
* @param {string} printerMakeAndModel * If the printer is a nearby printer, return make + model with the subtext.
* Otherwise, return printer name.
* @return {string} The additional information subtext of the manufacturer and * @return {string} The additional information subtext of the manufacturer and
* model dialog. * model dialog.
* @private * @private
*/ */
getManufacturerAndModelSubtext_: function(printerMakeAndModel) { getManufacturerAndModelSubtext_: function() {
if (this.activePrinter.printerMakeAndModel) {
return loadTimeData.getStringF(
'manufacturerAndModelAdditionalInformation',
this.activePrinter.printerMakeAndModel);
}
return loadTimeData.getStringF( return loadTimeData.getStringF(
'manufacturerAndModelAdditionalInformation', printerMakeAndModel); 'manufacturerAndModelAdditionalInformation',
this.activePrinter.printerName);
}, },
/** /**
......
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