Commit 45a334fd authored by wutao's avatar wutao Committed by Commit Bot

app_list: Handle event in assistant_page_view

This patch will set the click or tap event in assistant_page_view to be
handled to prevent app_list_view changing state.

Bug: 924624
Test: manual
Change-Id: I5bcdca18a7980f85803556b282227eeeb87c46c1
Reviewed-on: https://chromium-review.googlesource.com/c/1455271
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630125}
parent 3ddcfb71
...@@ -60,6 +60,32 @@ void AssistantPageView::RequestFocus() { ...@@ -60,6 +60,32 @@ void AssistantPageView::RequestFocus() {
assistant_main_view_->RequestFocus(); assistant_main_view_->RequestFocus();
} }
void AssistantPageView::OnMouseEvent(ui::MouseEvent* event) {
switch (event->type()) {
case ui::ET_MOUSE_PRESSED:
// Prevents closing the AppListView when a click event is not handled.
event->StopPropagation();
break;
default:
break;
}
}
void AssistantPageView::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) {
case ui::ET_GESTURE_TAP:
case ui::ET_GESTURE_DOUBLE_TAP:
case ui::ET_GESTURE_LONG_PRESS:
case ui::ET_GESTURE_LONG_TAP:
case ui::ET_GESTURE_TWO_FINGER_TAP:
// Prevents closing the AppListView when a tap event is not handled.
event->StopPropagation();
break;
default:
break;
}
}
gfx::Rect AssistantPageView::GetPageBoundsForState( gfx::Rect AssistantPageView::GetPageBoundsForState(
ash::AppListState state) const { ash::AppListState state) const {
gfx::Rect onscreen_bounds; gfx::Rect onscreen_bounds;
......
...@@ -32,6 +32,10 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage { ...@@ -32,6 +32,10 @@ class APP_LIST_EXPORT AssistantPageView : public AppListPage {
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void RequestFocus() override; void RequestFocus() override;
// ui::EventHandler:
void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// AppListPage: // AppListPage:
gfx::Rect GetPageBoundsForState(ash::AppListState state) const override; gfx::Rect GetPageBoundsForState(ash::AppListState state) const override;
gfx::Rect GetSearchBoxBounds() const override; gfx::Rect GetSearchBoxBounds() const override;
......
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