Chromium Code Reviews| 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 cr.define('extensions', function() { | 7 cr.define('extensions', function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 var ExtensionType = chrome.developerPrivate.ExtensionType; | 10 var ExtensionType = chrome.developerPrivate.ExtensionType; |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); | 540 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); |
| 541 }); | 541 }); |
| 542 | 542 |
| 543 // The 'Repair' corrupted link. | 543 // The 'Repair' corrupted link. |
| 544 wrapper.setupColumn('repair', '.corrupted-repair-button', 'click', | 544 wrapper.setupColumn('repair', '.corrupted-repair-button', 'click', |
| 545 function(e) { | 545 function(e) { |
| 546 chrome.developerPrivate.repairExtension(extension.id); | 546 chrome.developerPrivate.repairExtension(extension.id); |
| 547 }); | 547 }); |
| 548 | 548 |
| 549 // The 'Enabled' checkbox. | 549 // The 'Enabled' checkbox. |
| 550 wrapper.setupColumn('enabled', '.enable-checkbox input', 'change', | 550 wrapper.setupColumn('enabled', '.enable-checkbox input', 'click', |
| 551 function(e) { | 551 function(e) { |
| 552 var checked = e.target.checked; | 552 var checked = e.target.checked; |
| 553 // TODO(devlin): What should we do if this fails? | 553 // Even if this fails, e.preventDefault() call below would keep stuff |
|
Devlin
2016/04/27 13:52:01
nit: I think this isn't entirely addressed - the s
lazyboy
2016/04/27 22:12:55
Ah, got it.
I've also updated the document to say
| |
| 554 // consistent. | |
| 554 chrome.management.setEnabled(extension.id, checked); | 555 chrome.management.setEnabled(extension.id, checked); |
| 555 | 556 |
| 556 // This may seem counter-intuitive (to not set/clear the checkmark) | 557 // This may seem counter-intuitive (to not set/clear the checkmark) |
| 557 // but this page will be updated asynchronously if the extension | 558 // but this page will be updated asynchronously if the extension |
| 558 // becomes enabled/disabled. It also might not become enabled or | 559 // becomes enabled/disabled. It also might not become enabled or |
| 559 // disabled, because the user might e.g. get prompted when enabling | 560 // disabled, because the user might e.g. get prompted when enabling |
| 560 // and choose not to. | 561 // and choose not to. |
| 561 e.preventDefault(); | 562 e.preventDefault(); |
| 562 }); | 563 }); |
| 563 | 564 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1075 this.createWrapper_(extension, nextExt ? $(nextExt.id) : null); | 1076 this.createWrapper_(extension, nextExt ? $(nextExt.id) : null); |
| 1076 } | 1077 } |
| 1077 } | 1078 } |
| 1078 }; | 1079 }; |
| 1079 | 1080 |
| 1080 return { | 1081 return { |
| 1081 ExtensionList: ExtensionList, | 1082 ExtensionList: ExtensionList, |
| 1082 ExtensionListDelegate: ExtensionListDelegate | 1083 ExtensionListDelegate: ExtensionListDelegate |
| 1083 }; | 1084 }; |
| 1084 }); | 1085 }); |
| OLD | NEW |