OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Closure compiler won't let this be declared inside cr.define(). | 5 // Closure compiler won't let this be declared inside cr.define(). |
6 /** @enum {string} */ | 6 /** @enum {string} */ |
7 var SourceType = { | 7 var SourceType = { |
8 WEBSTORE: 'webstore', | 8 WEBSTORE: 'webstore', |
9 POLICY: 'policy', | 9 POLICY: 'policy', |
10 SIDELOADED: 'sideloaded', | 10 SIDELOADED: 'sideloaded', |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 */ | 55 */ |
56 inspectItemView: assertNotReached, | 56 inspectItemView: assertNotReached, |
57 | 57 |
58 /** @param {string} id */ | 58 /** @param {string} id */ |
59 repairItem: assertNotReached, | 59 repairItem: assertNotReached, |
60 }; | 60 }; |
61 | 61 |
62 var Item = Polymer({ | 62 var Item = Polymer({ |
63 is: 'extensions-item', | 63 is: 'extensions-item', |
64 | 64 |
| 65 behaviors: [I18nBehavior], |
| 66 |
65 properties: { | 67 properties: { |
66 // The item's delegate, or null. | 68 // The item's delegate, or null. |
67 delegate: { | 69 delegate: { |
68 type: Object, | 70 type: Object, |
69 }, | 71 }, |
70 | 72 |
71 // Whether or not dev mode is enabled. | 73 // Whether or not dev mode is enabled. |
72 inDevMode: { | 74 inDevMode: { |
73 type: Boolean, | 75 type: Boolean, |
74 value: false, | 76 value: false, |
75 }, | 77 }, |
76 | 78 |
77 // Whether or not the expanded view of the item is shown. | |
78 showingDetails_: { | |
79 type: Boolean, | |
80 value: false, | |
81 }, | |
82 | |
83 // The underlying ExtensionInfo itself. Public for use in declarative | 79 // The underlying ExtensionInfo itself. Public for use in declarative |
84 // bindings. | 80 // bindings. |
85 /** @type {chrome.developerPrivate.ExtensionInfo} */ | 81 /** @type {chrome.developerPrivate.ExtensionInfo} */ |
86 data: { | 82 data: { |
87 type: Object, | 83 type: Object, |
88 }, | 84 }, |
| 85 |
| 86 // Whether or not the expanded view of the item is shown. |
| 87 /** @private */ |
| 88 showingDetails_: { |
| 89 type: Boolean, |
| 90 value: false, |
| 91 }, |
89 }, | 92 }, |
90 | 93 |
91 behaviors: [ | |
92 I18nBehavior, | |
93 ], | |
94 | |
95 observers: [ | 94 observers: [ |
96 'observeIdVisibility_(inDevMode, showingDetails_, data.id)', | 95 'observeIdVisibility_(inDevMode, showingDetails_, data.id)', |
97 ], | 96 ], |
98 | 97 |
99 /** @private */ | 98 /** @private */ |
100 observeIdVisibility_: function(inDevMode, showingDetails, id) { | 99 observeIdVisibility_: function(inDevMode, showingDetails, id) { |
101 Polymer.dom.flush(); | 100 Polymer.dom.flush(); |
102 var idElement = this.$$('#extension-id'); | 101 var idElement = this.$$('#extension-id'); |
103 if (idElement) { | 102 if (idElement) { |
104 assert(this.data); | 103 assert(this.data); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return this.data.blacklistText ? 'severe' : 'mild'; | 250 return this.data.blacklistText ? 'severe' : 'mild'; |
252 }, | 251 }, |
253 }); | 252 }); |
254 | 253 |
255 return { | 254 return { |
256 Item: Item, | 255 Item: Item, |
257 ItemDelegate: ItemDelegate, | 256 ItemDelegate: ItemDelegate, |
258 }; | 257 }; |
259 }); | 258 }); |
260 | 259 |
OLD | NEW |