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 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ui/gfx/animation/animation_delegate.h" | 9 #include "ui/gfx/animation/animation_delegate.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class SlideAnimation; | 13 class SlideAnimation; |
14 } | 14 } |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class ImageView; | 17 class ImageView; |
18 class Label; | 18 class Label; |
19 } | 19 } |
20 | 20 |
21 namespace ash { | 21 namespace ash { |
22 | |
23 class SystemTrayItem; | 22 class SystemTrayItem; |
24 | 23 |
25 namespace internal { | |
26 | |
27 // Base-class for items in the tray. It makes sure the widget is updated | 24 // Base-class for items in the tray. It makes sure the widget is updated |
28 // correctly when the visibility/size of the tray item changes. It also adds | 25 // correctly when the visibility/size of the tray item changes. It also adds |
29 // animation when showing/hiding the item in the tray. | 26 // animation when showing/hiding the item in the tray. |
30 class ASH_EXPORT TrayItemView : public views::View, | 27 class ASH_EXPORT TrayItemView : public views::View, |
31 public gfx::AnimationDelegate { | 28 public gfx::AnimationDelegate { |
32 public: | 29 public: |
33 explicit TrayItemView(SystemTrayItem* owner); | 30 explicit TrayItemView(SystemTrayItem* owner); |
34 virtual ~TrayItemView(); | 31 virtual ~TrayItemView(); |
35 | 32 |
36 static void DisableAnimationsForTest(); | 33 static void DisableAnimationsForTest(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; | 69 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; |
73 | 70 |
74 SystemTrayItem* owner_; | 71 SystemTrayItem* owner_; |
75 scoped_ptr<gfx::SlideAnimation> animation_; | 72 scoped_ptr<gfx::SlideAnimation> animation_; |
76 views::Label* label_; | 73 views::Label* label_; |
77 views::ImageView* image_view_; | 74 views::ImageView* image_view_; |
78 | 75 |
79 DISALLOW_COPY_AND_ASSIGN(TrayItemView); | 76 DISALLOW_COPY_AND_ASSIGN(TrayItemView); |
80 }; | 77 }; |
81 | 78 |
82 } // namespace internal | |
83 } // namespace ash | 79 } // namespace ash |
84 | 80 |
85 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ | 81 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ |
OLD | NEW |