Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: chrome/browser/resources/extensions/extension_list.js

Issue 1085113002: [Extensions UI] Use developerPrivate API for repair, options, show path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 row.setupColumn('.file-access-control input', 'localUrls', 'click', 443 row.setupColumn('.file-access-control input', 'localUrls', 'click',
444 function(e) { 444 function(e) {
445 chrome.developerPrivate.updateExtensionConfiguration({ 445 chrome.developerPrivate.updateExtensionConfiguration({
446 extensionId: extension.id, 446 extensionId: extension.id,
447 fileAccess: e.target.checked 447 fileAccess: e.target.checked
448 }); 448 });
449 }); 449 });
450 450
451 // The 'Options' button or link, depending on its behaviour. 451 // The 'Options' button or link, depending on its behaviour.
452 // Set an href to get the correct mouse-over appearance (link, 452 // Set an href to get the correct mouse-over appearance (link,
453 // footer) - but the actual link opening is done through chrome.send 453 // footer) - but the actual link opening is done through developerPrivate
454 // with a preventDefault(). 454 // API with a preventDefault().
455 row.querySelector('.options-link').href = 455 row.querySelector('.options-link').href =
456 extension.optionsPage ? extension.optionsPage.url : ''; 456 extension.optionsPage ? extension.optionsPage.url : '';
457 row.setupColumn('.options-link', 'options', 'click', function(e) { 457 row.setupColumn('.options-link', 'options', 'click', function(e) {
458 chrome.send('extensionSettingsOptions', [extension.id]); 458 chrome.developerPrivate.showOptions(extension.id);
459 e.preventDefault(); 459 e.preventDefault();
460 }); 460 });
461 461
462 row.setupColumn('.options-button', 'options', 'click', function(e) { 462 row.setupColumn('.options-button', 'options', 'click', function(e) {
463 this.showEmbeddedExtensionOptions_(extension.id, false); 463 this.showEmbeddedExtensionOptions_(extension.id, false);
464 e.preventDefault(); 464 e.preventDefault();
465 }.bind(this)); 465 }.bind(this));
466 466
467 // The 'View in Web Store/View Web Site' link. 467 // The 'View in Web Store/View Web Site' link.
468 row.querySelector('.site-link').setAttribute('column-type', 'website'); 468 row.querySelector('.site-link').setAttribute('column-type', 'website');
(...skipping 11 matching lines...) Expand all
480 }); 480 });
481 481
482 // The 'Reload' link. 482 // The 'Reload' link.
483 row.setupColumn('.reload-link', 'localReload', 'click', function(e) { 483 row.setupColumn('.reload-link', 'localReload', 'click', function(e) {
484 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); 484 chrome.developerPrivate.reload(extension.id, {failQuietly: true});
485 extensionReloadedTimestamp[extension.id] = Date.now(); 485 extensionReloadedTimestamp[extension.id] = Date.now();
486 }); 486 });
487 487
488 // The 'Launch' link. 488 // The 'Launch' link.
489 row.setupColumn('.launch-link', 'launch', 'click', function(e) { 489 row.setupColumn('.launch-link', 'launch', 'click', function(e) {
490 chrome.send('extensionSettingsLaunch', [extension.id]); 490 chrome.management.launchApp(extension.id);
491 }); 491 });
492 492
493 // The 'Reload' terminated link. 493 // The 'Reload' terminated link.
494 row.setupColumn('.terminated-reload-link', 'terminatedReload', 'click', 494 row.setupColumn('.terminated-reload-link', 'terminatedReload', 'click',
495 function(e) { 495 function(e) {
496 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); 496 chrome.developerPrivate.reload(extension.id, {failQuietly: true});
497 }); 497 });
498 498
499 // The 'Repair' corrupted link. 499 // The 'Repair' corrupted link.
500 row.setupColumn('.corrupted-repair-button', 'repair', 'click', 500 row.setupColumn('.corrupted-repair-button', 'repair', 'click',
501 function(e) { 501 function(e) {
502 chrome.send('extensionSettingsRepair', [extension.id]); 502 chrome.developerPrivate.repairExtension(extension.id);
503 }); 503 });
504 504
505 // The 'Enabled' checkbox. 505 // The 'Enabled' checkbox.
506 row.setupColumn('.enable-checkbox input', 'enabled', 'change', 506 row.setupColumn('.enable-checkbox input', 'enabled', 'change',
507 function(e) { 507 function(e) {
508 var checked = e.target.checked; 508 var checked = e.target.checked;
509 // TODO(devlin): What should we do if this fails? 509 // TODO(devlin): What should we do if this fails?
510 chrome.management.setEnabled(extension.id, checked); 510 chrome.management.setEnabled(extension.id, checked);
511 511
512 // This may seem counter-intuitive (to not set/clear the checkmark) 512 // This may seem counter-intuitive (to not set/clear the checkmark)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 } 547 }
548 }.bind(this)); 548 }.bind(this));
549 }.bind(this)); 549 }.bind(this));
550 row.querySelector('.enable-controls').appendChild(trash); 550 row.querySelector('.enable-controls').appendChild(trash);
551 551
552 // Developer mode //////////////////////////////////////////////////////// 552 // Developer mode ////////////////////////////////////////////////////////
553 553
554 // The path, if provided by unpacked extension. 554 // The path, if provided by unpacked extension.
555 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click', 555 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click',
556 function(e) { 556 function(e) {
557 chrome.send('extensionSettingsShowPath', [String(extension.id)]); 557 chrome.developerPrivate.showPath(extension.id);
558 e.preventDefault(); 558 e.preventDefault();
559 }); 559 });
560 560
561 // Maintain the order that nodes should be in when creating as well as 561 // Maintain the order that nodes should be in when creating as well as
562 // when adding only one new row. 562 // when adding only one new row.
563 this.insertBefore(row, nextNode); 563 this.insertBefore(row, nextNode);
564 this.updateNode_(extension, row); 564 this.updateNode_(extension, row);
565 }, 565 },
566 566
567 /** 567 /**
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 var nextExt = this.extensions_[this.extensions_.indexOf(extension) + 1]; 1058 var nextExt = this.extensions_[this.extensions_.indexOf(extension) + 1];
1059 this.createNode_(extension, nextExt ? $(nextExt.id) : null); 1059 this.createNode_(extension, nextExt ? $(nextExt.id) : null);
1060 } 1060 }
1061 } 1061 }
1062 }; 1062 };
1063 1063
1064 return { 1064 return {
1065 ExtensionList: ExtensionList 1065 ExtensionList: ExtensionList
1066 }; 1066 };
1067 }); 1067 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698