Commit 940372ea authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

[omnibox] Fix keyword button not activating by click

When the keyword button was clicked while a different suggestion
was selected, the click was ignored. This CL fixes the problem
by first selecting the appropriate suggestion and keyword button.

Bug: 1117213
Change-Id: I3d900e0b610796a103f35c92bf44ce0d5e7e09b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387136Reviewed-by: default avatarmanuk hovanesian <manukh@chromium.org>
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803588}
parent fda06287
......@@ -212,6 +212,10 @@ void OmniboxSuggestionButtonRowView::ButtonPressed(views::Button* button,
// once we AcceptKeyword, we are really in a new scope state and holding
// onto old suggestions is confusing and error prone. Without this check,
// a second click of the button violates assumptions in |AcceptKeyword|.
// Note: Since keyword mode logic depends on state of the edit model, the
// selection must first be set to prepare for keyword mode before accepting.
popup_model->SetSelection(OmniboxPopupModel::Selection(
model_index_, OmniboxPopupModel::FOCUSED_BUTTON_KEYWORD));
if (model()->edit_model()->is_keyword_hint()) {
auto method = metrics::OmniboxEventProto::INVALID;
if (event.IsMouseEvent()) {
......
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