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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

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, 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
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 17e7bf15a118c7bc1cc64b0afbdc8239a520900a..1bfd744c3e8c9c04897a6ad34e562b96d840316f 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -152,8 +152,24 @@ v8::Local<v8::Object> GenerateMostVisitedItem(
v8::Int32::New(isolate, render_view_id));
obj->Set(v8::String::NewFromUtf8(isolate, "rid"),
v8::Int32::New(isolate, restricted_id));
- obj->Set(v8::String::NewFromUtf8(isolate, "thumbnailUrl"),
- GenerateThumbnailURL(isolate, render_view_id, restricted_id));
+
+ if (!mv_item.thumbnail.spec().empty()) {
Mathieu 2015/07/28 13:32:42 put a comment above this block
fserb 2015/07/28 17:55:30 Done.
+ v8::Local<v8::Array> thumbs = v8::Array::New(isolate, 2);
+ thumbs->Set(0, UTF8ToV8String(isolate, base::StringPrintf(
+ "chrome-search://thumb2/%s",
+ mv_item.url.spec().c_str())));
+ thumbs->Set(1, UTF8ToV8String(isolate, mv_item.thumbnail.spec()));
+ obj->Set(v8::String::NewFromUtf8(isolate, "thumbnailUrls"), thumbs);
+ } else {
+ obj->Set(v8::String::NewFromUtf8(isolate, "thumbnailUrl"),
+ GenerateThumbnailURL(isolate, render_view_id, restricted_id));
+ }
+
+ if (!mv_item.favicon.spec().empty()) {
Mathieu 2015/07/28 13:32:43 ...and this block, saying that Chrome can pre-popu
fserb 2015/07/28 17:55:30 Done.
+ obj->Set(v8::String::NewFromUtf8(isolate, "faviconUrl"),
+ UTF8ToV8String(isolate, mv_item.favicon.spec()));
+ }
+
if (IsIconNTPEnabled()) {
// Update website http://www.chromium.org/embeddedsearch when we make this
// permanent.
« chrome/browser/search/instant_service.cc ('K') | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698