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 e2cf085bb9c8442cd725cc881c9bbb156d01b0e6..e11acc33b6e241346e74e61da3498951ea7a1b5a 100644 |
--- a/chrome/browser/resources/ntp4/new_tab.js |
+++ b/chrome/browser/resources/ntp4/new_tab.js |
@@ -113,6 +113,17 @@ cr.define('ntp4', function() { |
false); |
chrome.send('getMostVisited'); |
+ if (templateData.isWebStoreExperimentEnabled) { |
+ var webstoreLink = localStrings.getString('webStoreLink'); |
+ var url = appendParam(webstoreLink, 'utm_source', 'chrome-ntp-launcher'); |
+ $('chrome-web-store-href').href = url; |
+ |
+ $('chrome-web-store-href').addEventListener('click', |
+ onChromeWebStoreButtonClick); |
+ |
+ $('footer-content').classList.add('enable-cws-experiment'); |
+ } |
+ |
if (localStrings.getString('login_status_message')) { |
loginBubble = new cr.ui.Bubble; |
loginBubble.anchorNode = $('login-container'); |
@@ -173,6 +184,17 @@ cr.define('ntp4', function() { |
} |
/** |
+ * Launches the chrome web store app with the chrome-ntp-launcher |
+ * source. |
+ * @param {Event} e The click event. |
+ */ |
+ function onChromeWebStoreButtonClick(e) { |
+ chrome.send('recordAppLaunchByURL', |
+ [encodeURIComponent(this.href), |
+ ntp4.APP_LAUNCH.NTP_WEBSTORE_FOOTER]); |
+ } |
+ |
+ /** |
* Fills in an invisible div with the 'Most Visited' string so that |
* its length may be measured and the nav dots sized accordingly. |
*/ |