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

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

Issue 8526017: Append parameters to webstore URL to indicate launch source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile fixes Created 9 years, 1 month 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/extensions/extension_omnibox_api.cc ('k') | chrome/browser/resources/shared/js/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/apps_page.js
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
index dd96ad5b02fef2b2e9fd5bc536ab4592a4853e0f..aff343f09984b9e3874649c2c42460346f41b955 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -238,8 +238,7 @@ cr.define('ntp4', function() {
this.appContents_.addEventListener('contextmenu',
cr.ui.contextMenuHandler);
- this.isStore_ = this.appData_.is_webstore;
- if (this.isStore_)
+ if (this.appData_.is_webstore)
this.createAppsPromoExtras_();
this.addEventListener('mousedown', this.onMousedown_, true);
@@ -435,8 +434,18 @@ cr.define('ntp4', function() {
* @private
*/
onClick_: function(e) {
+ var is_promo = this.appsPromoExtras_ &&
+ window.getComputedStyle(this.appsPromoExtras_).display != 'none';
+ var url = !this.appData_.is_webstore ? '' :
+ is_promo ? appendParam(this.appsPromoLink_.href,
+ 'utm_source',
+ 'chrome-ntp-promo') :
+ appendParam(this.appData_.url,
+ 'utm_source',
+ 'chrome-ntp-icon');
+
chrome.send('launchApp',
- [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED,
+ [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url,
e.altKey, e.ctrlKey, e.metaKey, e.shiftKey, e.button]);
// Don't allow the click to trigger a link or anything
@@ -451,7 +460,7 @@ cr.define('ntp4', function() {
onKeydown_: function(e) {
if (e.keyIdentifier == 'Enter') {
chrome.send('launchApp',
- [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED,
+ [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, '',
e.altKey, e.ctrlKey, e.metaKey, e.shiftKey, 0]);
e.preventDefault();
e.stopPropagation();
« no previous file with comments | « chrome/browser/extensions/extension_omnibox_api.cc ('k') | chrome/browser/resources/shared/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698