OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview 'settings-cups-printer-details-page' is the subpage for | 6 * @fileoverview 'settings-cups-printer-details-page' is the subpage for |
7 * viewing the details of a CUPS printer. | 7 * viewing the details of a CUPS printer. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-cups-printer-details-page', | 10 is: 'settings-cups-printer-details-page', |
11 | 11 |
12 properties: { | 12 properties: { |
13 /** @type {!CupsPrinterInfo} */ | 13 /** @type {!CupsPrinterInfo} */ |
14 printer: { | 14 printer: { |
15 type: Object, | 15 type: Object, |
16 notify: true, | 16 notify: true, |
17 }, | 17 }, |
| 18 |
| 19 advancedExpanded: { |
| 20 type: Boolean, |
| 21 value: false, |
| 22 }, |
18 }, | 23 }, |
19 | 24 |
20 /** @private {settings.CupsPrintersBrowserProxy} */ | 25 /** @private {settings.CupsPrintersBrowserProxy} */ |
21 browserProxy_: null, | 26 browserProxy_: null, |
22 | 27 |
23 /** @override */ | 28 /** @override */ |
24 created: function() { | 29 created: function() { |
25 this.browserProxy_ = settings.CupsPrintersBrowserProxyImpl.getInstance(); | 30 this.browserProxy_ = settings.CupsPrintersBrowserProxyImpl.getInstance(); |
26 }, | 31 }, |
27 | 32 |
28 /** | 33 /** |
29 * Event triggered when the input value changes. | 34 * Event triggered when the input value changes. |
30 * @private | 35 * @private |
31 */ | 36 */ |
32 onValueChanged_: function() { | 37 onValueChanged_: function() { |
33 this.browserProxy_.updateCupsPrinter(this.printer.printerId, | 38 this.browserProxy_.updateCupsPrinter(this.printer.printerId, |
34 this.printer.printerName); | 39 this.printer.printerName); |
35 }, | 40 }, |
| 41 |
| 42 /** |
| 43 * @param {Event} event |
| 44 * @private |
| 45 */ |
| 46 toggleAdvancedExpanded_: function(event) { |
| 47 if (event.target.id == 'expandButton') |
| 48 return; // Already handled. |
| 49 this.advancedExpanded = !this.advancedExpanded; |
| 50 }, |
36 }); | 51 }); |
OLD | NEW |