summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 17:37:43 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 17:37:43 +0000
commit4c491cc805aaf0cb53c645a4c077ed6d3e888595 (patch)
tree6da36bd9f680c76ddb6d33c03d19da06ff894d67 /chrome/browser/autocomplete
parent9031d4ef7b359fd0852e6346d6008ff462580b4e (diff)
downloadchromium_src-4c491cc805aaf0cb53c645a4c077ed6d3e888595.zip
chromium_src-4c491cc805aaf0cb53c645a4c077ed6d3e888595.tar.gz
chromium_src-4c491cc805aaf0cb53c645a4c077ed6d3e888595.tar.bz2
Don't treat retyping the current search query as a reload.
BUG=54274 TEST=none Review URL: http://codereview.chromium.org/4605002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index c86c8b0..68b83a8 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -323,13 +323,17 @@ void AutocompleteEditModel::AcceptInput(WindowOpenDisposition disposition,
if (!match.destination_url.is_valid())
return;
- if (match.destination_url ==
- URLFixerUpper::FixupURL(WideToUTF8(permanent_text_), std::string())) {
+ if ((match.transition == TYPED) && (match.destination_url ==
+ URLFixerUpper::FixupURL(WideToUTF8(permanent_text_), std::string()))) {
// When the user hit enter on the existing permanent URL, treat it like a
// reload for scoring purposes. We could detect this by just checking
// user_input_in_progress_, but it seems better to treat "edits" that end
// up leaving the URL unchanged (e.g. deleting the last character and then
- // retyping it) as reloads too.
+ // retyping it) as reloads too. We exclude non-TYPED transitions because if
+ // the transition is GENERATED, the user input something that looked
+ // different from the current URL, even if it wound up at the same place
+ // (e.g. manually retyping the same search query), and it seems wrong to
+ // treat this as a reload.
match.transition = PageTransition::RELOAD;
} else if (for_drop || ((paste_state_ != NONE) &&
match.is_history_what_you_typed_match)) {