| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/location.h" |
| 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" |
| 6 #include "ui/gfx/animation/slide_animation.h" | 9 #include "ui/gfx/animation/slide_animation.h" |
| 7 #include "ui/message_center/message_center_style.h" | 10 #include "ui/message_center/message_center_style.h" |
| 8 #include "ui/message_center/message_center_switches.h" | 11 #include "ui/message_center/message_center_switches.h" |
| 9 #include "ui/message_center/views/message_center_view.h" | 12 #include "ui/message_center/views/message_center_view.h" |
| 10 #include "ui/message_center/views/message_list_view.h" | 13 #include "ui/message_center/views/message_list_view.h" |
| 11 #include "ui/message_center/views/message_view.h" | 14 #include "ui/message_center/views/message_view.h" |
| 12 #include "ui/views/background.h" | 15 #include "ui/views/background.h" |
| 13 #include "ui/views/border.h" | 16 #include "ui/views/border.h" |
| 14 #include "ui/views/layout/box_layout.h" | 17 #include "ui/views/layout/box_layout.h" |
| 15 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 views::View* child = clearing_all_views_.front(); | 452 views::View* child = clearing_all_views_.front(); |
| 450 clearing_all_views_.pop_front(); | 453 clearing_all_views_.pop_front(); |
| 451 | 454 |
| 452 // Slide from left to right. | 455 // Slide from left to right. |
| 453 gfx::Rect new_bounds = child->bounds(); | 456 gfx::Rect new_bounds = child->bounds(); |
| 454 new_bounds.set_x(new_bounds.right() + kMarginBetweenItems); | 457 new_bounds.set_x(new_bounds.right() + kMarginBetweenItems); |
| 455 animator_.AnimateViewTo(child, new_bounds); | 458 animator_.AnimateViewTo(child, new_bounds); |
| 456 | 459 |
| 457 // Schedule to start sliding out next notification after a short delay. | 460 // Schedule to start sliding out next notification after a short delay. |
| 458 if (!clearing_all_views_.empty()) { | 461 if (!clearing_all_views_.empty()) { |
| 459 base::MessageLoop::current()->PostDelayedTask( | 462 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 460 FROM_HERE, base::Bind(&MessageListView::AnimateClearingOneNotification, | 463 FROM_HERE, base::Bind(&MessageListView::AnimateClearingOneNotification, |
| 461 weak_ptr_factory_.GetWeakPtr()), | 464 weak_ptr_factory_.GetWeakPtr()), |
| 462 base::TimeDelta::FromMilliseconds( | 465 base::TimeDelta::FromMilliseconds( |
| 463 kAnimateClearingNextNotificationDelayMS)); | 466 kAnimateClearingNextNotificationDelayMS)); |
| 464 } | 467 } |
| 465 } | 468 } |
| 466 | 469 |
| 467 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { | 470 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { |
| 468 SetRepositionTarget(target_rect); | 471 SetRepositionTarget(target_rect); |
| 469 } | 472 } |
| 470 | 473 |
| 471 } // namespace message_center | 474 } // namespace message_center |
| OLD | NEW |