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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 this.createTiles_(); | 273 this.createTiles_(); |
274 this.data_ = data.slice(0, THUMBNAIL_COUNT); | 274 this.data_ = data.slice(0, THUMBNAIL_COUNT); |
275 } else { | 275 } else { |
276 this.data_ = refreshData(this.data_, data); | 276 this.data_ = refreshData(this.data_, data); |
277 } | 277 } |
278 | 278 |
279 this.updateTiles_(); | 279 this.updateTiles_(); |
280 }, | 280 }, |
281 | 281 |
282 /** @inheritDoc */ | 282 /** @inheritDoc */ |
283 acceptOutsideDrags: function() { | 283 shouldAcceptDrag: function(tile, dataTransfer) { |
284 return false; | 284 return this.contains(tile); |
285 }, | 285 }, |
286 | 286 |
287 /** @inheritDoc */ | 287 /** @inheritDoc */ |
288 heightForWidth: heightForWidth, | 288 heightForWidth: heightForWidth, |
289 }; | 289 }; |
290 | 290 |
291 /** | 291 /** |
292 * We've gotten additional Most Visited data. Update our old data with the | 292 * We've gotten additional Most Visited data. Update our old data with the |
293 * new data. The ordering of the new data is not important, except when a | 293 * new data. The ordering of the new data is not important, except when a |
294 * page is pinned. Thus we try to minimize re-ordering. | 294 * page is pinned. Thus we try to minimize re-ordering. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 return oldData; | 359 return oldData; |
360 }; | 360 }; |
361 | 361 |
362 return { | 362 return { |
363 MostVisitedPage: MostVisitedPage, | 363 MostVisitedPage: MostVisitedPage, |
364 refreshData: refreshData, | 364 refreshData: refreshData, |
365 }; | 365 }; |
366 }); | 366 }); |
OLD | NEW |