OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ |
6 #define ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // This should return the desired size of the view. For most views, this | 48 // This should return the desired size of the view. For most views, this |
49 // returns GetPreferredSize. But since this class overrides GetPreferredSize | 49 // returns GetPreferredSize. But since this class overrides GetPreferredSize |
50 // for animation purposes, we allow a different way to get this size, and do | 50 // for animation purposes, we allow a different way to get this size, and do |
51 // not allow GetPreferredSize to be overridden. | 51 // not allow GetPreferredSize to be overridden. |
52 virtual gfx::Size DesiredSize(); | 52 virtual gfx::Size DesiredSize(); |
53 | 53 |
54 // The default animation duration is 200ms. But each view can customize this. | 54 // The default animation duration is 200ms. But each view can customize this. |
55 virtual int GetAnimationDurationMS(); | 55 virtual int GetAnimationDurationMS(); |
56 | 56 |
57 // Overridden from views::View. | |
58 virtual void PreferredSizeChanged() OVERRIDE; | |
59 | |
60 private: | 57 private: |
61 // Overridden from views::View. | 58 // Overridden from views::View. |
62 virtual gfx::Size GetPreferredSize() OVERRIDE; | 59 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 60 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; |
63 | 61 |
64 // Overridden from ui::AnimationDelegate. | 62 // Overridden from ui::AnimationDelegate. |
65 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 63 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
66 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | 64 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
67 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; | 65 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; |
68 | 66 |
69 scoped_ptr<ui::SlideAnimation> animation_; | 67 scoped_ptr<ui::SlideAnimation> animation_; |
70 views::Label* label_; | 68 views::Label* label_; |
71 views::ImageView* image_view_; | 69 views::ImageView* image_view_; |
72 | 70 |
73 DISALLOW_COPY_AND_ASSIGN(TrayItemView); | 71 DISALLOW_COPY_AND_ASSIGN(TrayItemView); |
74 }; | 72 }; |
75 | 73 |
76 } // namespace internal | 74 } // namespace internal |
77 } // namespace ash | 75 } // namespace ash |
78 | 76 |
79 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ | 77 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ |
OLD | NEW |