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

Unified Diff: ash/system/tray/tray_item_view.cc

Issue 10386142: ash: Some code-cleanup around tray-resizing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/tray/tray_item_view.h ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ash/system/tray/tray_item_view.h ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698