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

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 10809063: Adding Javascript support for the Extended Searchbox API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing sky's comments. Created 8 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/browser/instant/instant_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index a6fae58c274abed0f0e75ebc3009ed4ff6533142..e536621542f6d75bd7717851eb5ab2987d77b149 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -273,8 +273,7 @@ class InstantLoader::WebContentsDelegateImpl
// Message from renderer indicating the page has suggestions.
void OnSetSuggestions(
int32 page_id,
- const std::vector<std::string>& suggestions,
- InstantCompleteBehavior behavior);
+ const std::vector<InstantSuggestion>& suggestions);
// Messages from the renderer when we've determined whether the page supports
// instant.
@@ -598,8 +597,7 @@ void InstantLoader::WebContentsDelegateImpl::DidFailProvisionalLoad(
void InstantLoader::WebContentsDelegateImpl::OnSetSuggestions(
int32 page_id,
- const std::vector<std::string>& suggestions,
- InstantCompleteBehavior behavior) {
+ const std::vector<InstantSuggestion>& suggestions) {
TabContents* source = loader_->preview_contents();
NavigationEntry* entry =
source->web_contents()->GetController().GetActiveEntry();
@@ -607,9 +605,10 @@ void InstantLoader::WebContentsDelegateImpl::OnSetSuggestions(
return;
if (suggestions.empty())
- loader_->SetCompleteSuggestedText(string16(), behavior);
+ loader_->SetCompleteSuggestedText(string16(), INSTANT_COMPLETE_NOW);
else
- loader_->SetCompleteSuggestedText(UTF8ToUTF16(suggestions[0]), behavior);
+ loader_->SetCompleteSuggestedText(UTF8ToUTF16(suggestions[0].text),
+ suggestions[0].behavior);
}
void InstantLoader::WebContentsDelegateImpl::OnInstantSupportDetermined(

Powered by Google App Engine
This is Rietveld 408576698