OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <include src="extension_error.js"> | 5 <include src="extension_error.js"> |
6 | 6 |
7 /** | 7 /** |
8 * The type of the extension data object. The definition is based on | 8 * The type of the extension data object. The definition is based on |
9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc | 9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc |
10 * and | 10 * and |
(...skipping 18 matching lines...) Expand all Loading... |
29 * id: string, | 29 * id: string, |
30 * incognitoCanBeEnabled: boolean, | 30 * incognitoCanBeEnabled: boolean, |
31 * installWarnings: (Array|undefined), | 31 * installWarnings: (Array|undefined), |
32 * is_hosted_app: boolean, | 32 * is_hosted_app: boolean, |
33 * is_platform_app: boolean, | 33 * is_platform_app: boolean, |
34 * isUnpacked: boolean, | 34 * isUnpacked: boolean, |
35 * kioskEnabled: boolean, | 35 * kioskEnabled: boolean, |
36 * kioskOnly: boolean, | 36 * kioskOnly: boolean, |
37 * locationText: string, | 37 * locationText: string, |
38 * managedInstall: boolean, | 38 * managedInstall: boolean, |
| 39 * recommendedInstall: boolean, |
39 * manifestErrors: (Array.<RuntimeError>|undefined), | 40 * manifestErrors: (Array.<RuntimeError>|undefined), |
40 * name: string, | 41 * name: string, |
41 * offlineEnabled: boolean, | 42 * offlineEnabled: boolean, |
42 * optionsUrl: string, | 43 * optionsUrl: string, |
43 * order: number, | 44 * order: number, |
44 * packagedApp: boolean, | 45 * packagedApp: boolean, |
45 * path: (string|undefined), | 46 * path: (string|undefined), |
46 * prettifiedPath: (string|undefined), | 47 * prettifiedPath: (string|undefined), |
47 * runtimeErrors: (Array.<RuntimeError>|undefined), | 48 * runtimeErrors: (Array.<RuntimeError>|undefined), |
48 * suspiciousInstall: boolean, | 49 * suspiciousInstall: boolean, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 var node = template.cloneNode(true); | 162 var node = template.cloneNode(true); |
162 node.id = extension.id; | 163 node.id = extension.id; |
163 | 164 |
164 if (!extension.enabled || extension.terminated) | 165 if (!extension.enabled || extension.terminated) |
165 node.classList.add('inactive-extension'); | 166 node.classList.add('inactive-extension'); |
166 | 167 |
167 if (extension.managedInstall || | 168 if (extension.managedInstall || |
168 extension.dependentExtensions.length > 0) { | 169 extension.dependentExtensions.length > 0) { |
169 node.classList.add('may-not-modify'); | 170 node.classList.add('may-not-modify'); |
170 node.classList.add('may-not-remove'); | 171 node.classList.add('may-not-remove'); |
| 172 } else if (extension.recommendedInstall) { |
| 173 node.classList.add('may-not-remove'); |
171 } else if (extension.suspiciousInstall || extension.corruptInstall) { | 174 } else if (extension.suspiciousInstall || extension.corruptInstall) { |
172 node.classList.add('may-not-modify'); | 175 node.classList.add('may-not-modify'); |
173 } | 176 } |
174 | 177 |
175 var idToHighlight = this.getIdQueryParam_(); | 178 var idToHighlight = this.getIdQueryParam_(); |
176 if (node.id == idToHighlight) | 179 if (node.id == idToHighlight) |
177 node.classList.add('extension-highlight'); | 180 node.classList.add('extension-highlight'); |
178 | 181 |
179 var item = node.querySelector('.extension-list-item'); | 182 var item = node.querySelector('.extension-list-item'); |
180 // Prevent the image cache of extension icon by using the reloaded | 183 // Prevent the image cache of extension icon by using the reloaded |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 loadPath.hidden = false; | 383 loadPath.hidden = false; |
381 var pathLink = loadPath.querySelector('a:nth-of-type(1)'); | 384 var pathLink = loadPath.querySelector('a:nth-of-type(1)'); |
382 pathLink.textContent = ' ' + extension.prettifiedPath; | 385 pathLink.textContent = ' ' + extension.prettifiedPath; |
383 pathLink.addEventListener('click', function(e) { | 386 pathLink.addEventListener('click', function(e) { |
384 chrome.send('extensionSettingsShowPath', [String(extension.id)]); | 387 chrome.send('extensionSettingsShowPath', [String(extension.id)]); |
385 e.preventDefault(); | 388 e.preventDefault(); |
386 }); | 389 }); |
387 } | 390 } |
388 | 391 |
389 // Then the 'managed, cannot uninstall/disable' message. | 392 // Then the 'managed, cannot uninstall/disable' message. |
390 if (extension.managedInstall) { | 393 if (extension.managedInstall || extension.recommendedInstall) { |
391 node.querySelector('.managed-message').hidden = false; | 394 node.querySelector('.managed-message').hidden = false; |
392 } else { | 395 } else { |
393 if (extension.suspiciousInstall) { | 396 if (extension.suspiciousInstall) { |
394 // Then the 'This isn't from the webstore, looks suspicious' message. | 397 // Then the 'This isn't from the webstore, looks suspicious' message. |
395 node.querySelector('.suspicious-install-message').hidden = false; | 398 node.querySelector('.suspicious-install-message').hidden = false; |
396 } | 399 } |
397 if (extension.corruptInstall) { | 400 if (extension.corruptInstall) { |
398 // Then the 'This is a corrupt extension' message. | 401 // Then the 'This is a corrupt extension' message. |
399 node.querySelector('.corrupt-install-message').hidden = false; | 402 node.querySelector('.corrupt-install-message').hidden = false; |
400 } | 403 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 $('overlay').addEventListener('cancelOverlay', function() { | 533 $('overlay').addEventListener('cancelOverlay', function() { |
531 this.optionsShown_ = false; | 534 this.optionsShown_ = false; |
532 }.bind(this)); | 535 }.bind(this)); |
533 }, | 536 }, |
534 }; | 537 }; |
535 | 538 |
536 return { | 539 return { |
537 ExtensionsList: ExtensionsList | 540 ExtensionsList: ExtensionsList |
538 }; | 541 }; |
539 }); | 542 }); |
OLD | NEW |