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

Unified Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 6966022: ntp4: Make theme attribution separate from chrome logo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rtl Created 9 years, 7 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
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index ccd8a0aa0c8c5016bf0b117eda9be4f3b00dab59..2fc508e63801ff44af9d7b4c578f58db47d25365 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -680,22 +680,34 @@ cr.define('ntp4', function() {
$('themecss').href = 'chrome://theme/css/newtab.css?' + Date.now();
if (typeof hasAttribution != 'undefined')
document.documentElement.setAttribute('hasattribution', hasAttribution);
+ updateLogo();
updateAttribution();
}
/**
* Sets the proper image for the logo at the bottom left.
*/
- function updateAttribution() {
- // Default value for standard NTP with no theme attribution or custom logo.
+ function updateLogo() {
var imageId = 'IDR_PRODUCT_LOGO';
- // Theme attribution always overrides custom logos.
- if (document.documentElement.getAttribute('hasattribution') == 'true')
- imageId = 'IDR_THEME_NTP_ATTRIBUTION';
- else if (document.documentElement.getAttribute('customlogo') == 'true')
+ if (document.documentElement.getAttribute('customlogo') == 'true')
imageId = 'IDR_CUSTOM_PRODUCT_LOGO';
- $('attribution-img').src = 'chrome://theme/' + imageId + '?' + Date.now();
+ $('logo-img').src = 'chrome://theme/' + imageId + '?' + Date.now();
+ }
+
+ /**
+ * Attributes the attribution image at the bottom left.
+ */
+ function updateAttribution() {
+ var attribution = $('attribution');
+ if (document.documentElement.getAttribute('hasattribution') == 'true') {
+ $('attribution-img').src =
+ 'chrome://theme/IDR_THEME_NTP_ATTRIBUTION?' + Date.now();
+ attribution.hidden = false;
+ } else {
+ attribution.hidden = true;
+ }
+
}
function setRecentlyClosedTabs(dataItems) {
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698