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

Side by Side Diff: chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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('settings', function() { 5 cr.define('settings', function() {
6 /** @interface */ 6 /** @interface */
7 function ChromeCleanupProxy() {} 7 class ChromeCleanupProxy {
8
9 ChromeCleanupProxy.prototype = {
10 /** 8 /**
11 * Registers the current ChromeCleanupHandler as an observer of 9 * Registers the current ChromeCleanupHandler as an observer of
12 * ChromeCleanerController events. 10 * ChromeCleanerController events.
13 */ 11 */
14 registerChromeCleanerObserver: assertNotReached, 12 registerChromeCleanerObserver() {}
15 13
16 /** 14 /**
17 * Starts a cleanup on the user's computer. 15 * Starts a cleanup on the user's computer.
18 */ 16 */
19 startCleanup: assertNotReached, 17 startCleanup() {}
20 18
21 /** 19 /**
22 * Restarts the user's computer. 20 * Restarts the user's computer.
23 */ 21 */
24 restartComputer: assertNotReached, 22 restartComputer() {}
25 23
26 /** 24 /**
27 * Hides the Cleanup page from the settings menu. 25 * Hides the Cleanup page from the settings menu.
28 */ 26 */
29 dismissCleanupPage: assertNotReached, 27 dismissCleanupPage() {}
30 }; 28 }
31 29
32 /** 30 /**
33 * @implements {settings.ChromeCleanupProxy} 31 * @implements {settings.ChromeCleanupProxy}
34 * @constructor
35 */ 32 */
36 function ChromeCleanupProxyImpl() {} 33 class ChromeCleanupProxyImpl {
34 /** @override */
35 registerChromeCleanerObserver() {
36 chrome.send('registerChromeCleanerObserver');
37 }
38
39 /** @override */
40 startCleanup() {
41 chrome.send('startCleanup');
42 }
43
44 /** @override */
45 restartComputer() {
46 chrome.send('restartComputer');
47 }
48
49 /** @override */
50 dismissCleanupPage() {
51 chrome.send('dismissCleanupPage');
52 }
53 }
37 54
38 cr.addSingletonGetter(ChromeCleanupProxyImpl); 55 cr.addSingletonGetter(ChromeCleanupProxyImpl);
39 56
40 ChromeCleanupProxyImpl.prototype = {
41 /** @override */
42 registerChromeCleanerObserver: function() {
43 chrome.send('registerChromeCleanerObserver');
44 },
45
46 /** @override */
47 startCleanup: function() {
48 chrome.send('startCleanup');
49 },
50
51 /** @override */
52 restartComputer: function() {
53 chrome.send('restartComputer');
54 },
55
56 /** @override */
57 dismissCleanupPage: function() {
58 chrome.send('dismissCleanupPage');
59 },
60 };
61
62 return { 57 return {
63 ChromeCleanupProxy: ChromeCleanupProxy, 58 ChromeCleanupProxy: ChromeCleanupProxy,
64 ChromeCleanupProxyImpl: ChromeCleanupProxyImpl, 59 ChromeCleanupProxyImpl: ChromeCleanupProxyImpl,
65 }; 60 };
66 }); 61 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698