Commit 0395b1c0 authored by Min Chen's avatar Min Chen Committed by Commit Bot

shelf: Don't hide the auto_hide shelf if tap trays inside status area.

Bug: 907660
Change-Id: Ic0b3916328d92a4989be0a9e3b2553986ab4f830
Reviewed-on: https://chromium-review.googlesource.com/c/1347618Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610918}
parent 4b278e28
...@@ -357,7 +357,8 @@ void ShelfLayoutManager::ProcessGestureEventOfAutoHideShelf( ...@@ -357,7 +357,8 @@ void ShelfLayoutManager::ProcessGestureEventOfAutoHideShelf(
// event dispatching do its work. // event dispatching do its work.
if (IsVisible() || in_shutdown_) { if (IsVisible() || in_shutdown_) {
// Tap outside of the AUTO_HIDE_SHOWN shelf should hide it. // Tap outside of the AUTO_HIDE_SHOWN shelf should hide it.
if (!IsShelfWindow(target) && visibility_state() == SHELF_AUTO_HIDE && if (!is_shelf_window && !IsStatusAreaWindow(target) &&
visibility_state() == SHELF_AUTO_HIDE &&
state_.auto_hide_state == SHELF_AUTO_HIDE_SHOWN && state_.auto_hide_state == SHELF_AUTO_HIDE_SHOWN &&
event->type() == ui::ET_GESTURE_TAP) { event->type() == ui::ET_GESTURE_TAP) {
UpdateAutoHideState(); UpdateAutoHideState();
......
...@@ -2451,6 +2451,17 @@ TEST_F(ShelfLayoutManagerTest, TapOutsideOfAutoHideShownShelf) { ...@@ -2451,6 +2451,17 @@ TEST_F(ShelfLayoutManagerTest, TapOutsideOfAutoHideShownShelf) {
tap_location = window_bounds.origin() + gfx::Vector2d(10, 10); tap_location = window_bounds.origin() + gfx::Vector2d(10, 10);
generator->GestureTapAt(tap_location); generator->GestureTapAt(tap_location);
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
// Swipe up to show the auto-hide shelf again.
generator->GestureScrollSequence(start, end, kTimeDelta, kNumScrollSteps);
EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState());
// Tap the system tray that inside the status area should not hide the shelf
// but open the systrem tray bubble.
generator->GestureTapAt(
GetPrimaryUnifiedSystemTray()->GetBoundsInScreen().CenterPoint());
EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState());
EXPECT_TRUE(GetPrimaryUnifiedSystemTray()->IsBubbleShown());
} }
class ShelfLayoutManagerKeyboardTest : public AshTestBase { class ShelfLayoutManagerKeyboardTest : public AshTestBase {
......
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