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

Side by Side Diff: chrome/browser/resources/local_ntp/most_visited_util.js

Issue 2091323002: Kill NewTabPage.NumberOfMouseOvers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add additional file to sync. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
37 NTP_GRAY_TILE: 4, 37 NTP_GRAY_TILE: 4,
38 // The visuals of that tile are handled externally by the page itself. 38 // The visuals of that tile are handled externally by the page itself.
39 NTP_EXTERNAL_TILE: 5, 39 NTP_EXTERNAL_TILE: 5,
40 // There was an error in loading both the thumbnail image and the fallback 40 // There was an error in loading both the thumbnail image and the fallback
41 // (if it was provided), resulting in a grey tile. 41 // (if it was provided), resulting in a grey tile.
42 NTP_THUMBNAIL_ERROR: 6, 42 NTP_THUMBNAIL_ERROR: 6,
43 // Used a gray tile with the domain as the fallback for a failed thumbnail. 43 // Used a gray tile with the domain as the fallback for a failed thumbnail.
44 NTP_GRAY_TILE_FALLBACK: 7, 44 NTP_GRAY_TILE_FALLBACK: 7,
45 // The visuals of that tile's fallback are handled externally. 45 // The visuals of that tile's fallback are handled externally.
46 NTP_EXTERNAL_TILE_FALLBACK: 8, 46 NTP_EXTERNAL_TILE_FALLBACK: 8,
47 // The user moused over an NTP tile or title.
48 NTP_MOUSEOVER: 9,
49 // A NTP Tile has finished loading (successfully or failing). 47 // A NTP Tile has finished loading (successfully or failing).
50 NTP_TILE_LOADED: 10, 48 NTP_TILE_LOADED: 10,
51 }; 49 };
52 50
53 /** 51 /**
54 * The different sources that an NTP tile can have. 52 * The different sources that an NTP tile can have.
55 * Note: Keep in sync with common/ntp_logging_events.h 53 * Note: Keep in sync with common/ntp_logging_events.h
56 * @enum {number} 54 * @enum {number}
57 * @const 55 * @const
58 */ 56 */
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 link.target = '_top'; 127 link.target = '_top';
130 // Include links in the tab order. The tabIndex is necessary for 128 // Include links in the tab order. The tabIndex is necessary for
131 // accessibility. 129 // accessibility.
132 link.tabIndex = '0'; 130 link.tabIndex = '0';
133 if (text) { 131 if (text) {
134 // Wrap text with span so ellipsis will appear at the end of multiline. 132 // Wrap text with span so ellipsis will appear at the end of multiline.
135 var spanWrap = document.createElement('span'); 133 var spanWrap = document.createElement('span');
136 spanWrap.textContent = text; 134 spanWrap.textContent = text;
137 link.appendChild(spanWrap); 135 link.appendChild(spanWrap);
138 } 136 }
139 link.addEventListener('mouseover', function() {
140 var ntpApiHandle = chrome.embeddedSearch.newTabPage;
141 ntpApiHandle.logEvent(NTP_LOGGING_EVENT_TYPE.NTP_MOUSEOVER);
142 });
143 link.addEventListener('focus', function() { 137 link.addEventListener('focus', function() {
144 window.parent.postMessage('linkFocused', DOMAIN_ORIGIN); 138 window.parent.postMessage('linkFocused', DOMAIN_ORIGIN);
145 }); 139 });
146 link.addEventListener('blur', function() { 140 link.addEventListener('blur', function() {
147 window.parent.postMessage('linkBlurred', DOMAIN_ORIGIN); 141 window.parent.postMessage('linkBlurred', DOMAIN_ORIGIN);
148 }); 142 });
149 143
150 var navigateFunction = function handleNavigation(e) { 144 var navigateFunction = function handleNavigation(e) {
151 var isServerSuggestion = 'url' in params; 145 var isServerSuggestion = 'url' in params;
152 146
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (navigator.sendBeacon) { 301 if (navigator.sendBeacon) {
308 navigator.sendBeacon(url); 302 navigator.sendBeacon(url);
309 } else { 303 } else {
310 // if sendBeacon is not enabled, we fallback for "a ping". 304 // if sendBeacon is not enabled, we fallback for "a ping".
311 var a = document.createElement('a'); 305 var a = document.createElement('a');
312 a.href = '#'; 306 a.href = '#';
313 a.ping = url; 307 a.ping = url;
314 a.click(); 308 a.click();
315 } 309 }
316 } 310 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/local_ntp/most_visited_single.js ('k') | chrome/browser/ui/search/search_ipc_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698