Chromium Code Reviews| Index: chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js |
| diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js |
| index b979d86434684b147f8ee44b860f7087a813358a..9d9ae94eb2ac1173d1bfa79ca8883bf9c010d162 100644 |
| --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js |
| +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js |
| @@ -7,15 +7,48 @@ |
| * to interact with the browser. |
| */ |
| +/** |
| + * An ImportantSite represents a domain with data that the user might want |
| + * to protect from being deleted. ImportantSites are determined based on |
| + * various engagement factors, such as whether a site is bookmarked or receives |
| + * notifications. |
| + * |
| + * @typedef {{ |
| + * registerableDomain: string, |
| + * reasonBitfield: number, |
| + * exampleOrigin: string, |
| + * isChecked: boolean, |
| + * storageSize: number, |
| + * hasNotifications: boolean |
| + * }} |
| + */ |
| +var ImportantSite; |
| + |
| +/** |
| + * @typedef {{ |
| + * importantSites: !Array<!ImportantSite>, |
| + * }} |
| + */ |
| +var ImportantSitesResponse; |
|
Dan Beam
2017/05/16 19:46:08
why can't we just return !Array<!ImportantSite> an
dullweber
2017/05/17 09:57:37
That works
|
| + |
| cr.define('settings', function() { |
| /** @interface */ |
| function ClearBrowsingDataBrowserProxy() {} |
| ClearBrowsingDataBrowserProxy.prototype = { |
| /** |
| - * @return {!Promise} A promise resolved when data clearing has completed. |
| + * @param importantSites {!Array<!ImportantSite>} |
| + * @return {!Promise<void>} |
| + * A promise resolved when data clearing has completed. |
| */ |
| - clearBrowsingData: function() {}, |
| + clearBrowsingData: function(importantSites) {}, |
| + |
| + /** |
| + * Fetches a list of important sites. |
|
Dan Beam
2017/05/16 19:46:09
ident off
dullweber
2017/05/17 09:57:37
Done.
|
| + * @return {!Promise<!ImportantSitesResponse>} |
| + * A promise resolved when imporant sites are fetched. |
| + */ |
| + fetchImportantSites: function() {}, |
|
Dan Beam
2017/05/16 19:46:09
we have many methods that ask the C++ for data, bu
dullweber
2017/05/17 09:57:37
sure
|
| /** |
| * Kick off counter updates and return initial state. |
| @@ -33,8 +66,13 @@ cr.define('settings', function() { |
| ClearBrowsingDataBrowserProxyImpl.prototype = { |
| /** @override */ |
| - clearBrowsingData: function() { |
| - return cr.sendWithPromise('clearBrowsingData'); |
| + clearBrowsingData: function(importantSites) { |
| + return cr.sendWithPromise('clearBrowsingData', importantSites); |
| + }, |
| + |
| + /** @override */ |
| + fetchImportantSites: function() { |
| + return cr.sendWithPromise('fetchImportantSites'); |
| }, |
| /** @override */ |