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 // ExtensionFocusRow: | 8 // ExtensionFocusRow: |
9 | 9 |
10 /** | 10 /** |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 row.setupColumn('.file-access-control input', 'localUrls', 'click', | 442 row.setupColumn('.file-access-control input', 'localUrls', 'click', |
443 function(e) { | 443 function(e) { |
444 chrome.developerPrivate.updateExtensionConfiguration({ | 444 chrome.developerPrivate.updateExtensionConfiguration({ |
445 extensionId: extension.id, | 445 extensionId: extension.id, |
446 fileAccess: e.target.checked | 446 fileAccess: e.target.checked |
447 }); | 447 }); |
448 }); | 448 }); |
449 | 449 |
450 // The 'Options' button or link, depending on its behaviour. | 450 // The 'Options' button or link, depending on its behaviour. |
451 // Set an href to get the correct mouse-over appearance (link, | 451 // Set an href to get the correct mouse-over appearance (link, |
452 // footer) - but the actual link opening is done through chrome.send | 452 // footer) - but the actual link opening is done through developerPrivate |
453 // with a preventDefault(). | 453 // api with a preventDefault(). |
not at google - send to devlin
2015/04/16 17:33:25
What's an api? Some kind of animal species? (ok ba
Devlin
2015/04/16 17:59:12
I think it's a mountain in Nepal... though I guess
| |
454 row.querySelector('.options-link').href = | 454 row.querySelector('.options-link').href = |
455 extension.optionsPage ? extension.optionsPage.url : ''; | 455 extension.optionsPage ? extension.optionsPage.url : ''; |
456 row.setupColumn('.options-link', 'options', 'click', function(e) { | 456 row.setupColumn('.options-link', 'options', 'click', function(e) { |
457 chrome.send('extensionSettingsOptions', [extension.id]); | 457 chrome.developerPrivate.showOptions(extension.id); |
458 e.preventDefault(); | 458 e.preventDefault(); |
459 }); | 459 }); |
460 | 460 |
461 row.setupColumn('.options-button', 'options', 'click', function(e) { | 461 row.setupColumn('.options-button', 'options', 'click', function(e) { |
462 this.showEmbeddedExtensionOptions_(extension.id, false); | 462 this.showEmbeddedExtensionOptions_(extension.id, false); |
463 e.preventDefault(); | 463 e.preventDefault(); |
464 }.bind(this)); | 464 }.bind(this)); |
465 | 465 |
466 // The 'View in Web Store/View Web Site' link. | 466 // The 'View in Web Store/View Web Site' link. |
467 row.querySelector('.site-link').setAttribute('column-type', 'website'); | 467 row.querySelector('.site-link').setAttribute('column-type', 'website'); |
(...skipping 11 matching lines...) Expand all Loading... | |
479 }); | 479 }); |
480 | 480 |
481 // The 'Reload' link. | 481 // The 'Reload' link. |
482 row.setupColumn('.reload-link', 'localReload', 'click', function(e) { | 482 row.setupColumn('.reload-link', 'localReload', 'click', function(e) { |
483 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); | 483 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); |
484 extensionReloadedTimestamp[extension.id] = Date.now(); | 484 extensionReloadedTimestamp[extension.id] = Date.now(); |
485 }); | 485 }); |
486 | 486 |
487 // The 'Launch' link. | 487 // The 'Launch' link. |
488 row.setupColumn('.launch-link', 'launch', 'click', function(e) { | 488 row.setupColumn('.launch-link', 'launch', 'click', function(e) { |
489 chrome.send('extensionSettingsLaunch', [extension.id]); | 489 chrome.management.launchApp(extension.id); |
490 }); | 490 }); |
491 | 491 |
492 // The 'Reload' terminated link. | 492 // The 'Reload' terminated link. |
493 row.setupColumn('.terminated-reload-link', 'terminatedReload', 'click', | 493 row.setupColumn('.terminated-reload-link', 'terminatedReload', 'click', |
494 function(e) { | 494 function(e) { |
495 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); | 495 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); |
496 }); | 496 }); |
497 | 497 |
498 // The 'Repair' corrupted link. | 498 // The 'Repair' corrupted link. |
499 row.setupColumn('.corrupted-repair-button', 'repair', 'click', | 499 row.setupColumn('.corrupted-repair-button', 'repair', 'click', |
500 function(e) { | 500 function(e) { |
501 chrome.send('extensionSettingsRepair', [extension.id]); | 501 chrome.developerPrivate.repairExtension(extension.id); |
502 }); | 502 }); |
503 | 503 |
504 // The 'Enabled' checkbox. | 504 // The 'Enabled' checkbox. |
505 row.setupColumn('.enable-checkbox input', 'enabled', 'change', | 505 row.setupColumn('.enable-checkbox input', 'enabled', 'change', |
506 function(e) { | 506 function(e) { |
507 var checked = e.target.checked; | 507 var checked = e.target.checked; |
508 // TODO(devlin): What should we do if this fails? | 508 // TODO(devlin): What should we do if this fails? |
509 chrome.management.setEnabled(extension.id, checked); | 509 chrome.management.setEnabled(extension.id, checked); |
510 | 510 |
511 // This may seem counter-intuitive (to not set/clear the checkmark) | 511 // This may seem counter-intuitive (to not set/clear the checkmark) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 } | 546 } |
547 }.bind(this)); | 547 }.bind(this)); |
548 }.bind(this)); | 548 }.bind(this)); |
549 row.querySelector('.enable-controls').appendChild(trash); | 549 row.querySelector('.enable-controls').appendChild(trash); |
550 | 550 |
551 // Developer mode //////////////////////////////////////////////////////// | 551 // Developer mode //////////////////////////////////////////////////////// |
552 | 552 |
553 // The path, if provided by unpacked extension. | 553 // The path, if provided by unpacked extension. |
554 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click', | 554 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click', |
555 function(e) { | 555 function(e) { |
556 chrome.send('extensionSettingsShowPath', [String(extension.id)]); | 556 chrome.developerPrivate.showPath(extension.id); |
557 e.preventDefault(); | 557 e.preventDefault(); |
558 }); | 558 }); |
559 | 559 |
560 // Maintain the order that nodes should be in when creating as well as | 560 // Maintain the order that nodes should be in when creating as well as |
561 // when adding only one new row. | 561 // when adding only one new row. |
562 this.insertBefore(row, nextNode); | 562 this.insertBefore(row, nextNode); |
563 this.updateNode_(extension, row); | 563 this.updateNode_(extension, row); |
564 }, | 564 }, |
565 | 565 |
566 /** | 566 /** |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1057 var nextExt = this.extensions_[this.extensions_.indexOf(extension) + 1]; | 1057 var nextExt = this.extensions_[this.extensions_.indexOf(extension) + 1]; |
1058 this.createNode_(extension, nextExt ? $(nextExt.id) : null); | 1058 this.createNode_(extension, nextExt ? $(nextExt.id) : null); |
1059 } | 1059 } |
1060 } | 1060 } |
1061 }; | 1061 }; |
1062 | 1062 |
1063 return { | 1063 return { |
1064 ExtensionList: ExtensionList | 1064 ExtensionList: ExtensionList |
1065 }; | 1065 }; |
1066 }); | 1066 }); |
OLD | NEW |