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

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

Issue 10809063: Adding Javascript support for the Extended Searchbox API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding missing file from last upload. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 2eefd0670edbc69df96796eeda0d7b2ef7730152..05bd169ebaa275455946f960b7c7dcc459a6dd53 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -406,31 +406,30 @@ bool InstantController::commit_on_pointer_release() const {
void InstantController::SetSuggestions(
InstantLoader* loader,
- const std::vector<string16>& suggestions,
- InstantCompleteBehavior behavior) {
+ const std::vector<InstantSuggestion>& suggestions) {
DCHECK_EQ(loader_.get(), loader);
if (loader_ != loader || IsOutOfDate() || mode_ == SILENT || mode_ == HIDDEN)
return;
loader_processed_last_update_ = true;
- string16 suggestion;
+ InstantSuggestion suggestion;
if (!suggestions.empty())
suggestion = suggestions[0];
- string16 suggestion_lower = base::i18n::ToLower(suggestion);
+ string16 suggestion_lower = base::i18n::ToLower(suggestion.text);
string16 user_text_lower = base::i18n::ToLower(last_user_text_);
if (user_text_lower.size() >= suggestion_lower.size() ||
suggestion_lower.compare(0, user_text_lower.size(), user_text_lower)) {
- suggestion.clear();
+ suggestion.text.clear();
} else {
- suggestion.erase(0, last_user_text_.size());
+ suggestion.text.erase(0, last_user_text_.size());
}
- last_suggestion_ = suggestion;
- last_complete_behavior_ = behavior;
+ last_suggestion_ = suggestion.text;
+ last_complete_behavior_ = suggestion.behavior;
if (!last_verbatim_)
- delegate_->SetSuggestedText(suggestion, behavior);
+ delegate_->SetSuggestedText(suggestion.text, suggestion.behavior);
if (mode_ != SUGGEST)
Show();

Powered by Google App Engine
This is Rietveld 408576698