Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/resources/settings/on_startup_page/on_startup_browser_proxy.js

Issue 2954863003: MD Settings: Convert all browser proxies to use ES6 class syntax. (Closed)
Patch Set: Remove @constructor annotations. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698