| 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 e.preventDefault(); | 134 e.preventDefault(); |
| 135 } else { | 135 } else { |
| 136 // Records an app launch from the most visited page (Chrome will decide | 136 // Records an app launch from the most visited page (Chrome will decide |
| 137 // whether the url is an app). TODO(estade): this only works for clicks; | 137 // whether the url is an app). TODO(estade): this only works for clicks; |
| 138 // other actions like "open in new tab" from the context menu won't be | 138 // other actions like "open in new tab" from the context menu won't be |
| 139 // recorded. Can this be fixed? | 139 // recorded. Can this be fixed? |
| 140 chrome.send('recordAppLaunchByURL', | 140 chrome.send('recordAppLaunchByURL', |
| 141 [encodeURIComponent(this.href), | 141 [encodeURIComponent(this.href), |
| 142 ntp4.APP_LAUNCH.NTP_MOST_VISITED]); | 142 ntp4.APP_LAUNCH.NTP_MOST_VISITED]); |
| 143 // Records the index of this tile. | 143 // Records the index of this tile. |
| 144 chrome.send('recordInHistogram', ['NTP_MostVisited', this.index, 8]); | 144 chrome.send('metricsHandler:recordInHistogram', |
| 145 ['NTP_MostVisited', this.index, 8]); |
| 145 } | 146 } |
| 146 }, | 147 }, |
| 147 | 148 |
| 148 /** | 149 /** |
| 149 * Allow blacklisting most visited site using the keyboard. | 150 * Allow blacklisting most visited site using the keyboard. |
| 150 */ | 151 */ |
| 151 handleKeyDown_: function(e) { | 152 handleKeyDown_: function(e) { |
| 152 if (!cr.isMac && e.keyCode == 46 || // Del | 153 if (!cr.isMac && e.keyCode == 46 || // Del |
| 153 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace | 154 cr.isMac && e.metaKey && e.keyCode == 8) { // Cmd + Backspace |
| 154 this.blacklist_(); | 155 this.blacklist_(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 418 } |
| 418 | 419 |
| 419 return oldData; | 420 return oldData; |
| 420 }; | 421 }; |
| 421 | 422 |
| 422 return { | 423 return { |
| 423 MostVisitedPage: MostVisitedPage, | 424 MostVisitedPage: MostVisitedPage, |
| 424 refreshData: refreshData, | 425 refreshData: refreshData, |
| 425 }; | 426 }; |
| 426 }); | 427 }); |
| OLD | NEW |