Commit 54272ccf authored by estade@chromium.org's avatar estade@chromium.org

make ntp apps promo work correctly

when the promo is showing, use the promo link even if the user clicks on the icon rather than the promo button. Additionally, fix the referrer for clicks on the promo button (by using launchApp).

BUG=82857
TEST=manual


Review URL: http://codereview.chromium.org/8767002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112601 0039d316-1c4b-4281-b951-d872f2087c98
parent 654a7ef4
...@@ -369,6 +369,7 @@ cr.define('ntp4', function() { ...@@ -369,6 +369,7 @@ cr.define('ntp4', function() {
this.appsPromoExtras_.querySelector('.apps-promo-heading'); this.appsPromoExtras_.querySelector('.apps-promo-heading');
this.appsPromoLink_ = this.appsPromoLink_ =
this.appsPromoExtras_.querySelector('.apps-promo-link'); this.appsPromoExtras_.querySelector('.apps-promo-link');
this.appsPromoLink_.addEventListener('click', this.onClick_.bind(this));
this.appsPromoLogo_ = this.ownerDocument.createElement('img'); this.appsPromoLogo_ = this.ownerDocument.createElement('img');
this.appsPromoLogo_.className = 'apps-promo-logo'; this.appsPromoLogo_.className = 'apps-promo-logo';
...@@ -437,9 +438,7 @@ cr.define('ntp4', function() { ...@@ -437,9 +438,7 @@ cr.define('ntp4', function() {
var is_promo = this.appsPromoExtras_ && var is_promo = this.appsPromoExtras_ &&
window.getComputedStyle(this.appsPromoExtras_).display != 'none'; window.getComputedStyle(this.appsPromoExtras_).display != 'none';
var url = !this.appData_.is_webstore ? '' : var url = !this.appData_.is_webstore ? '' :
is_promo ? appendParam(this.appsPromoLink_.href, is_promo ? this.appsPromoLink_.href :
'utm_source',
'chrome-ntp-promo') :
appendParam(this.appData_.url, appendParam(this.appData_.url,
'utm_source', 'utm_source',
'chrome-ntp-icon'); 'chrome-ntp-icon');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment