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 Polymer({ | 5 Polymer({ |
6 is: 'settings-printing-page', | 6 is: 'settings-printing-page', |
7 | 7 |
8 properties: { | 8 properties: { |
9 /** Preferences state. */ | 9 /** Preferences state. */ |
10 prefs: { | 10 prefs: { |
11 type: Object, | 11 type: Object, |
12 notify: true, | 12 notify: true, |
13 }, | 13 }, |
14 | 14 |
15 // <if expr="chromeos"> | 15 // <if expr="chromeos"> |
16 /** | 16 /** |
17 * Whether to show CUPS printers settings. | 17 * Whether to show CUPS printers settings. |
18 * @private {boolean} | 18 * @private {boolean} |
19 */ | 19 */ |
20 showCupsPrintingFeatures_: { | 20 showCupsPrintingFeatures_: { |
21 type: Boolean, | 21 type: Boolean, |
22 value: function() { | 22 value: function() { |
23 return loadTimeData.getBoolean('showCupsPrintingFeatures'); | 23 return loadTimeData.getBoolean('showCupsPrintingFeatures'); |
24 }, | 24 }, |
25 }, | 25 }, |
26 // </if> | 26 // </if> |
27 | 27 |
28 /** @type {!Array<!CupsPrinterInfo>} */ | 28 /** @type {!Array<!CupsPrinterInfo>} */ |
29 cupsPrinters: { | 29 cupsPrinters: { |
30 type: Array, | 30 type: Array, |
31 notify: true, | 31 notify: true, |
32 }, | 32 }, |
33 | 33 |
34 searchTerm: { | 34 searchTerm: { |
35 type: String, | 35 type: String, |
36 }, | 36 }, |
37 | 37 |
38 /** @private {!Map<string, string>} */ | 38 /** @private {!Map<string, string>} */ |
39 focusConfig_: { | 39 focusConfig_: { |
40 type: Object, | 40 type: Object, |
41 value: function() { | 41 value: function() { |
42 var map = new Map(); | 42 var map = new Map(); |
43 map.set( | 43 map.set( |
44 settings.Route.CLOUD_PRINTERS.path, | 44 settings.Route.CLOUD_PRINTERS.path, |
45 '#cloudPrinters .subpage-arrow'); | 45 '#cloudPrinters .subpage-arrow'); |
46 // <if expr="chromeos"> | 46 // <if expr="chromeos"> |
47 map.set( | 47 map.set( |
48 settings.Route.CUPS_PRINTERS.path, '#cupsPrinters .subpage-arrow'); | 48 settings.Route.CUPS_PRINTERS.path, '#cupsPrinters .subpage-arrow'); |
49 // </if> | 49 // </if> |
50 return map; | 50 return map; |
51 }, | 51 }, |
52 }, | 52 }, |
53 }, | 53 }, |
54 | 54 |
55 listeners: { | 55 listeners: { |
56 'show-cups-printer-details': 'onShowCupsPrinterDetailsPage_', | 56 'show-cups-printer-details': 'onShowCupsPrinterDetailsPage_', |
57 }, | 57 }, |
58 | 58 |
59 // <if expr="chromeos"> | 59 // <if expr="chromeos"> |
60 /** @private */ | 60 /** @private */ |
61 onTapCupsPrinters_: function() { | 61 onTapCupsPrinters_: function() { |
62 settings.navigateTo(settings.Route.CUPS_PRINTERS); | 62 settings.navigateTo(settings.Route.CUPS_PRINTERS); |
63 }, | 63 }, |
64 | 64 |
65 /** @private */ | 65 /** @private */ |
66 onShowCupsPrinterDetailsPage_: function(event) { | 66 onShowCupsPrinterDetailsPage_: function(event) { |
67 settings.navigateTo(settings.Route.CUPS_PRINTER_DETAIL); | 67 settings.navigateTo(settings.Route.CUPS_PRINTER_DETAIL); |
68 this.$.arraySelector.select(event.detail); | 68 this.$.arraySelector.select(event.detail); |
69 }, | 69 }, |
70 // </if> | 70 // </if> |
71 | 71 |
72 /** @private */ | 72 /** @private */ |
73 onTapCloudPrinters_: function() { | 73 onTapCloudPrinters_: function() { |
74 settings.navigateTo(settings.Route.CLOUD_PRINTERS); | 74 settings.navigateTo(settings.Route.CLOUD_PRINTERS); |
75 }, | 75 }, |
76 }); | 76 }); |
OLD | NEW |