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

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

Issue 1260113002: Adds an experiment that enabled SuggestionsService suggestions (MostLikely) on LocalNTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/search/instant_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright 2015 The Chromium Authors. All rights reserved. 1 /* Copyright 2015 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 // Single iframe for NTP tiles. 5 // Single iframe for NTP tiles.
6 (function() { 6 (function() {
7 'use strict'; 7 'use strict';
8 8
9 9
10 /** 10 /**
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 /** 270 /**
271 * Called when the host page wants to add a suggestion tile. 271 * Called when the host page wants to add a suggestion tile.
272 * For Most Visited, it grabs the data from Chrome and pass on. 272 * For Most Visited, it grabs the data from Chrome and pass on.
273 * For host page generated it just passes the data. 273 * For host page generated it just passes the data.
274 * @param {object} args Data for the tile to be rendered. 274 * @param {object} args Data for the tile to be rendered.
275 */ 275 */
276 var addTile = function(args) { 276 var addTile = function(args) {
277 if (args.rid) { 277 if (args.rid) {
278 var data = chrome.embeddedSearch.searchBox.getMostVisitedItemData(args.rid); 278 var data = chrome.embeddedSearch.searchBox.getMostVisitedItemData(args.rid);
279 data.tid = data.rid; 279 data.tid = data.rid;
280 data.thumbnailUrls = [data.thumbnailUrl]; 280 if (!data.thumbnailUrls) {
281 data.faviconUrl = 'chrome-search://favicon/size/16@' + 281 data.thumbnailUrls = [data.thumbnailUrl];
282 window.devicePixelRatio + 'x/' + data.renderViewId + '/' + data.tid; 282 }
283 if (!data.faviconUrl) {
284 data.faviconUrl = 'chrome-search://favicon/size/16@' +
285 window.devicePixelRatio + 'x/' + data.renderViewId + '/' + data.tid;
286 }
283 tiles.appendChild(renderTile(data)); 287 tiles.appendChild(renderTile(data));
284 logEvent(LOG_TYPE.NTP_CLIENT_SIDE_SUGGESTION); 288 logEvent(LOG_TYPE.NTP_CLIENT_SIDE_SUGGESTION);
285 } else if (args.id) { 289 } else if (args.id) {
286 tiles.appendChild(renderTile(args)); 290 tiles.appendChild(renderTile(args));
287 logEvent(LOG_TYPE.NTP_SERVER_SIDE_SUGGESTION); 291 logEvent(LOG_TYPE.NTP_SERVER_SIDE_SUGGESTION);
288 } else { 292 } else {
289 tiles.appendChild(renderTile(null)); 293 tiles.appendChild(renderTile(null));
290 } 294 }
291 }; 295 };
292 296
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 var html = document.querySelector('html'); 610 var html = document.querySelector('html');
607 html.dir = 'rtl'; 611 html.dir = 'rtl';
608 } 612 }
609 613
610 window.addEventListener('message', handlePostMessage); 614 window.addEventListener('message', handlePostMessage);
611 }; 615 };
612 616
613 617
614 window.addEventListener('DOMContentLoaded', init); 618 window.addEventListener('DOMContentLoaded', init);
615 })(); 619 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search/instant_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698