Commit c67e3ff0 authored by Jenny Zhang's avatar Jenny Zhang Committed by Commit Bot

Do not invoke remove query dialog for non-zero state query result.

Bug: 938540
Change-Id: Ic4441c4bf5fbc2ca82b4a0393e96514ea4e99d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504051Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637845}
parent 027118d3
...@@ -387,6 +387,8 @@ void SearchResultView::VisibilityChanged(View* starting_from, bool is_visible) { ...@@ -387,6 +387,8 @@ void SearchResultView::VisibilityChanged(View* starting_from, bool is_visible) {
void SearchResultView::OnGestureEvent(ui::GestureEvent* event) { void SearchResultView::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) { switch (event->type()) {
case ui::ET_GESTURE_LONG_PRESS: case ui::ET_GESTURE_LONG_PRESS:
if (actions_view_->IsValidActionIndex(
ash::OmniBoxZeroStateAction::kRemoveSuggestion)) {
ScrollRectToVisible(GetLocalBounds()); ScrollRectToVisible(GetLocalBounds());
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true); NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
SetBackgroundHighlighted(true); SetBackgroundHighlighted(true);
...@@ -394,6 +396,7 @@ void SearchResultView::OnGestureEvent(ui::GestureEvent* event) { ...@@ -394,6 +396,7 @@ void SearchResultView::OnGestureEvent(ui::GestureEvent* event) {
OnSearchResultActionActivated( OnSearchResultActionActivated(
ash::OmniBoxZeroStateAction::kRemoveSuggestion, event->flags()); ash::OmniBoxZeroStateAction::kRemoveSuggestion, event->flags());
event->SetHandled(); event->SetHandled();
}
break; break;
default: default:
break; break;
......
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