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

Fix glitch when creating notification during drag

In UnifiedSystemTray, we only optimize expand/collapse transform when
there is no notification. We should update the layer transform state
when a notification is created during dragging system tray.

TEST=manual
BUG=863577

Change-Id: Iaff5438a9e8f50b621a48cff5c9f197f48d7617e
Reviewed-on: https://chromium-review.googlesource.com/1168709Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581826}
parent 6e0111a9
......@@ -17,6 +17,7 @@
#include "ui/message_center/views/notification_control_buttons_view.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
using message_center::MessageCenter;
using message_center::MessageView;
......@@ -232,6 +233,8 @@ void UnifiedMessageCenterView::NotifyHeightBelowScroll() {
void UnifiedMessageCenterView::Update() {
SetVisible(message_list_view_->GetNotificationCount() > 0);
if (GetWidget() && !GetWidget()->IsClosed())
tray_controller_->OnMessageCenterVisibilityUpdated();
size_t notification_count = message_list_view_->GetNotificationCount();
// TODO(tetsui): This is O(n^2).
......
......@@ -171,6 +171,11 @@ void UnifiedSystemTrayController::OnClearAllAnimationEnded() {
message_center::MessageCenter::RemoveType::NON_PINNED);
}
void UnifiedSystemTrayController::OnMessageCenterVisibilityUpdated() {
if (bubble_)
bubble_->UpdateTransform();
}
void UnifiedSystemTrayController::BeginDrag(const gfx::Point& location) {
drag_init_point_ = location;
was_expanded_ = IsExpanded();
......
......@@ -62,6 +62,9 @@ class ASH_EXPORT UnifiedSystemTrayController : public gfx::AnimationDelegate {
// Called when notification removing animation is finished. Called from the
// view.
void OnClearAllAnimationEnded();
// Called when message center visibility is changed. Called from the
// view.
void OnMessageCenterVisibilityUpdated();
// Handle finger dragging and expand/collapse the view. Called from view.
void BeginDrag(const gfx::Point& location);
......
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