Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 cr.define('extensions', function() { | 5 cr.define('extensions', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @constructor | 9 * @constructor |
| 10 * @implements {extensions.ItemDelegate} | 10 * @implements {extensions.ItemDelegate} |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 this.promptIsShowing_ = false; | 104 this.promptIsShowing_ = false; |
| 105 }.bind(this)); | 105 }.bind(this)); |
| 106 }, | 106 }, |
| 107 | 107 |
| 108 /** @override */ | 108 /** @override */ |
| 109 setItemEnabled: function(id, isEnabled) { | 109 setItemEnabled: function(id, isEnabled) { |
| 110 chrome.management.setEnabled(id, isEnabled); | 110 chrome.management.setEnabled(id, isEnabled); |
| 111 }, | 111 }, |
| 112 | 112 |
| 113 /** @override */ | 113 /** @override */ |
| 114 showItemDetails: function(id) {}, | 114 showItemDetails: function(id) { |
| 115 var data = | |
| 116 this.extensions_.filter(function(e) { return e.id === id; })[0]; | |
| 117 assert(data); | |
|
Dan Beam
2016/04/26 01:32:13
nit: i find this more readable (also, assert() ret
Devlin
2016/04/26 17:24:18
Done.
| |
| 118 this.manager_.showDetailsFor(data); | |
| 119 }, | |
| 115 | 120 |
| 116 /** @override */ | 121 /** @override */ |
| 117 setItemAllowedIncognito: function(id, isAllowedIncognito) { | 122 setItemAllowedIncognito: function(id, isAllowedIncognito) { |
| 118 chrome.developerPrivate.updateExtensionConfiguration({ | 123 chrome.developerPrivate.updateExtensionConfiguration({ |
| 119 extensionId: id, | 124 extensionId: id, |
| 120 incognitoAccess: isAllowedIncognito, | 125 incognitoAccess: isAllowedIncognito, |
| 121 }); | 126 }); |
| 122 }, | 127 }, |
| 123 | 128 |
| 124 /** @override */ | 129 /** @override */ |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 149 /** @override */ | 154 /** @override */ |
| 150 updateAllExtensions: function() { | 155 updateAllExtensions: function() { |
| 151 chrome.developerPrivate.autoUpdate(); | 156 chrome.developerPrivate.autoUpdate(); |
| 152 }, | 157 }, |
| 153 }; | 158 }; |
| 154 | 159 |
| 155 cr.addSingletonGetter(Service); | 160 cr.addSingletonGetter(Service); |
| 156 | 161 |
| 157 return {Service: Service}; | 162 return {Service: Service}; |
| 158 }); | 163 }); |
| OLD | NEW |