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

Side by Side Diff: ash/common/system/tray/tray_item_view.h

Issue 2465403002: Some more fixes to cros system tray icons (esp. screen tray items) (Closed)
Patch Set: commentary Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 18 matching lines...) Expand all
29 // animation when showing/hiding the item in the tray. 29 // animation when showing/hiding the item in the tray.
30 class ASH_EXPORT TrayItemView : public views::View, 30 class ASH_EXPORT TrayItemView : public views::View,
31 public gfx::AnimationDelegate { 31 public gfx::AnimationDelegate {
32 public: 32 public:
33 explicit TrayItemView(SystemTrayItem* owner); 33 explicit TrayItemView(SystemTrayItem* owner);
34 ~TrayItemView() override; 34 ~TrayItemView() override;
35 35
36 static void DisableAnimationsForTest(); 36 static void DisableAnimationsForTest();
37 37
38 // Convenience function for creating a child Label or ImageView. 38 // Convenience function for creating a child Label or ImageView.
39 // Only one of the two should be called.
39 void CreateLabel(); 40 void CreateLabel();
40 void CreateImageView(); 41 void CreateImageView();
41 42
42 SystemTrayItem* owner() const { return owner_; } 43 SystemTrayItem* owner() const { return owner_; }
43 views::Label* label() const { return label_; } 44 views::Label* label() const { return label_; }
44 views::ImageView* image_view() const { return image_view_; } 45 views::ImageView* image_view() const { return image_view_; }
45 46
46 // Overridden from views::View. 47 // Overridden from views::View.
47 void SetVisible(bool visible) override; 48 void SetVisible(bool visible) override;
48 gfx::Size GetPreferredSize() const override; 49 gfx::Size GetPreferredSize() const override;
(...skipping 11 matching lines...) Expand all
60 // Overridden from views::View. 61 // Overridden from views::View.
61 void ChildPreferredSizeChanged(View* child) override; 62 void ChildPreferredSizeChanged(View* child) override;
62 63
63 // Overridden from gfx::AnimationDelegate. 64 // Overridden from gfx::AnimationDelegate.
64 void AnimationProgressed(const gfx::Animation* animation) override; 65 void AnimationProgressed(const gfx::Animation* animation) override;
65 void AnimationEnded(const gfx::Animation* animation) override; 66 void AnimationEnded(const gfx::Animation* animation) override;
66 void AnimationCanceled(const gfx::Animation* animation) override; 67 void AnimationCanceled(const gfx::Animation* animation) override;
67 68
68 SystemTrayItem* owner_; 69 SystemTrayItem* owner_;
69 std::unique_ptr<gfx::SlideAnimation> animation_; 70 std::unique_ptr<gfx::SlideAnimation> animation_;
71 // Only one of |label_| and |image_view_| should be non-null.
70 views::Label* label_; 72 views::Label* label_;
71 views::ImageView* image_view_; 73 views::ImageView* image_view_;
72 74
73 DISALLOW_COPY_AND_ASSIGN(TrayItemView); 75 DISALLOW_COPY_AND_ASSIGN(TrayItemView);
74 }; 76 };
75 77
76 } // namespace ash 78 } // namespace ash
77 79
78 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_ 80 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/screen_security/screen_tray_item.cc ('k') | ash/common/system/tray/tray_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698