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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 6359002: Removes some code we no longer care about. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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/autocomplete/autocomplete_edit.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 5bf0c210624ae1931b8c222cbb7203299318f558..f4d9accdbf09a1d07470464db5fdf3c3145a0690 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -697,10 +697,6 @@ void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) {
controller_->OnPopupBoundsChanged(bounds);
}
-void AutocompleteEditModel::ResultsUpdated() {
- UpdateSuggestedSearchText();
-}
-
// Return true if the suggestion type warrants a TCP/IP preconnection.
// i.e., it is now highly likely that the user will select the related domain.
static bool IsPreconnectable(AutocompleteMatch::Type type) {
@@ -799,38 +795,3 @@ bool AutocompleteEditModel::GetURLForText(const std::wstring& text,
*url = parsed_url;
return true;
}
-
-// Returns true if suggested search text should be shown for the specified match
-// type.
-static bool ShouldShowSuggestSearchTextFor(AutocompleteMatch::Type type) {
- // TODO: add support for other engines when in keyword mode.
- return ((type == AutocompleteMatch::SEARCH_HISTORY) ||
- (type == AutocompleteMatch::SEARCH_SUGGEST));
-}
-
-void AutocompleteEditModel::UpdateSuggestedSearchText() {
- if (!InstantController::IsEnabled(profile_, InstantController::VERBATIM_TYPE))
- return;
-
- string16 suggested_text;
- // The suggested text comes from the first search result.
- if (popup_->IsOpen()) {
- const AutocompleteResult& result = popup_->result();
- if ((result.size() > 1) && (popup_->selected_line() == 0) &&
- ((result.begin()->inline_autocomplete_offset == std::wstring::npos) ||
- (result.begin()->inline_autocomplete_offset ==
- result.begin()->fill_into_edit.size()))) {
- for (AutocompleteResult::const_iterator i = result.begin() + 1;
- i != result.end(); ++i) {
- // TODO: add support for other engines when in keyword mode.
- if (ShouldShowSuggestSearchTextFor(i->type) &&
- i->inline_autocomplete_offset != std::wstring::npos) {
- suggested_text = WideToUTF16(i->fill_into_edit.substr(
- i->inline_autocomplete_offset));
- break;
- }
- }
- }
- }
- controller_->OnSetSuggestedSearchText(suggested_text);
-}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit.h ('k') | chrome/browser/autocomplete/autocomplete_edit_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698