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 /** | 5 /** |
6 * @fileoverview A helper object used from the "Clear browsing data" dialog | 6 * @fileoverview A helper object used from the "Clear browsing data" dialog |
7 * to interact with the browser. | 7 * to interact with the browser. |
8 */ | 8 */ |
9 | 9 |
10 /** | |
11 * An ImportantSite represents a domain with data that the user might want | |
12 * to protect from being deleted. ImportantSites are determined based on | |
13 * various engagement factors, such as whether a site is bookmarked or receives | |
14 * notifications. | |
15 * | |
16 * @typedef {{ | |
17 * registerableDomain: string, | |
18 * reasonBitfield: number, | |
19 * exampleOrigin: string, | |
20 * isChecked: boolean, | |
21 * storageSize: number, | |
22 * hasNotifications: boolean | |
23 * }} | |
24 */ | |
25 var ImportantSite; | |
26 | |
10 cr.define('settings', function() { | 27 cr.define('settings', function() { |
11 /** @interface */ | 28 /** @interface */ |
12 function ClearBrowsingDataBrowserProxy() {} | 29 function ClearBrowsingDataBrowserProxy() {} |
13 | 30 |
14 ClearBrowsingDataBrowserProxy.prototype = { | 31 ClearBrowsingDataBrowserProxy.prototype = { |
15 /** | 32 /** |
16 * @return {!Promise} A promise resolved when data clearing has completed. | 33 * @param importantSites {!Array<!ImportantSite>} |
Dan Beam
2017/05/17 20:57:28
nit: we use this order everywhere else
@param {
dullweber
2017/05/18 10:41:54
Done.
| |
34 * @return {!Promise<void>} | |
35 * A promise resolved when data clearing has completed. | |
17 */ | 36 */ |
18 clearBrowsingData: function() {}, | 37 clearBrowsingData: function(importantSites) {}, |
38 | |
39 /** | |
40 * Get a list of important sites. | |
Dan Beam
2017/05/17 20:57:28
nit: this description doesn't tell us much more th
dullweber
2017/05/18 10:41:54
removed
| |
41 * @return {!Promise<!Array<!ImportantSite>>} | |
42 * A promise resolved when imporant sites are retrieved. | |
43 */ | |
44 getImportantSites: function() {}, | |
19 | 45 |
20 /** | 46 /** |
21 * Kick off counter updates and return initial state. | 47 * Kick off counter updates and return initial state. |
22 * @return {!Promise<void>} Signal when the setup is complete. | 48 * @return {!Promise<void>} Signal when the setup is complete. |
23 */ | 49 */ |
24 initialize: function() {}, | 50 initialize: function() {}, |
25 }; | 51 }; |
26 | 52 |
27 /** | 53 /** |
28 * @constructor | 54 * @constructor |
29 * @implements {settings.ClearBrowsingDataBrowserProxy} | 55 * @implements {settings.ClearBrowsingDataBrowserProxy} |
30 */ | 56 */ |
31 function ClearBrowsingDataBrowserProxyImpl() {} | 57 function ClearBrowsingDataBrowserProxyImpl() {} |
32 cr.addSingletonGetter(ClearBrowsingDataBrowserProxyImpl); | 58 cr.addSingletonGetter(ClearBrowsingDataBrowserProxyImpl); |
33 | 59 |
34 ClearBrowsingDataBrowserProxyImpl.prototype = { | 60 ClearBrowsingDataBrowserProxyImpl.prototype = { |
35 /** @override */ | 61 /** @override */ |
36 clearBrowsingData: function() { | 62 clearBrowsingData: function(importantSites) { |
37 return cr.sendWithPromise('clearBrowsingData'); | 63 return cr.sendWithPromise('clearBrowsingData', importantSites); |
38 }, | 64 }, |
39 | 65 |
40 /** @override */ | 66 /** @override */ |
67 getImportantSites: function() { | |
68 return cr.sendWithPromise('getImportantSites'); | |
69 }, | |
70 | |
71 /** @override */ | |
41 initialize: function() { | 72 initialize: function() { |
42 return cr.sendWithPromise('initializeClearBrowsingData'); | 73 return cr.sendWithPromise('initializeClearBrowsingData'); |
43 }, | 74 }, |
44 }; | 75 }; |
45 | 76 |
46 return { | 77 return { |
47 ClearBrowsingDataBrowserProxy: ClearBrowsingDataBrowserProxy, | 78 ClearBrowsingDataBrowserProxy: ClearBrowsingDataBrowserProxy, |
48 ClearBrowsingDataBrowserProxyImpl: ClearBrowsingDataBrowserProxyImpl, | 79 ClearBrowsingDataBrowserProxyImpl: ClearBrowsingDataBrowserProxyImpl, |
49 }; | 80 }; |
50 }); | 81 }); |
OLD | NEW |