Commit d095ec40 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Ignore swipe collapsing in detailed views

UnifiedSystemTray can be expanded or collapsed by touch gestures, but
it's confusing that it's also possible when a detailed view is shown.

TEST=manual
BUG=none

Change-Id: Iac81bbb645036560aa01c43bd86de735e3e904dc
Reviewed-on: https://chromium-review.googlesource.com/c/1352088
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612080}
parent fcf5a201
......@@ -177,11 +177,17 @@ void UnifiedSystemTrayController::OnMessageCenterVisibilityUpdated() {
}
void UnifiedSystemTrayController::BeginDrag(const gfx::Point& location) {
// Ignore swipe collapsing when a detailed view is shown as it's confusing.
if (detailed_view_controller_)
return;
drag_init_point_ = location;
was_expanded_ = IsExpanded();
}
void UnifiedSystemTrayController::UpdateDrag(const gfx::Point& location) {
// Ignore swipe collapsing when a detailed view is shown as it's confusing.
if (detailed_view_controller_)
return;
animation_->Reset(GetDragExpandedAmount(location));
UpdateExpandedAmount();
}
......@@ -198,6 +204,9 @@ void UnifiedSystemTrayController::StartAnimation(bool expand) {
}
void UnifiedSystemTrayController::EndDrag(const gfx::Point& location) {
// Ignore swipe collapsing when a detailed view is shown as it's confusing.
if (detailed_view_controller_)
return;
if (animation_->is_animating()) {
// Prevent overwriting the state right after fling event
return;
......@@ -214,6 +223,9 @@ void UnifiedSystemTrayController::EndDrag(const gfx::Point& location) {
}
void UnifiedSystemTrayController::Fling(int velocity) {
// Ignore swipe collapsing when a detailed view is shown as it's confusing.
if (detailed_view_controller_)
return;
// Expand when flinging up. Collapse otherwise.
StartAnimation(velocity < 0);
}
......
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