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 function DownloadsBrowserProxy() {} | 7 class DownloadsBrowserProxy { |
8 | 8 initializeDownloads() {} |
9 DownloadsBrowserProxy.prototype = { | 9 selectDownloadLocation() {} |
10 initializeDownloads: assertNotReached, | 10 resetAutoOpenFileTypes() {} |
11 | 11 } |
12 selectDownloadLocation: assertNotReached, | |
13 | |
14 resetAutoOpenFileTypes: assertNotReached, | |
15 }; | |
16 | 12 |
17 /** | 13 /** |
18 * @implements {settings.DownloadsBrowserProxy} | 14 * @implements {settings.DownloadsBrowserProxy} |
19 * @constructor | |
20 */ | 15 */ |
21 function DownloadsBrowserProxyImpl() {} | 16 class DownloadsBrowserProxyImpl { |
| 17 /** @override */ |
| 18 initializeDownloads() { |
| 19 chrome.send('initializeDownloads'); |
| 20 } |
| 21 |
| 22 /** @override */ |
| 23 selectDownloadLocation() { |
| 24 chrome.send('selectDownloadLocation'); |
| 25 } |
| 26 |
| 27 /** @override */ |
| 28 resetAutoOpenFileTypes() { |
| 29 chrome.send('resetAutoOpenFileTypes'); |
| 30 } |
| 31 } |
22 | 32 |
23 cr.addSingletonGetter(DownloadsBrowserProxyImpl); | 33 cr.addSingletonGetter(DownloadsBrowserProxyImpl); |
24 | 34 |
25 DownloadsBrowserProxyImpl.prototype = { | |
26 /** @override */ | |
27 initializeDownloads: function() { | |
28 chrome.send('initializeDownloads'); | |
29 }, | |
30 | |
31 /** @override */ | |
32 selectDownloadLocation: function() { | |
33 chrome.send('selectDownloadLocation'); | |
34 }, | |
35 | |
36 /** @override */ | |
37 resetAutoOpenFileTypes: function() { | |
38 chrome.send('resetAutoOpenFileTypes'); | |
39 }, | |
40 }; | |
41 | |
42 return { | 35 return { |
43 DownloadsBrowserProxy: DownloadsBrowserProxy, | 36 DownloadsBrowserProxy: DownloadsBrowserProxy, |
44 DownloadsBrowserProxyImpl: DownloadsBrowserProxyImpl, | 37 DownloadsBrowserProxyImpl: DownloadsBrowserProxyImpl, |
45 }; | 38 }; |
46 }); | 39 }); |
OLD | NEW |