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

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

Issue 9254023: [NTP4] Track the position of each app that's launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: off by 2 error 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 | « no previous file | chrome/browser/resources/ntp4/most_visited_page.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 8cbf35c8935756adc73781988fb0f03800d87ce9..93c8e1ab99f630344a322ab31293975405780b5a 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -475,6 +475,7 @@ cr.define('ntp4', function() {
'utm_source',
'chrome-ntp-icon');
+ this.recordAppLaunchedFromIndex_();
chrome.send('launchApp',
[this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url,
e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
@@ -490,6 +491,7 @@ cr.define('ntp4', function() {
*/
onKeydown_: function(e) {
if (e.keyIdentifier == 'Enter') {
+ this.recordAppLaunchedFromIndex_();
chrome.send('launchApp',
[this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, '',
0, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
@@ -499,6 +501,16 @@ cr.define('ntp4', function() {
},
/**
+ * Records the index of an app when launched.
+ * @private
+ */
+ recordAppLaunchedFromIndex_: function() {
+ var page = this.tile.tilePage;
+ var wide = page.layoutValues.numRowTiles == page.gridValues.maxColCount;
+ chrome.send('recordAppLaunchedFromIndex', [this.tile.index, wide]);
+ },
+
+ /**
* Adds a node to the list of targets that will launch the app. This list
* is also used in onMousedown to determine whether the app contents should
* be shown as active (if we don't do this, then clicking anywhere in
« no previous file with comments | « no previous file | chrome/browser/resources/ntp4/most_visited_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698