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

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

Issue 9303005: [NTP4] Experiment for adding Chrome Web Store link to footer. (Closed)
Patch Set: rebase Created 8 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
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | chrome/browser/resources/ntp4/recently_closed.css » ('j') | 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 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.
*/
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | chrome/browser/resources/ntp4/recently_closed.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698