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

Side by Side Diff: ui/app_list/views/top_icon_animation_view.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/top_icon_animation_view.h ('k') | ui/message_center/views/bounded_label.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/app_list/views/top_icon_animation_view.h" 5 #include "ui/app_list/views/top_icon_animation_view.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/compositor/scoped_layer_animation_settings.h" 8 #include "ui/compositor/scoped_layer_animation_settings.h"
9 #include "ui/gfx/image/image_skia_operations.h" 9 #include "ui/gfx/image/image_skia_operations.h"
10 #include "ui/views/controls/image_view.h" 10 #include "ui/views/controls/image_view.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Animate the icon to its target location and scale when opening or 60 // Animate the icon to its target location and scale when opening or
61 // closing a folder. 61 // closing a folder.
62 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator()); 62 ui::ScopedLayerAnimationSettings settings(layer()->GetAnimator());
63 settings.AddObserver(this); 63 settings.AddObserver(this);
64 settings.SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN); 64 settings.SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN);
65 settings.SetTransitionDuration( 65 settings.SetTransitionDuration(
66 base::TimeDelta::FromMilliseconds(kFolderTransitionInDurationMs)); 66 base::TimeDelta::FromMilliseconds(kFolderTransitionInDurationMs));
67 layer()->SetTransform(open_folder_ ? gfx::Transform() : transform); 67 layer()->SetTransform(open_folder_ ? gfx::Transform() : transform);
68 } 68 }
69 69
70 gfx::Size TopIconAnimationView::GetPreferredSize() { 70 gfx::Size TopIconAnimationView::GetPreferredSize() const {
71 return icon_size_; 71 return icon_size_;
72 } 72 }
73 73
74 void TopIconAnimationView::Layout() { 74 void TopIconAnimationView::Layout() {
75 icon_->SetBoundsRect(GetContentsBounds()); 75 icon_->SetBoundsRect(GetContentsBounds());
76 } 76 }
77 77
78 void TopIconAnimationView::OnImplicitAnimationsCompleted() { 78 void TopIconAnimationView::OnImplicitAnimationsCompleted() {
79 SetVisible(false); 79 SetVisible(false);
80 FOR_EACH_OBSERVER(TopIconAnimationObserver, 80 FOR_EACH_OBSERVER(TopIconAnimationObserver,
81 observers_, 81 observers_,
82 OnTopIconAnimationsComplete()); 82 OnTopIconAnimationsComplete());
83 delete this; 83 delete this;
84 } 84 }
85 85
86 bool TopIconAnimationView::RequiresNotificationWhenAnimatorDestroyed() const { 86 bool TopIconAnimationView::RequiresNotificationWhenAnimatorDestroyed() const {
87 return true; 87 return true;
88 } 88 }
89 89
90 } // namespace app_list 90 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/top_icon_animation_view.h ('k') | ui/message_center/views/bounded_label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698