Chromium Code Reviews| Index: chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js |
| diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js |
| index 381b54fa47a5c5139a48b213d48722df2b386254..301845772cbdae9c96e5da5a641fd61aae873b9e 100644 |
| --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js |
| +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js |
| @@ -49,10 +49,20 @@ Polymer({ |
| this.addWebUIListener( |
| 'browsing-history-pref-changed', |
| this.setAllowDeletingHistory_.bind(this)); |
| + this.addWebUIListener( |
| + 'update-footer', |
| + this.updateFooter_.bind(this)); |
| this.browserProxy_ = |
| settings.ClearBrowsingDataBrowserProxyImpl.getInstance(); |
| }, |
| + /** @override */ |
| + attached: function() { |
|
dschuyler
2016/04/26 17:29:49
Can this be started earlier from ready() rather
th
msramek
2016/04/27 18:10:29
Done. Yes, thanks for pointing this out!
|
| + // Initialize the footer. This is done by simply calling updateFooter_, |
| + // however, the C++ side must provide arguments. |
| + this.browserProxy_.initializeFooter(); |
| + }, |
| + |
| /** |
| * @param {boolean} allowed Whether the user is allowed to delete histories. |
| * @private |
| @@ -66,6 +76,19 @@ Polymer({ |
| } |
| }, |
| + /** |
| + * Updates the footer. Shows only those sentences that are relevant to this |
| + * user. |
| + * @param {boolean} syncing Whether the user is syncing data. |
| + * @param {boolean} otherFormsOfBrowsingHistory Whether the user has other |
| + * forms of browsing history in their account. |
| + * @private |
| + */ |
| + updateFooter_: function(syncing, otherFormsOfBrowsingHistory) { |
| + this.$.googleFooter.hidden = !otherFormsOfBrowsingHistory; |
| + this.$.syncedDataSentence.hidden = !syncing; |
| + }, |
| + |
| open: function() { |
| this.$.dialog.open(); |
| }, |