Commit a9970a07 authored by Kevin Strohbehn's avatar Kevin Strohbehn Committed by Commit Bot

Long Press on Inactive Search Box no longer causes touch handle to appear

Bug: 882643
Change-Id: I6681f064e8a21ac5557c4c2adb4633af248e0119
Reviewed-on: https://chromium-review.googlesource.com/1217756Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Commit-Queue: Kevin Strohbehn <ginko@google.com>
Cr-Commit-Position: refs/heads/master@{#590117}
parent 511b8c96
...@@ -208,6 +208,23 @@ class SearchBoxTextfield : public views::Textfield { ...@@ -208,6 +208,23 @@ class SearchBoxTextfield : public views::Textfield {
Textfield::OnBlur(); Textfield::OnBlur();
} }
void OnGestureEvent(ui::GestureEvent* event) override {
switch (event->type()) {
case ui::ET_GESTURE_LONG_PRESS:
case ui::ET_GESTURE_LONG_TAP:
// Prevent Long Press from being handled at all, if inactive
if (!search_box_view_->is_search_box_active()) {
event->SetHandled();
break;
}
// If |search_box_view_| is active, handle it as normal below
FALLTHROUGH;
default:
// Handle all other events as normal
Textfield::OnGestureEvent(event);
}
}
private: private:
SearchBoxViewBase* const search_box_view_; SearchBoxViewBase* const search_box_view_;
......
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