Chromium Code Reviews| Index: chrome/browser/instant/instant_controller.cc |
| diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc |
| index e0fc9e77fef1b23103ee22eca53921410a28aee3..1f08fa03263605f81dc30db43c62e95f36788000 100644 |
| --- a/chrome/browser/instant/instant_controller.cc |
| +++ b/chrome/browser/instant/instant_controller.cc |
| @@ -652,10 +652,6 @@ void InstantController::SetSuggestions( |
| const std::vector<InstantSuggestion>& suggestions) { |
| DVLOG(1) << "SetSuggestions"; |
| - // Ignore if we are not currently accepting search suggestions. |
| - if (!search_mode_.is_search_suggestions() || last_omnibox_text_.empty()) |
| - return; |
| - |
| // Ignore if the message is from an unexpected source. |
| if (instant_tab_) { |
| if (instant_tab_->contents() != contents) |
| @@ -669,6 +665,17 @@ void InstantController::SetSuggestions( |
| if (!suggestions.empty()) |
| suggestion = suggestions[0]; |
| + if (instant_tab_ && instant_tab_->contents() == contents && |
|
beaudoin
2012/12/14 15:36:20
Nit: the "instant_tab_->contents() == contents" pa
samarth
2012/12/14 17:48:59
Done.
|
| + search_mode_.is_search_results()) { |
| + // Treat any calls to SetSuggestions in committed search mode as a REPLACE. |
|
beaudoin
2012/12/14 15:36:20
Not sure that the comment here describes the next
samarth
2012/12/14 17:48:59
Done.
|
| + browser_->SetInstantSuggestion(suggestion); |
| + return; |
| + } |
| + |
| + // Ignore if we are not currently accepting search suggestions. |
| + if (!search_mode_.is_search_suggestions() || last_omnibox_text_.empty()) |
| + return; |
| + |
| if (suggestion.behavior == INSTANT_COMPLETE_REPLACE) { |
| // We don't get an Update() when changing the omnibox due to a REPLACE |
| // suggestion (so that we don't inadvertently cause the preview to change |