diff options
Diffstat (limited to 'chromium/chrome/browser/resources/ntp4/incognito_tab.js')
-rw-r--r-- | chromium/chrome/browser/resources/ntp4/incognito_tab.js | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/chromium/chrome/browser/resources/ntp4/incognito_tab.js b/chromium/chrome/browser/resources/ntp4/incognito_tab.js index bca80d57e69..aa7de31ab36 100644 --- a/chromium/chrome/browser/resources/ntp4/incognito_tab.js +++ b/chromium/chrome/browser/resources/ntp4/incognito_tab.js @@ -3,7 +3,25 @@ // found in the LICENSE file. window.addEventListener('load', function() { + cr.addWebUIListener('theme-changed', themeData => { + document.documentElement.setAttribute( + 'hascustombackground', themeData.hasCustomBackground); + $('incognitothemecss').href = + 'chrome://theme/css/incognito_new_tab_theme.css?' + Date.now(); + }); chrome.send('observeThemeChanges'); + + cr.addWebUIListener('cookie-controls-changed', checked => { + $('cookie-controls-toggle').checked = checked; + }); + cr.addWebUIListener( + 'third-party-cookie-blocking-changed', shouldHideCookieControls => { + $('cookie-controls').hidden = shouldHideCookieControls; + }); + $('cookie-controls-toggle').addEventListener('change', event => { + chrome.send('cookieControlsToggleChanged', [event.detail]); + }); + chrome.send('observeCookieControlsSettingsChanges'); }); // Handle the bookmark bar, theme, and font size change requests @@ -13,12 +31,4 @@ const ntp = { setBookmarkBarAttached: function(attached) { document.documentElement.setAttribute('bookmarkbarattached', attached); }, - - /** @param {!{hasCustomBackground: boolean}} themeData */ - themeChanged: function(themeData) { - document.documentElement.setAttribute( - 'hascustombackground', themeData.hasCustomBackground); - $('incognitothemecss').href = - 'chrome://theme/css/incognito_new_tab_theme.css?' + Date.now(); - }, }; |