| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 /** @typedef {{id: string, name: string, canBeDisabled: boolean}} */ | 5 /** @typedef {{id: string, name: string, canBeDisabled: boolean}} */ |
| 6 var NtpExtension; | 6 var NtpExtension; |
| 7 | 7 |
| 8 cr.define('settings', function() { | 8 cr.define('settings', function() { |
| 9 /** @interface */ | 9 /** @interface */ |
| 10 function OnStartupBrowserProxy() {} | 10 class OnStartupBrowserProxy { |
| 11 | |
| 12 OnStartupBrowserProxy.prototype = { | |
| 13 /** @return {!Promise<?NtpExtension>} */ | 11 /** @return {!Promise<?NtpExtension>} */ |
| 14 getNtpExtension: assertNotReached, | 12 getNtpExtension() {} |
| 15 }; | 13 } |
| 16 | 14 |
| 17 /** | 15 /** |
| 18 * @constructor | |
| 19 * @implements {settings.OnStartupBrowserProxy} | 16 * @implements {settings.OnStartupBrowserProxy} |
| 20 */ | 17 */ |
| 21 function OnStartupBrowserProxyImpl() {} | 18 class OnStartupBrowserProxyImpl { |
| 19 /** @override */ |
| 20 getNtpExtension() { |
| 21 return cr.sendWithPromise('getNtpExtension'); |
| 22 } |
| 23 } |
| 24 |
| 22 cr.addSingletonGetter(OnStartupBrowserProxyImpl); | 25 cr.addSingletonGetter(OnStartupBrowserProxyImpl); |
| 23 | 26 |
| 24 OnStartupBrowserProxyImpl.prototype = { | |
| 25 /** @override */ | |
| 26 getNtpExtension: function() { | |
| 27 return cr.sendWithPromise('getNtpExtension'); | |
| 28 }, | |
| 29 }; | |
| 30 | |
| 31 return { | 27 return { |
| 32 OnStartupBrowserProxy: OnStartupBrowserProxy, | 28 OnStartupBrowserProxy: OnStartupBrowserProxy, |
| 33 OnStartupBrowserProxyImpl: OnStartupBrowserProxyImpl, | 29 OnStartupBrowserProxyImpl: OnStartupBrowserProxyImpl, |
| 34 }; | 30 }; |
| 35 }); | 31 }); |
| OLD | NEW |