summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 23:14:27 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 23:14:27 +0000
commita4fa52f5aa6d0d770ac0adbbfafdb47204eaa24c (patch)
treeebf0c961f281bdda869cf7617171d3f0bb710f4a /chrome/browser/autocomplete
parentb2d4e293db87c70ea5d8e3d8254cd6ff7b1c87e0 (diff)
downloadchromium_src-a4fa52f5aa6d0d770ac0adbbfafdb47204eaa24c.zip
chromium_src-a4fa52f5aa6d0d770ac0adbbfafdb47204eaa24c.tar.gz
chromium_src-a4fa52f5aa6d0d770ac0adbbfafdb47204eaa24c.tar.bz2
Removes some code we no longer care about.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6359002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc39
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.h10
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_unittest.cc1
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_model.cc1
4 files changed, 0 insertions, 51 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 9b03855..c4d782a 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);
-}
diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h
index 83c87c3..ea70b84 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.h
+++ b/chrome/browser/autocomplete/autocomplete_edit.h
@@ -56,9 +56,6 @@ class AutocompleteEditController {
// Returns false if there is no instant preview showing.
virtual bool AcceptCurrentInstantPreview() = 0;
- // Sets the suggested search text to |suggested_text|.
- virtual void OnSetSuggestedSearchText(const string16& suggested_text) = 0;
-
// Invoked when the popup is going to change its bounds to |bounds|.
virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) = 0;
@@ -339,9 +336,6 @@ class AutocompleteEditModel : public NotificationObserver {
// Invoked when the popup is going to change its bounds to |bounds|.
void PopupBoundsChangedTo(const gfx::Rect& bounds);
- // Invoked when the autocomplete results may have changed in some way.
- void ResultsUpdated();
-
private:
enum PasteState {
NONE, // Most recent edit was not a paste that replaced all text.
@@ -399,10 +393,6 @@ class AutocompleteEditModel : public NotificationObserver {
// copy.
bool GetURLForText(const std::wstring& text, GURL* url) const;
- // Determines the suggested search text and invokes OnSetSuggestedSearchText
- // on the controller.
- void UpdateSuggestedSearchText();
-
AutocompleteEditView* view_;
AutocompletePopupModel* popup_;
diff --git a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
index bff0815..f599db3 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_unittest.cc
@@ -81,7 +81,6 @@ class TestingAutocompleteEditController : public AutocompleteEditController {
virtual bool AcceptCurrentInstantPreview() {
return false;
}
- virtual void OnSetSuggestedSearchText(const string16& suggested_text) {}
virtual void OnPopupBoundsChanged(const gfx::Rect& bounds) {}
virtual void OnAutocompleteAccept(const GURL& url,
WindowOpenDisposition disposition,
diff --git a/chrome/browser/autocomplete/autocomplete_popup_model.cc b/chrome/browser/autocomplete/autocomplete_popup_model.cc
index beb80c3..588683d 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_model.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_model.cc
@@ -318,7 +318,6 @@ void AutocompletePopupModel::Observe(NotificationType type,
SetHoveredLine(kNoMatch);
view_->UpdatePopupAppearance();
- edit_model_->ResultsUpdated();
edit_model_->PopupBoundsChangedTo(view_->GetTargetBounds());
}