Chromium Code Reviews| Index: chrome/browser/resources/extensions/extension_loader.js |
| diff --git a/chrome/browser/resources/extensions/extension_loader.js b/chrome/browser/resources/extensions/extension_loader.js |
| index e089c6f29f9c9ad5f58c58e7527825653bc2b482..fe3614808d9f57c19d42fdc896f23c3c3fa7af1e 100644 |
| --- a/chrome/browser/resources/extensions/extension_loader.js |
| +++ b/chrome/browser/resources/extensions/extension_loader.js |
| @@ -180,6 +180,13 @@ cr.define('extensions', function() { |
| */ |
| this.loadError_ = new ExtensionLoadError( |
| /** @type {HTMLDivElement} */($('extension-load-error'))); |
| + |
| + /** |
| + * Whether or not we are currently loading an unpacked extension. |
| + * @type {boolean} |
| + * @private |
|
Dan Beam
2015/03/03 23:37:03
nit: @private {boolean}
Devlin
2015/03/04 17:29:13
Done.
|
| + */ |
| + this.isLoading_ = false; |
| } |
| cr.addSingletonGetter(ExtensionLoader); |
| @@ -190,7 +197,15 @@ cr.define('extensions', function() { |
| * encountered, this object will get notified via notifyFailed(). |
| */ |
| loadUnpacked: function() { |
| - chrome.send('extensionLoaderLoadUnpacked'); |
| + if (this.isLoading_) // Only one running load at a time. |
| + return; |
| + this.isLoading_ = true; |
| + chrome.developerPrivate.loadUnpacked({failQuietly: true}, function() { |
| + // Check lastError to avoid the log, but don't do anything with it - |
| + // error-handling is done on the C++ side. |
| + var lastError = chrome.runtime.lastError; |
|
Dan Beam
2015/03/03 23:37:03
:(
Devlin
2015/03/04 17:29:13
Yeah :/
|
| + this.isLoading_ = false; |
| + }.bind(this)); |
| }, |
| /** |