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_CHROMEOS_LABEL_TRAY_VIEW_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_LABEL_TRAY_VIEW_H_ |
6 #define ASH_SYSTEM_CHROMEOS_LABEL_TRAY_VIEW_H_ | 6 #define ASH_SYSTEM_CHROMEOS_LABEL_TRAY_VIEW_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
9 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
10 | 11 |
11 namespace ash { | 12 namespace ash { |
12 | 13 |
13 class ViewClickListener; | 14 class ViewClickListener; |
14 | 15 |
15 // View for simple information in tray. Automatically hides when message is | 16 // View for simple information in tray. Automatically hides when message is |
16 // empty. Supports multiline messages. | 17 // empty. Supports multiline messages. |
17 | 18 |
18 class LabelTrayView : public views::View { | 19 class LabelTrayView : public views::View { |
19 public: | 20 public: |
20 LabelTrayView(ViewClickListener* click_listener, int icon_resource_id); | 21 LabelTrayView(ViewClickListener* click_listener, int icon_resource_id); |
21 ~LabelTrayView() override; | 22 ~LabelTrayView() override; |
22 void SetMessage(const base::string16& message); | 23 void SetMessage(const base::string16& message); |
23 private: | 24 private: |
24 views::View* CreateChildView(const base::string16& message) const; | 25 views::View* CreateChildView(const base::string16& message) const; |
25 | 26 |
26 ViewClickListener* click_listener_; | 27 ViewClickListener* click_listener_; |
27 int icon_resource_id_; | 28 int icon_resource_id_; |
28 base::string16 message_; | 29 base::string16 message_; |
29 | 30 |
30 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); | 31 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); |
31 }; | 32 }; |
32 | 33 |
33 } // namespace ash | 34 } // namespace ash |
34 | 35 |
35 #endif // ASH_SYSTEM_CHROMEOS_LABEL_TRAY_VIEW_H_ | 36 #endif // ASH_SYSTEM_CHROMEOS_LABEL_TRAY_VIEW_H_ |
OLD | NEW |