Commit b09439cf authored by xdai's avatar xdai Committed by Commit bot

[CUPS] Implement Advanced section in CUPS printer details page.

BUG=626752
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2264673002
Cr-Commit-Position: refs/heads/master@{#414193}
parent 0385e56b
......@@ -750,6 +750,15 @@
<message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_DETAILS_TITLE" desc="Text for the title of the Printer Details subpage.">
Printer details
</message>
<message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED" desc="Label for the toggle control to show/hide the advanced details of the printer.">
Advanced
</message>
<message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED_ADDRESS" desc="Label for the CUPS printer address in the Advanced section in the printer details page.">
Address
</message>
<message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED_PROTOCOL" desc="Label for the CUPS printer protocol in the Advanced section in the printer details page.">
Protocol
</message>
<message name="IDS_SETTINGS_PRINTING_CUPS_PRINTER_DETAILS_NAME" desc="Lable for the CUPS printer name in the printer details page.">
Name
</message>
......
<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
<link rel="import" href="/settings_shared_css.html">
......@@ -30,6 +32,31 @@
<div class="secondary">[[printer.printerModel]]</div>
</div>
</div>
<!-- TODO(xdai): Add printerStatus. -->
<!-- Advanced toggle -->
<div class="settings-box" actionable on-tap="toggleAdvancedExpanded_">
<div class="start">$i18n{printerDetailsAdvanced}</div>
<cr-expand-button id="expandButton" expanded="{{advancedExpanded}}">
</cr-expand-button>
</div>
<!-- Advanced section -->
<iron-collapse opened="[[advancedExpanded]]">
<div class="list-frame vertical-list">
<div class="list-item setting-box two-line">
<div class="start">
<div>$i18n{printerAddress}</div>
<div class="secondary">[[printer.printerAddress]]</div>
</div>
</div>
<div class="list-item setting-box two-line">
<div class="start">
<div>$i18n{printerProtocol}</div>
<div class="secondary">[[printer.printerProtocol]]</div>
</div>
</div>
</div>
</iron-collapse>
</template>
<script src="cups_printer_details_page.js"></script>
</dom-module>
......@@ -15,6 +15,11 @@ Polymer({
type: Object,
notify: true,
},
advancedExpanded: {
type: Boolean,
value: false,
},
},
/** @private {settings.CupsPrintersBrowserProxy} */
......@@ -33,4 +38,14 @@ Polymer({
this.browserProxy_.updateCupsPrinter(this.printer.printerId,
this.printer.printerName);
},
/**
* @param {Event} event
* @private
*/
toggleAdvancedExpanded_: function(event) {
if (event.target.id == 'expandButton')
return; // Already handled.
this.advancedExpanded = !this.advancedExpanded;
},
});
......@@ -1000,6 +1000,9 @@ void AddPrintingStrings(content::WebUIDataSource* html_source) {
{"addPrinterTitle", IDS_SETTINGS_PRINTING_CUPS_ADD_PRINTER_TITLE},
{"cancelButtonText", IDS_SETTINGS_PRINTING_CUPS_ADD_PRINTER_BUTTON_CANCEL},
{"addPrinterButtonText", IDS_SETTINGS_PRINTING_CUPS_ADD_PRINTER_BUTTON_ADD},
{"printerDetailsAdvanced", IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED},
{"printerAddress", IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED_ADDRESS},
{"printerProtocol", IDS_SETTINGS_PRINTING_CUPS_PRINTER_ADVANCED_PROTOCOL},
#endif
};
AddLocalizedStringsBulk(html_source, localized_strings,
......
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