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 13 matching lines...) Expand all Loading... | |
24 * errorCollectionEnabled: (boolean|undefined), | 24 * errorCollectionEnabled: (boolean|undefined), |
25 * hasPopupAction: boolean, | 25 * hasPopupAction: boolean, |
26 * homepageProvided: boolean, | 26 * homepageProvided: boolean, |
27 * homepageUrl: string, | 27 * homepageUrl: string, |
28 * icon: string, | 28 * icon: string, |
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 * isFromStore: boolean, | |
34 * isUnpacked: boolean, | 35 * isUnpacked: boolean, |
35 * kioskEnabled: boolean, | 36 * kioskEnabled: boolean, |
36 * kioskOnly: boolean, | 37 * kioskOnly: boolean, |
37 * locationText: string, | 38 * locationText: string, |
38 * managedInstall: boolean, | 39 * managedInstall: 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, |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 if (extension.is_platform_app) { | 313 if (extension.is_platform_app) { |
313 // The 'Launch' link. | 314 // The 'Launch' link. |
314 var launch = node.querySelector('.launch-link'); | 315 var launch = node.querySelector('.launch-link'); |
315 launch.addEventListener('click', function(e) { | 316 launch.addEventListener('click', function(e) { |
316 chrome.send('extensionSettingsLaunch', [extension.id]); | 317 chrome.send('extensionSettingsLaunch', [extension.id]); |
317 }); | 318 }); |
318 launch.hidden = false; | 319 launch.hidden = false; |
319 } | 320 } |
320 } | 321 } |
321 | 322 |
322 if (!extension.terminated) { | 323 if (extension.terminated) { |
324 var terminatedReload = node.querySelector('.terminated-reload-link'); | |
325 terminatedReload.hidden = false; | |
326 terminatedReload.addEventListener('click', function(e) { | |
Dan Beam
2014/09/18 21:36:49
could this add event listeners more than once (mea
Devlin
2014/09/19 21:30:08
I'm pretty sure it's not a risk - this is all in c
| |
327 chrome.send('extensionSettingsReload', [extension.id]); | |
328 }); | |
329 } else if (extension.corruptInstall && extension.isFromStore) { | |
330 var repair = node.querySelector('.corrupted-repair-button'); | |
331 repair.hidden = false; | |
332 repair.addEventListener('click', function(e) { | |
Dan Beam
2014/09/18 21:36:49
same
Devlin
2014/09/19 21:30:08
Done.
| |
333 chrome.send('extensionSettingsRepair', [extension.id]); | |
334 }); | |
335 } else { | |
323 // The 'Enabled' checkbox. | 336 // The 'Enabled' checkbox. |
324 var enable = node.querySelector('.enable-checkbox'); | 337 var enable = node.querySelector('.enable-checkbox'); |
325 enable.hidden = false; | 338 enable.hidden = false; |
326 var enableCheckboxDisabled = extension.managedInstall || | 339 var enableCheckboxDisabled = extension.managedInstall || |
327 extension.suspiciousInstall || | 340 extension.suspiciousInstall || |
328 extension.corruptInstall || | 341 extension.corruptInstall || |
329 extension.dependentExtensions.length > 0; | 342 extension.dependentExtensions.length > 0; |
330 enable.querySelector('input').disabled = enableCheckboxDisabled; | 343 enable.querySelector('input').disabled = enableCheckboxDisabled; |
331 | 344 |
332 if (!enableCheckboxDisabled) { | 345 if (!enableCheckboxDisabled) { |
(...skipping 10 matching lines...) Expand all Loading... | |
343 // This may seem counter-intuitive (to not set/clear the checkmark) | 356 // This may seem counter-intuitive (to not set/clear the checkmark) |
344 // but this page will be updated asynchronously if the extension | 357 // but this page will be updated asynchronously if the extension |
345 // becomes enabled/disabled. It also might not become enabled or | 358 // becomes enabled/disabled. It also might not become enabled or |
346 // disabled, because the user might e.g. get prompted when enabling | 359 // disabled, because the user might e.g. get prompted when enabling |
347 // and choose not to. | 360 // and choose not to. |
348 e.preventDefault(); | 361 e.preventDefault(); |
349 }); | 362 }); |
350 } | 363 } |
351 | 364 |
352 enable.querySelector('input').checked = extension.enabled; | 365 enable.querySelector('input').checked = extension.enabled; |
353 } else { | |
354 var terminatedReload = node.querySelector('.terminated-reload-link'); | |
355 terminatedReload.hidden = false; | |
356 terminatedReload.addEventListener('click', function(e) { | |
357 chrome.send('extensionSettingsReload', [extension.id]); | |
358 }); | |
359 } | 366 } |
360 | 367 |
361 // 'Remove' button. | 368 // 'Remove' button. |
362 var trashTemplate = $('template-collection').querySelector('.trash'); | 369 var trashTemplate = $('template-collection').querySelector('.trash'); |
363 var trash = trashTemplate.cloneNode(true); | 370 var trash = trashTemplate.cloneNode(true); |
364 trash.title = loadTimeData.getString('extensionUninstall'); | 371 trash.title = loadTimeData.getString('extensionUninstall'); |
365 trash.addEventListener('click', function(e) { | 372 trash.addEventListener('click', function(e) { |
366 butterBarVisibility[extension.id] = false; | 373 butterBarVisibility[extension.id] = false; |
367 chrome.send('extensionSettingsUninstall', [extension.id]); | 374 chrome.send('extensionSettingsUninstall', [extension.id]); |
368 }); | 375 }); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 $('overlay').addEventListener('cancelOverlay', function() { | 537 $('overlay').addEventListener('cancelOverlay', function() { |
531 this.optionsShown_ = false; | 538 this.optionsShown_ = false; |
532 }.bind(this)); | 539 }.bind(this)); |
533 }, | 540 }, |
534 }; | 541 }; |
535 | 542 |
536 return { | 543 return { |
537 ExtensionsList: ExtensionsList | 544 ExtensionsList: ExtensionsList |
538 }; | 545 }; |
539 }); | 546 }); |
OLD | NEW |