Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: ui/message_center/views/message_list_view.cc

Issue 2595163002: Add origin() method on View and use it to simplify some callers. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 6 #include "base/location.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "ui/gfx/animation/slide_animation.h" 9 #include "ui/gfx/animation/slide_animation.h"
10 #include "ui/message_center/message_center_style.h" 10 #include "ui/message_center/message_center_style.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 animator_.AnimateViewTo( 441 animator_.AnimateViewTo(
442 child, gfx::Rect(child_area.x(), top, child_area.width(), height)); 442 child, gfx::Rect(child_area.x(), top, child_area.width(), height));
443 } else if (deleting_views_.find(child) != deleting_views_.end()) { 443 } else if (deleting_views_.find(child) != deleting_views_.end()) {
444 DCHECK(child->layer()); 444 DCHECK(child->layer());
445 // No moves, but animate to fade-out. 445 // No moves, but animate to fade-out.
446 animator_.AnimateViewTo(child, child->bounds()); 446 animator_.AnimateViewTo(child, child->bounds());
447 deleted_when_done_.insert(child); 447 deleted_when_done_.insert(child);
448 return false; 448 return false;
449 } else { 449 } else {
450 gfx::Rect target(child_area.x(), top, child_area.width(), height); 450 gfx::Rect target(child_area.x(), top, child_area.width(), height);
451 if (child->bounds().origin() != target.origin() && animate_on_move) 451 if (child->origin() != target.origin() && animate_on_move)
452 animator_.AnimateViewTo(child, target); 452 animator_.AnimateViewTo(child, target);
453 else 453 else
454 child->SetBoundsRect(target); 454 child->SetBoundsRect(target);
455 } 455 }
456 return true; 456 return true;
457 } 457 }
458 458
459 void MessageListView::AnimateClearingOneNotification() { 459 void MessageListView::AnimateClearingOneNotification() {
460 DCHECK(!clearing_all_views_.empty()); 460 DCHECK(!clearing_all_views_.empty());
461 461
(...skipping 15 matching lines...) Expand all
477 base::TimeDelta::FromMilliseconds( 477 base::TimeDelta::FromMilliseconds(
478 kAnimateClearingNextNotificationDelayMS)); 478 kAnimateClearingNextNotificationDelayMS));
479 } 479 }
480 } 480 }
481 481
482 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { 482 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) {
483 SetRepositionTarget(target_rect); 483 SetRepositionTarget(target_rect);
484 } 484 }
485 485
486 } // namespace message_center 486 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698