Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4611)

Unified Diff: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js

Issue 2281353002: [CUPS] Implement the Add Printer dialogs. (Closed)
Patch Set: Address michaelpg@'s comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d27c65f58a8384b4ef2a1f0e96dc2630d86f095d
--- /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' is the template of the Add Printer dialog. */
+Polymer({
+ is: 'add-printer-dialog',
+
+ /** @private */
+ attached: function() {
+ this.$.dialog.showModal();
+ },
+
+ close: function() {
+ this.$.dialog.close();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698