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

Issue 9570064: Fix keyword search erroneously not triggering in two obscure cases: (Closed)

Created:
8 years, 9 months ago by Peter Kasting
Modified:
8 years, 9 months ago
Reviewers:
James Su
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Fix keyword search erroneously not triggering in two obscure cases: (1) User types something that doesn't look at all like a keyword (e.g. "go om") and gets a non-default dropdown result that does look like a keyword ("google.com"). Arrowing down to this result, the user then presses space after the keyword name. (2) Similar to the case above, but this time the non-default result in question looks like a keyword + some more text, with no whitespace between ("google.comxxx"). The user arrows to this result, arrows back to just after the keyword, and presses space. Item (2) was happening because ShouldAllowExactKeywordMatch() (which has now been renamed) was always looking at the old |user_text_| as the "before change" text, which was wrong if there was temporary text, since the user text was not visible at that point. Fixed by getting the actual displayed text in that case. Item (1) was happening for similar reasons, but in MaybeAcceptKeywordBySpace() instead. This could have been fixed by the same change as above. However, I elected to change this function to look at the |keyword_| instead of the previously-displayed text, as in https://chromiumcodereview.appspot.com/9289034/ patch set 1. Not only is this slightly simpler, it is more robust against future changes. Let's say that someday we want to allow a provider to show a keyword hint for keyword "foobar" on input of "foo ". By checking against |keyword_| in this function, we ensure that in that future case, the space after "foo" will never trigger keyword search mode for "foobar". (If we ever bother to fix our bugs with keywords containing spaces, this might apply today for those as well.) I also tried to change the naming and comments of some things for clarity. BUG=none TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=124745

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -80 lines) Patch
M chrome/browser/autocomplete/autocomplete_edit.h View 3 chunks +22 lines, -26 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.cc View 4 chunks +44 lines, -39 lines 0 comments Download
M chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc View 2 chunks +5 lines, -8 lines 0 comments Download
M chrome/browser/ui/omnibox/omnibox_view_browsertest.cc View 1 3 chunks +58 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_win.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Peter Kasting
Mike, please review history_backend.cc, autocomplete_browsertest.cc (trivial change), and the infrastructure parts of omnibox_view_browsertest.cc. Note that ...
8 years, 9 months ago (2012-03-02 03:38:04 UTC) #1
mrossetti
LGTM Go ahead and commit the change I was going to make in omnibox_view_browsertest.cc. My ...
8 years, 9 months ago (2012-03-02 17:18:15 UTC) #2
Peter Kasting
Landed the browsertest framework changes elsewhere, so this change is now just the parts for ...
8 years, 9 months ago (2012-03-02 18:00:03 UTC) #3
James Su
8 years, 9 months ago (2012-03-02 22:00:33 UTC) #4
On 2012/03/02 18:00:03, Peter Kasting wrote:
> Landed the browsertest framework changes elsewhere, so this change is now just
> the parts for James to review.

LGTM.

Powered by Google App Engine
This is Rietveld 408576698