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

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

Issue 11859029: Add a policy to hide the Web Store on new tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check that footer exists before removing icon Created 7 years, 11 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/ntp4/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 483446d59822bc3dd377f5a183dd760f29f29b67..34e71a4ced61ee51db1ba720202f24d3fd2e6324 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -162,11 +162,18 @@ cr.define('ntp', function() {
document.querySelector('head').appendChild(suggestions_script);
}
- var webStoreLink = loadTimeData.getString('webStoreLink');
- var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher');
- $('chrome-web-store-link').href = url;
- $('chrome-web-store-link').addEventListener('click',
- onChromeWebStoreButtonClick);
+ if (loadTimeData.getBoolean('isWebStoreIconHidden')) {
+ var webStoreIcon = $('chrome-web-store-link');
+ // The next NTP has no footer.
+ if (webStoreIcon)
+ webStoreIcon.parentNode.removeChild(webStoreIcon);
+ } else {
+ var webStoreLink = loadTimeData.getString('webStoreLink');
+ var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher');
+ $('chrome-web-store-link').href = url;
+ $('chrome-web-store-link').addEventListener('click',
+ onChromeWebStoreButtonClick);
+ }
if (loadTimeData.getString('login_status_message')) {
loginBubble = new cr.ui.Bubble;

Powered by Google App Engine
This is Rietveld 408576698