Chromium Code Reviews| Index: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js |
| diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7efe50f1019284675bb92383bbb69116b4a8ba99 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** 'add-printers-list' is the list of discovered printers. */ |
| +Polymer({ |
| + is: 'add-printer-list', |
| + |
| + properties: { |
| + /** @type {!Array<!CupsPrinterInfo>} */ |
| + printers: { |
| + type: Array, |
| + notify: true, |
| + }, |
| + |
| + /** @type {!CupsPrinterInfo} */ |
| + selectedPrinter: { |
| + type: Object, |
| + notify: true, |
| + }, |
| + }, |
| + |
| + /** |
| + * @param {{model:Object}} event |
| + * @private |
| + */ |
| + onSelect_: function(event) { |
| + this.selectedPrinter = event.model.item; |
| + }, |
| +}); |
| + |
| +/** 'add-printer-dialog-template' is the template of the Add Printer dialog. */ |
| +Polymer({ |
| + is: 'add-printer-dialog-template', |
|
michaelpg
2016/08/29 17:10:33
please find another name -- <template> has a very
xdai1
2016/08/29 18:45:45
Done.
|
| + |
| + /** @private */ |
| + attached: function() { |
| + this.$$('#dialog').showModal(); |
|
michaelpg
2016/08/29 17:10:33
this.$.dialog
xdai1
2016/08/29 18:45:45
Done.
|
| + }, |
| + |
| + close: function() { |
| + this.$$('#dialog').close(); |
|
michaelpg
2016/08/29 17:10:33
same
xdai1
2016/08/29 18:45:45
Done.
|
| + }, |
| +}); |