Commit 0d2d779e authored by Mark Pearson's avatar Mark Pearson Committed by Commit Bot

Omnibox - Exactly-Typed Non-Substituting Keywords Should Be Default

This was broken by
https://chromium.googlesource.com/chromium/src/+/31c2066fb04ade8b1474c27054f425fe8a72d04f

Tested interactively using repro steps on bug.

Also re-enables programmatic test for this bug.

Bug: 789913
Change-Id: I43a59ef112da6f1e69c30a46c55586d5f9280f41
Reviewed-on: https://chromium-review.googlesource.com/804676
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521203}
parent 1cb7ac27
......@@ -1208,7 +1208,13 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_AcceptKeywordBySpace) {
ASSERT_TRUE(omnibox_view->GetText().empty());
}
IN_PROC_BROWSER_TEST_F(OmniboxViewTest, DISABLED_NonSubstitutingKeywordTest) {
#if defined(OS_WIN)
#define MAYBE_NonSubstitutingKeywordTest NonSubstitutingKeywordTest
#else
// https://crbug.com/751031.
#define MAYBE_NonSubstitutingKeywordTest DISABLED_NonSubstitutingKeywordTest
#endif
IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_NonSubstitutingKeywordTest) {
OmniboxView* omnibox_view = NULL;
ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
OmniboxPopupModel* popup_model = omnibox_view->model()->popup_model();
......
......@@ -343,9 +343,13 @@ void KeywordProvider::Start(const AutocompleteInput& input,
// When creating an exact match (either for the keyword itself, no
// remaining query or an extension keyword, possibly with remaining
// input), allow the match to be the default match when appropriate.
// For exactly-typed non-substituting keywords, it's always appropriate.
matches_.push_back(CreateAutocompleteMatch(
template_url, meaningful_keyword_length, input, keyword.length(),
remaining_input, input.allow_exact_keyword_match(), -1, false));
remaining_input,
input.allow_exact_keyword_match() ||
!template_url->SupportsReplacement(model_->search_terms_data()),
-1, false));
// Having extension-provided suggestions appear outside keyword mode can
// be surprising, so only query for suggestions when in keyword mode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment