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

Unified Diff: chrome/browser/resources/local_ntp/most_visited_util.js

Issue 19803006: Support a different source for fillMostVisited (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/most_visited_util.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js
index 088ea6dbaf35ceb19eefba23d01720616e834ec1..a280c216accb0f530329e7f0aa102195132c45b9 100644
--- a/chrome/browser/resources/local_ntp/most_visited_util.js
+++ b/chrome/browser/resources/local_ntp/most_visited_util.js
@@ -107,12 +107,21 @@ function getMostVisitedStyles(params, isTitle) {
function fillMostVisited(location, fill) {
var params = parseQueryParams(document.location);
params.rid = parseInt(params.rid, 10);
- if (!isFinite(params.rid))
- return;
- var apiHandle = chrome.embeddedSearch.searchBox;
- var data = apiHandle.getMostVisitedItemData(params.rid);
- if (!data)
+ if (!isFinite(params.rid) && !params.url)
return;
+ var data = {};
+ if (params.url) {
+ // Means that we get suggestion data from the server. Create data object.
samarth 2013/07/19 22:16:40 These fields are currently set by C++ code in chro
Mathieu 2013/07/22 17:32:50 The downstream code will create title and thumbnai
+ data.url = params.url;
+ data.thumbnailUrl = params.tu || '';
+ data.title = params.ti || '';
+ data.direction = params.di || '';
+ } else {
+ var apiHandle = chrome.embeddedSearch.searchBox;
+ data = apiHandle.getMostVisitedItemData(params.rid);
+ if (!data)
+ return;
+ }
if (/^javascript:/i.test(data.url))
return;
if (data.direction)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698