Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: chrome/browser/resources/local_ntp/local_ntp_fast.js

Issue 1011393004: Fast NTP support for themes, dark themes, favicons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/local_ntp/local_ntp_fast.js
diff --git a/chrome/browser/resources/local_ntp/local_ntp_fast.js b/chrome/browser/resources/local_ntp/local_ntp_fast.js
index 7caa5316157ffe5b58e5d56a44e6c3d7a825aaf0..8b6fc3ba6f57004fca024369a55f5237d6703ff0 100644
--- a/chrome/browser/resources/local_ntp/local_ntp_fast.js
+++ b/chrome/browser/resources/local_ntp/local_ntp_fast.js
@@ -246,6 +246,16 @@ function renderTheme() {
document.body.classList.toggle(CLASSES.ALTERNATE_LOGO, info.alternateLogo);
updateThemeAttribution(info.attributionUrl);
setCustomThemeStyle(info);
+
+ var themeinfo = {cmd: 'updateTheme'};
+ if (!info.usingDefaultTheme) {
+ themeinfo.tileBorderColor = convertToRGBAColor(info.sectionBorderColorRgba);
+ themeinfo.tileHoverBorderColor = convertToRGBAColor(info.headerColorRgba);
+ }
+ themeinfo.isThemeDark = isThemeDark;
+ themeinfo.tileTitleColor = convertToRGBAColor(info.textColorRgba);
+
+ $('mv-single').contentWindow.postMessage(themeinfo, '*');
}
@@ -703,8 +713,6 @@ function init() {
if (ntpApiHandle.isInputInProgress)
onInputStart();
- renderTheme();
-
searchboxApiHandle = topLevelHandle.searchBox;
if (fakebox) {
@@ -770,6 +778,7 @@ function init() {
iframe.onload = function() {
reloadTiles();
+ renderTheme();
};
window.addEventListener('message', handlePostMessage);

Powered by Google App Engine
This is Rietveld 408576698