Index: ui/app_list/views/search_box_view.cc |
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc |
index f7af6774112fff697735eb5809ddec83dee38ce0..019e1149b115b8debc8835f26f02c39e85595489 100644 |
--- a/ui/app_list/views/search_box_view.cc |
+++ b/ui/app_list/views/search_box_view.cc |
@@ -381,21 +381,23 @@ void SearchBoxView::HandleSearchBoxEvent(ui::LocatedEvent* located_event) { |
if (!is_fullscreen_app_list_enabled_) |
return; |
- if (located_event->type() != ui::ET_MOUSE_PRESSED && |
- located_event->type() != ui::ET_GESTURE_TAP) |
- return; |
- |
- bool event_is_in_searchbox_bounds = |
- GetWidget()->GetWindowBoundsInScreen().Contains( |
- located_event->root_location()); |
+ if (located_event->type() == ui::ET_MOUSEWHEEL) { |
+ if (!app_list_view_->HandleScroll(located_event)) |
+ return; |
- if (!is_search_box_active_ && event_is_in_searchbox_bounds && |
- search_box_->text().empty()) { |
+ } else if (located_event->type() == ui::ET_MOUSE_PRESSED || |
+ located_event->type() == ui::ET_GESTURE_TAP) { |
+ bool event_is_in_searchbox_bounds = |
+ GetWidget()->GetWindowBoundsInScreen().Contains( |
+ located_event->root_location()); |
+ if (is_search_box_active_ || !event_is_in_searchbox_bounds || |
+ !search_box_->text().empty()) |
+ return; |
// If the event was within the searchbox bounds and in an inactive empty |
// search box, enable the search box. |
SetSearchBoxActive(true); |
- located_event->SetHandled(); |
} |
+ located_event->SetHandled(); |
} |
bool SearchBoxView::OnTextfieldEvent() { |
@@ -412,7 +414,6 @@ bool SearchBoxView::OnTextfieldEvent() { |
bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
if (contents_view_) |
return contents_view_->OnMouseWheel(event); |
- |
return false; |
} |
@@ -427,6 +428,9 @@ const char* SearchBoxView::GetClassName() const { |
} |
void SearchBoxView::OnGestureEvent(ui::GestureEvent* event) { |
+ if (!is_fullscreen_app_list_enabled_) |
+ return; |
+ |
HandleSearchBoxEvent(event); |
} |
@@ -512,7 +516,14 @@ bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, |
bool SearchBoxView::HandleMouseEvent(views::Textfield* sender, |
const ui::MouseEvent& mouse_event) { |
- return OnTextfieldEvent(); |
+ if (!is_fullscreen_app_list_enabled_) |
+ return false; |
+ |
+ if (mouse_event.type() == ui::ET_MOUSEWHEEL) { |
+ return app_list_view_->HandleScroll(&mouse_event); |
+ } else { |
+ return OnTextfieldEvent(); |
+ } |
} |
bool SearchBoxView::HandleGestureEvent(views::Textfield* sender, |