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 45f30f10e33ed59701d0bb5eb7fc6639b8adf15f..925985a85fe6e27f416c4654f3f6d5a2147c2d0b 100644 |
--- a/ui/app_list/views/search_box_view.cc |
+++ b/ui/app_list/views/search_box_view.cc |
@@ -276,20 +276,23 @@ bool SearchBoxView::MoveTabFocus(bool move_backwards) { |
case FOCUS_SEARCH_BOX: |
if (move_backwards) { |
focused_view_ = back_button_ && back_button_->visible() |
- ? FOCUS_BACK_BUTTON : FOCUS_SEARCH_BOX; |
+ ? FOCUS_BACK_BUTTON |
+ : FOCUS_SEARCH_BOX; |
} else { |
focused_view_ = speech_button_ && speech_button_->visible() |
- ? FOCUS_MIC_BUTTON : FOCUS_CONTENTS_VIEW; |
+ ? FOCUS_MIC_BUTTON |
+ : FOCUS_CONTENTS_VIEW; |
} |
break; |
case FOCUS_MIC_BUTTON: |
focused_view_ = move_backwards ? FOCUS_SEARCH_BOX : FOCUS_CONTENTS_VIEW; |
break; |
case FOCUS_CONTENTS_VIEW: |
- focused_view_ = move_backwards |
- ? (speech_button_ && speech_button_->visible() ? |
- FOCUS_MIC_BUTTON : FOCUS_SEARCH_BOX) |
- : FOCUS_CONTENTS_VIEW; |
+ focused_view_ = |
+ move_backwards |
+ ? (speech_button_ && speech_button_->visible() ? FOCUS_MIC_BUTTON |
+ : FOCUS_SEARCH_BOX) |
+ : FOCUS_CONTENTS_VIEW; |
break; |
default: |
DCHECK(false); |
@@ -351,10 +354,20 @@ void SearchBoxView::ShowBackOrGoogleIcon(bool show_back_button) { |
content_container_->Layout(); |
} |
+void SearchBoxView::OnMouseEvent(ui::MouseEvent* event) { |
+ if (!is_fullscreen_app_list_enabled_) |
+ return; |
+ |
+ if (event->type() != ui::ET_MOUSEWHEEL) |
+ return; |
+ |
+ if (app_list_view_->HandleScroll(event)) |
khmel
2017/07/14 18:10:01
nit:
if (!app_list_view_->HandleScroll(event))
newcomer
2017/07/17 21:38:10
Done.
|
+ event->SetHandled(); |
+} |
+ |
bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
if (contents_view_) |
return contents_view_->OnMouseWheel(event); |
- |
return false; |
} |
@@ -441,6 +454,17 @@ bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, |
return false; |
} |
+bool SearchBoxView::HandleMouseEvent(views::Textfield* sender, |
+ const ui::MouseEvent& mouse_event) { |
+ if (!is_fullscreen_app_list_enabled_) |
+ return false; |
+ |
+ if (mouse_event.type() != ui::ET_MOUSEWHEEL) |
+ return false; |
+ |
+ return app_list_view_->HandleScroll(&mouse_event); |
+} |
+ |
void SearchBoxView::ButtonPressed(views::Button* sender, |
const ui::Event& event) { |
if (back_button_ && sender == back_button_) |