OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('settings', function() { |
| 6 /** @interface */ |
| 7 function ExtensionControlBrowserProxy() {} |
| 8 |
| 9 ExtensionControlBrowserProxy.prototype = { |
| 10 // TODO(dbeam): should be be returning !Promise<boolean> to indicate whether |
| 11 // it succeeded? |
| 12 /** @param {string} extensionId */ |
| 13 disableExtension: assertNotReached, |
| 14 |
| 15 /** @param {string} extensionId */ |
| 16 manageExtension: assertNotReached, |
| 17 }; |
| 18 |
| 19 /** |
| 20 * @implements {settings.ExtensionControlBrowserProxy} |
| 21 * @constructor |
| 22 */ |
| 23 function ExtensionControlBrowserProxyImpl() {} |
| 24 cr.addSingletonGetter(ExtensionControlBrowserProxyImpl); |
| 25 |
| 26 ExtensionControlBrowserProxyImpl.prototype = { |
| 27 /** @override */ |
| 28 disableExtension: function(extensionId) { |
| 29 chrome.send('disableExtension', [extensionId]); |
| 30 }, |
| 31 |
| 32 /** @override */ |
| 33 manageExtension: function(extensionId) { |
| 34 window.open('chrome://extensions?id=' + extensionId); |
| 35 }, |
| 36 }; |
| 37 |
| 38 return { |
| 39 ExtensionControlBrowserProxy: ExtensionControlBrowserProxy, |
| 40 ExtensionControlBrowserProxyImpl: ExtensionControlBrowserProxyImpl, |
| 41 }; |
| 42 }); |
OLD | NEW |