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_MORE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ |
6 #define ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/system/tray/tray_views.h" | 9 #include "ash/system/tray/tray_views.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 // A view with a chevron ('>') on the right edge. Clicking on the view brings up | 24 // A view with a chevron ('>') on the right edge. Clicking on the view brings up |
25 // the detailed view of the tray-item that owns it. | 25 // the detailed view of the tray-item that owns it. |
26 class TrayItemMore : public ActionableView { | 26 class TrayItemMore : public ActionableView { |
27 public: | 27 public: |
28 explicit TrayItemMore(SystemTrayItem* owner); | 28 explicit TrayItemMore(SystemTrayItem* owner); |
29 virtual ~TrayItemMore(); | 29 virtual ~TrayItemMore(); |
30 | 30 |
31 void SetLabel(const string16& label); | 31 void SetLabel(const string16& label); |
32 void SetImage(const SkBitmap* bitmap); | 32 void SetImage(const gfx::ImageSkia* image_skia); |
33 void SetAccessibleName(const string16& name); | 33 void SetAccessibleName(const string16& name); |
34 | 34 |
35 protected: | 35 protected: |
36 // Replaces the default icon (on the left of the label), and allows a custom | 36 // Replaces the default icon (on the left of the label), and allows a custom |
37 // view to be palced there. Once the default icon is replaced, |SetImage| | 37 // view to be palced there. Once the default icon is replaced, |SetImage| |
38 // should never be called. | 38 // should never be called. |
39 void ReplaceIcon(views::View* view); | 39 void ReplaceIcon(views::View* view); |
40 | 40 |
41 private: | 41 private: |
42 // Overridden from ActionableView. | 42 // Overridden from ActionableView. |
43 virtual bool PerformAction(const views::Event& event) OVERRIDE; | 43 virtual bool PerformAction(const views::Event& event) OVERRIDE; |
44 | 44 |
45 // Overridden from views::View. | 45 // Overridden from views::View. |
46 virtual void Layout() OVERRIDE; | 46 virtual void Layout() OVERRIDE; |
47 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 47 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
48 | 48 |
49 SystemTrayItem* owner_; | 49 SystemTrayItem* owner_; |
50 views::ImageView* icon_; | 50 views::ImageView* icon_; |
51 views::Label* label_; | 51 views::Label* label_; |
52 views::ImageView* more_; | 52 views::ImageView* more_; |
53 string16 accessible_name_; | 53 string16 accessible_name_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(TrayItemMore); | 55 DISALLOW_COPY_AND_ASSIGN(TrayItemMore); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace internal | 58 } // namespace internal |
59 } // namespace ash | 59 } // namespace ash |
60 | 60 |
61 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ | 61 #endif // ASH_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ |
OLD | NEW |