1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// Copyright 2019 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.
/**
* @fileoverview 'settings-cups-printers-entry' is a component that holds a
* printer.
*/
Polymer({
is: 'settings-cups-printers-entry',
properties: {
/** @type {!PrinterListEntry} */
printerEntry: Object,
/**
* TODO(jimmyxgong): Determine how subtext should be set and what
* information it should have.
* The additional information subtext for a printer.
* @type {string}
*/
subtext: {type: String, value: ''},
},
/**
* Fires a custom event when the menu button is clicked. Sends the details of
* the printer and where the menu should appear.
*/
onOpenActionMenuTap_: function(e) {
this.fire('open-action-menu', {
target: e.target,
item: this.printerEntry,
});
},
onOpenManufacturerModelDialogTap_: function(e) {
this.fire('open-manufacturer-model-dialog-for-specified-printer',
{item: this.printerEntry.printerInfo});
},
onAddAutomaticPrinterTap_: function() {
this.fire('add-automatic-printer', {item: this.printerEntry});
},
/**
* @return {boolean}
* @private
*/
isSavedPrinter_: function() {
return this.printerEntry.printerType == PrinterType.SAVED;
},
/**
* @return {boolean}
* @private
*/
isDiscoveredPrinter_: function() {
return this.printerEntry.printerType == PrinterType.DISCOVERED;
},
/**
* @return {boolean}
* @private
*/
isAutomaticPrinter_: function() {
return this.printerEntry.printerType == PrinterType.AUTOMATIC;
}
});
|