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 "ui/base/animation/animation_delegate.h" | 8 #include "ui/base/animation/animation_delegate.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 void CreateLabel(); | 36 void CreateLabel(); |
37 void CreateImageView(); | 37 void CreateImageView(); |
38 | 38 |
39 SystemTrayItem* owner() const { return owner_; } | 39 SystemTrayItem* owner() const { return owner_; } |
40 views::Label* label() const { return label_; } | 40 views::Label* label() const { return label_; } |
41 views::ImageView* image_view() const { return image_view_; } | 41 views::ImageView* image_view() const { return image_view_; } |
42 | 42 |
43 // Overridden from views::View. | 43 // Overridden from views::View. |
44 virtual void SetVisible(bool visible) OVERRIDE; | 44 virtual void SetVisible(bool visible) OVERRIDE; |
45 virtual gfx::Size GetPreferredSize() OVERRIDE; | 45 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 46 virtual int GetHeightForWidth(int width) OVERRIDE; |
46 | 47 |
47 protected: | 48 protected: |
48 // Makes sure the widget relayouts after the size/visibility of the view | 49 // Makes sure the widget relayouts after the size/visibility of the view |
49 // changes. | 50 // changes. |
50 void ApplyChange(); | 51 void ApplyChange(); |
51 | 52 |
52 // This should return the desired size of the view. For most views, this | 53 // This should return the desired size of the view. For most views, this |
53 // returns GetPreferredSize. But since this class overrides GetPreferredSize | 54 // returns GetPreferredSize. But since this class overrides GetPreferredSize |
54 // for animation purposes, we allow a different way to get this size, and do | 55 // for animation purposes, we allow a different way to get this size, and do |
55 // not allow GetPreferredSize to be overridden. | 56 // not allow GetPreferredSize to be overridden. |
(...skipping 16 matching lines...) Expand all Loading... |
72 views::Label* label_; | 73 views::Label* label_; |
73 views::ImageView* image_view_; | 74 views::ImageView* image_view_; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(TrayItemView); | 76 DISALLOW_COPY_AND_ASSIGN(TrayItemView); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace internal | 79 } // namespace internal |
79 } // namespace ash | 80 } // namespace ash |
80 | 81 |
81 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ | 82 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ |
OLD | NEW |