OLD | NEW |
---|---|
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 class ChromeCleanupProxy { | 7 class ChromeCleanupProxy { |
8 /** | 8 /** |
9 * Registers the current ChromeCleanupHandler as an observer of | 9 * Registers the current ChromeCleanupHandler as an observer of |
10 * ChromeCleanerController events. | 10 * ChromeCleanerController events. |
11 */ | 11 */ |
12 registerChromeCleanerObserver() {} | 12 registerChromeCleanerObserver() {} |
13 | 13 |
14 /** | 14 /** |
15 * Starts a cleanup on the user's computer. | 15 * Starts a cleanup on the user's computer. |
16 * @param {boolean} logs_upload_enabled | |
16 */ | 17 */ |
17 startCleanup() {} | 18 startCleanup(logs_upload_enabled) {} |
ftirelo
2017/07/05 19:02:25
Nit: shouldn't this be logsUploadEnabled ?
proberge
2017/07/05 20:14:20
Done.
| |
18 | 19 |
19 /** | 20 /** |
20 * Restarts the user's computer. | 21 * Restarts the user's computer. |
21 */ | 22 */ |
22 restartComputer() {} | 23 restartComputer() {} |
23 | 24 |
24 /** | 25 /** |
25 * Hides the Cleanup page from the settings menu. | 26 * Hides the Cleanup page from the settings menu. |
26 */ | 27 */ |
27 dismissCleanupPage() {} | 28 dismissCleanupPage() {} |
29 | |
30 /** | |
31 * Updates the cleanup logs upload permission status. | |
32 * @param {boolean} enabled | |
33 */ | |
34 setLogsUploadPermission(enabled) {} | |
28 } | 35 } |
29 | 36 |
30 /** | 37 /** |
31 * @implements {settings.ChromeCleanupProxy} | 38 * @implements {settings.ChromeCleanupProxy} |
32 */ | 39 */ |
33 class ChromeCleanupProxyImpl { | 40 class ChromeCleanupProxyImpl { |
34 /** @override */ | 41 /** @override */ |
35 registerChromeCleanerObserver() { | 42 registerChromeCleanerObserver() { |
36 chrome.send('registerChromeCleanerObserver'); | 43 chrome.send('registerChromeCleanerObserver'); |
37 } | 44 } |
38 | 45 |
39 /** @override */ | 46 /** @override */ |
40 startCleanup() { | 47 startCleanup(logs_upload_enabled) { |
41 chrome.send('startCleanup'); | 48 chrome.send('startCleanup', [logs_upload_enabled]); |
42 } | 49 } |
43 | 50 |
44 /** @override */ | 51 /** @override */ |
45 restartComputer() { | 52 restartComputer() { |
46 chrome.send('restartComputer'); | 53 chrome.send('restartComputer'); |
47 } | 54 } |
48 | 55 |
49 /** @override */ | 56 /** @override */ |
50 dismissCleanupPage() { | 57 dismissCleanupPage() { |
51 chrome.send('dismissCleanupPage'); | 58 chrome.send('dismissCleanupPage'); |
52 } | 59 } |
60 | |
61 /** @override */ | |
62 setLogsUploadPermission(enabled) { | |
63 chrome.send('setLogsUploadPermission', [enabled]); | |
64 } | |
53 } | 65 } |
54 | 66 |
55 cr.addSingletonGetter(ChromeCleanupProxyImpl); | 67 cr.addSingletonGetter(ChromeCleanupProxyImpl); |
56 | 68 |
57 return { | 69 return { |
58 ChromeCleanupProxy: ChromeCleanupProxy, | 70 ChromeCleanupProxy: ChromeCleanupProxy, |
59 ChromeCleanupProxyImpl: ChromeCleanupProxyImpl, | 71 ChromeCleanupProxyImpl: ChromeCleanupProxyImpl, |
60 }; | 72 }; |
61 }); | 73 }); |
OLD | NEW |