OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 5 |
6 /** | 6 /** |
7 * @fileoverview Utilities for rendering most visited thumbnails and titles. | 7 * @fileoverview Utilities for rendering most visited thumbnails and titles. |
8 */ | 8 */ |
9 | 9 |
10 <include src="instant_iframe_validation.js"> | 10 <include src="instant_iframe_validation.js"> |
(...skipping 24 matching lines...) Expand all Loading... |
35 // The visuals of that tile are handled externally by the page itself. | 35 // The visuals of that tile are handled externally by the page itself. |
36 NTP_EXTERNAL_TILE: 5, | 36 NTP_EXTERNAL_TILE: 5, |
37 // There was an error in loading both the thumbnail image and the fallback | 37 // There was an error in loading both the thumbnail image and the fallback |
38 // (if it was provided), resulting in a grey tile. | 38 // (if it was provided), resulting in a grey tile. |
39 NTP_THUMBNAIL_ERROR: 6, | 39 NTP_THUMBNAIL_ERROR: 6, |
40 // Used a gray tile with the domain as the fallback for a failed thumbnail. | 40 // Used a gray tile with the domain as the fallback for a failed thumbnail. |
41 NTP_GRAY_TILE_FALLBACK: 7, | 41 NTP_GRAY_TILE_FALLBACK: 7, |
42 // The visuals of that tile's fallback are handled externally. | 42 // The visuals of that tile's fallback are handled externally. |
43 NTP_EXTERNAL_TILE_FALLBACK: 8, | 43 NTP_EXTERNAL_TILE_FALLBACK: 8, |
44 // The user moused over an NTP tile or title. | 44 // The user moused over an NTP tile or title. |
45 NTP_MOUSEOVER: 9 | 45 NTP_MOUSEOVER: 9, |
| 46 // A NTP Tile has finished loading (successfully or failing). |
| 47 NTP_TILE_LOADED: 10, |
46 }; | 48 }; |
47 | 49 |
48 /** | 50 /** |
49 * Type of the impression provider for a generic client-provided suggestion. | 51 * Type of the impression provider for a generic client-provided suggestion. |
50 * @type {string} | 52 * @type {string} |
51 * @const | 53 * @const |
52 */ | 54 */ |
53 var CLIENT_PROVIDER_NAME = 'client'; | 55 var CLIENT_PROVIDER_NAME = 'client'; |
54 | 56 |
55 /** | 57 /** |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 if (navigator.sendBeacon) { | 302 if (navigator.sendBeacon) { |
301 navigator.sendBeacon(url); | 303 navigator.sendBeacon(url); |
302 } else { | 304 } else { |
303 // if sendBeacon is not enabled, we fallback for "a ping". | 305 // if sendBeacon is not enabled, we fallback for "a ping". |
304 var a = document.createElement('a'); | 306 var a = document.createElement('a'); |
305 a.href = '#'; | 307 a.href = '#'; |
306 a.ping = url; | 308 a.ping = url; |
307 a.click(); | 309 a.click(); |
308 } | 310 } |
309 } | 311 } |
OLD | NEW |