Chromium Code Reviews| Index: chrome/browser/ui/omnibox/omnibox_controller.cc |
| diff --git a/chrome/browser/ui/omnibox/omnibox_controller.cc b/chrome/browser/ui/omnibox/omnibox_controller.cc |
| index 8255044ec58b70afc4e377db46070aafb14fff1e..2b8439e807ef4094ca75a8085cbccdb84af273a7 100644 |
| --- a/chrome/browser/ui/omnibox/omnibox_controller.cc |
| +++ b/chrome/browser/ui/omnibox/omnibox_controller.cc |
| @@ -67,11 +67,6 @@ void OmniboxController::StartAutocomplete( |
| ClearPopupKeywordMode(); |
| popup_->SetHoveredLine(OmniboxPopupModel::kNoMatch); |
| -#if defined(HTML_INSTANT_EXTENDED_POPUP) |
| - InstantController* instant_controller = GetInstantController(); |
| - if (instant_controller) |
| - instant_controller->OnAutocompleteStart(); |
| -#endif |
| if (chrome::IsInstantExtendedAPIEnabled()) { |
| autocomplete_controller_->search_provider()-> |
| SetOmniboxStartMargin(omnibox_start_margin); |
| @@ -124,26 +119,10 @@ void OmniboxController::OnResultChanged(bool default_match_changed) { |
| popup_->OnResultChanged(); |
| } |
| - // TODO(beaudoin): This may no longer be needed now that instant classic is |
| - // gone. |
| - if (popup_->IsOpen()) { |
| - // The popup size may have changed, let instant know. |
| - OnPopupBoundsChanged(popup_->view()->GetTargetBounds()); |
| - |
| -#if defined(HTML_INSTANT_EXTENDED_POPUP) |
| - InstantController* instant_controller = GetInstantController(); |
| - if (instant_controller && !omnibox_edit_model_->in_revert()) { |
| - instant_controller->HandleAutocompleteResults( |
| - *autocomplete_controller_->providers(), |
| - autocomplete_controller_->result()); |
| - } |
| -#endif |
| - } else if (was_open) { |
| + if (!popup_->IsOpen() && was_open) { |
| // Accept the temporary text as the user text, because it makes little sense |
| // to have temporary text when the popup is closed. |
| omnibox_edit_model_->AcceptTemporaryTextAsUserText(); |
| - // The popup has been closed, let instant know. |
| - OnPopupBoundsChanged(gfx::Rect()); |
| } |
| } |
| @@ -156,59 +135,12 @@ bool OmniboxController::DoInstant(const AutocompleteMatch& match, |
| bool in_escape_handler, |
| bool just_deleted_text, |
| bool keyword_is_selected) { |
| -#if defined(HTML_INSTANT_EXTENDED_POPUP) |
| - InstantController* instant_controller = GetInstantController(); |
| - if (!instant_controller) |
| - return false; |
| - |
| - // Remove "?" if we're in forced query mode. |
| - AutocompleteInput::RemoveForcedQueryStringIfNecessary( |
| - autocomplete_controller_->input().type(), &user_text); |
| - AutocompleteInput::RemoveForcedQueryStringIfNecessary( |
| - autocomplete_controller_->input().type(), &full_text); |
| - return instant_controller->Update( |
| - match, user_text, full_text, selection_start, selection_end, |
| - UseVerbatimInstant(just_deleted_text), user_input_in_progress, |
| - popup_->IsOpen(), in_escape_handler, keyword_is_selected); |
| -#else |
| return false; |
|
Peter Kasting
2013/06/28 18:47:55
Should there be a TODO to nuke this function too?
Jered
2013/06/28 19:09:55
Just did it.
|
| -#endif |
| } |
| void OmniboxController::SetInstantSuggestion( |
| const InstantSuggestion& suggestion) { |
| -// Should only get called for the HTML popup. |
| -#if defined(HTML_INSTANT_EXTENDED_POPUP) |
| - switch (suggestion.behavior) { |
| - case INSTANT_COMPLETE_NOW: |
| - // Set blue suggestion text. |
| - // TODO(beaudoin): Create a valid current_match_ and call |
| - // omnibox_edit_model_->OnCurrentMatchChanged. |
| - return; |
| - |
| - case INSTANT_COMPLETE_NEVER: { |
| - DCHECK_EQ(INSTANT_SUGGESTION_SEARCH, suggestion.type); |
| - |
| - // Set gray suggestion text. |
| - // Remove "?" if we're in forced query mode. |
| - gray_suggestion_ = suggestion.text; |
| - |
| - omnibox_edit_model_->OnGrayTextChanged(); |
| - return; |
| - } |
| - |
| - case INSTANT_COMPLETE_REPLACE: |
| - // Replace the entire omnibox text by the suggestion the user just arrowed |
| - // to. |
| - CreateAndSetInstantMatch(suggestion.text, suggestion.text, |
| - suggestion.type == INSTANT_SUGGESTION_SEARCH ? |
| - AutocompleteMatchType::SEARCH_SUGGEST : |
| - AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
| - |
| - omnibox_edit_model_->OnCurrentMatchChanged(true); |
| - return; |
| - } |
| -#endif |
| + // TODO(jered): Delete this. |
| } |
| void OmniboxController::InvalidateCurrentMatch() { |
| @@ -237,12 +169,6 @@ void OmniboxController::DoPreconnect(const AutocompleteMatch& match) { |
| } |
| } |
| -void OmniboxController::OnPopupBoundsChanged(const gfx::Rect& bounds) { |
| - InstantController* instant_controller = GetInstantController(); |
| - if (instant_controller) |
| - instant_controller->SetPopupBounds(bounds); |
| -} |
| - |
| bool OmniboxController::UseVerbatimInstant(bool just_deleted_text) const { |
| #if defined(OS_MACOSX) |
| // TODO(suzhe): Fix Mac port to display Instant suggest in a separated NSView, |