Commit b12b566b authored by mukai's avatar mukai Committed by Commit bot

Allows directly entering to VISIBLE_CENTERED state from gesture.

BUG=407292
R=oshima@chromium.org
TEST=athena_unittests

Review URL: https://codereview.chromium.org/503113002

Cr-Commit-Position: refs/heads/master@{#291915}
parent 10b7e19f
......@@ -595,6 +595,7 @@ void HomeCardImpl::OnGestureEnded(State final_state) {
home_card_view_->ClearGesture();
if (state_ != final_state &&
(state_ == VISIBLE_MINIMIZED || final_state == VISIBLE_MINIMIZED)) {
SetState(final_state);
WindowManager::GetInstance()->ToggleOverview();
} else {
HomeCard::State old_state = state_;
......@@ -620,7 +621,8 @@ void HomeCardImpl::OnGestureProgressed(
}
void HomeCardImpl::OnOverviewModeEnter() {
SetState(VISIBLE_BOTTOM);
if (state_ == VISIBLE_MINIMIZED)
SetState(VISIBLE_BOTTOM);
}
void HomeCardImpl::OnOverviewModeExit() {
......
......@@ -182,4 +182,20 @@ TEST_F(HomeCardTest, Gestures) {
}
TEST_F(HomeCardTest, GesturesToFullDirectly) {
ASSERT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
ui::test::EventGenerator generator(root_window());
gfx::Rect screen_rect(root_window()->bounds());
const int bottom = screen_rect.bottom();
const int x = screen_rect.x() + 1;
generator.GestureScrollSequence(gfx::Point(x, bottom - 1),
gfx::Point(x, 20),
base::TimeDelta::FromSeconds(1),
10);
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
EXPECT_TRUE(WindowManager::GetInstance()->IsOverviewModeActive());
}
} // namespace athena
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