| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('ntp4', function() { | 5 cr.define('ntp4', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 var TilePage = ntp4.TilePage; | 8 var TilePage = ntp4.TilePage; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } else { | 134 } else { |
| 135 // Records an app launch from the most visited page (Chrome will decide | 135 // Records an app launch from the most visited page (Chrome will decide |
| 136 // whether the url is an app). TODO(estade): this only works for clicks; | 136 // whether the url is an app). TODO(estade): this only works for clicks; |
| 137 // other actions like "open in new tab" from the context menu won't be | 137 // other actions like "open in new tab" from the context menu won't be |
| 138 // recorded. Can this be fixed? | 138 // recorded. Can this be fixed? |
| 139 chrome.send('recordAppLaunchByURL', | 139 chrome.send('recordAppLaunchByURL', |
| 140 [encodeURIComponent(this.href), | 140 [encodeURIComponent(this.href), |
| 141 ntp4.APP_LAUNCH.NTP_MOST_VISITED]); | 141 ntp4.APP_LAUNCH.NTP_MOST_VISITED]); |
| 142 // Records the index of this tile. | 142 // Records the index of this tile. |
| 143 chrome.send('metricsHandler:recordInHistogram', | 143 chrome.send('metricsHandler:recordInHistogram', |
| 144 ['NTP_MostVisited', this.index, 8]); | 144 ['NTP_MostVisited', this.index, THUMBNAIL_COUNT]); |
| 145 } | 145 } |
| 146 }, | 146 }, |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * Allow blacklisting most visited site using the keyboard. | 149 * Allow blacklisting most visited site using the keyboard. |
| 150 */ | 150 */ |
| 151 handleKeyDown_: function(e) { | 151 handleKeyDown_: function(e) { |
| 152 if (!cr.isMac && e.keyCode == 46 || // Del | 152 if (!cr.isMac && e.keyCode == 46 || // Del |
| 153 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace | 153 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace |
| 154 this.blacklist_(); | 154 this.blacklist_(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 417 } |
| 418 | 418 |
| 419 return oldData; | 419 return oldData; |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 return { | 422 return { |
| 423 MostVisitedPage: MostVisitedPage, | 423 MostVisitedPage: MostVisitedPage, |
| 424 refreshData: refreshData, | 424 refreshData: refreshData, |
| 425 }; | 425 }; |
| 426 }); | 426 }); |
| OLD | NEW |