Index: ash/system/tray/tray_item_view.cc |
diff --git a/ash/system/tray/tray_item_view.cc b/ash/system/tray/tray_item_view.cc |
index ddb9f314381914707b0724151e116361da094824..0984e22e8e7a0d4a7a6f3959d3f0fb4546d3725b 100644 |
--- a/ash/system/tray/tray_item_view.cc |
+++ b/ash/system/tray/tray_item_view.cc |
@@ -62,12 +62,6 @@ void TrayItemView::SetVisible(bool set_visible) { |
} |
} |
-void TrayItemView::ApplyChange() { |
- // Forcing the widget to the new size is sufficient. The positioning is |
- // taken care of by the layout manager (ShelfLayoutManager). |
- GetWidget()->SetSize(GetWidget()->GetContentsView()->GetPreferredSize()); |
-} |
- |
gfx::Size TrayItemView::DesiredSize() { |
return views::View::GetPreferredSize(); |
} |
@@ -76,11 +70,6 @@ int TrayItemView::GetAnimationDurationMS() { |
return kTrayItemAnimationDurationMS; |
} |
-void TrayItemView::PreferredSizeChanged() { |
- views::View::PreferredSizeChanged(); |
- ApplyChange(); |
-} |
- |
gfx::Size TrayItemView::GetPreferredSize() { |
gfx::Size size = DesiredSize(); |
size.set_height(kTrayIconHeight); |
@@ -91,6 +80,10 @@ gfx::Size TrayItemView::GetPreferredSize() { |
return size; |
} |
+void TrayItemView::ChildPreferredSizeChanged(views::View* child) { |
+ PreferredSizeChanged(); |
+} |
+ |
void TrayItemView::AnimationProgressed(const ui::Animation* animation) { |
ui::Transform transform; |
transform.SetScale(animation->GetCurrentValue(), |
@@ -98,7 +91,7 @@ void TrayItemView::AnimationProgressed(const ui::Animation* animation) { |
transform.ConcatTranslate(0, animation->CurrentValueBetween( |
static_cast<double>(height()) / 2, 0.)); |
layer()->SetTransform(transform); |
- ApplyChange(); |
+ PreferredSizeChanged(); |
} |
void TrayItemView::AnimationEnded(const ui::Animation* animation) { |