Chromium Code Reviews| 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_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 11 | 11 |
| 12 namespace gfx { | |
| 13 struct VectorIcon; | |
| 14 } // namespace gfx | |
| 15 | |
| 12 namespace ash { | 16 namespace ash { |
| 13 | |
| 14 class ViewClickListener; | 17 class ViewClickListener; |
| 15 | 18 |
| 16 // View for simple information in tray. Automatically hides when message is | 19 // A view to display an icon and message text in the system menu which |
| 17 // empty. Supports multiline messages. | 20 // automatically hides when the message text is empty. Multi-line |
|
Evan Stade
2017/02/22 21:43:46
seems like this comment is wrapped early
tdanderson
2017/03/30 14:51:39
Done.
| |
| 18 | 21 // message text is supported. |
| 19 class LabelTrayView : public views::View { | 22 class LabelTrayView : public views::View { |
| 20 public: | 23 public: |
| 21 LabelTrayView(ViewClickListener* click_listener, int icon_resource_id); | 24 LabelTrayView(ViewClickListener* click_listener, const gfx::VectorIcon& icon); |
| 22 ~LabelTrayView() override; | 25 ~LabelTrayView() override; |
| 23 void SetMessage(const base::string16& message); | 26 void SetMessage(const base::string16& message); |
| 24 | 27 |
| 25 private: | 28 private: |
| 26 views::View* CreateChildView(const base::string16& message) const; | 29 views::View* CreateChildView(const base::string16& message) const; |
| 27 | 30 |
| 28 ViewClickListener* click_listener_; | 31 ViewClickListener* click_listener_; |
| 29 int icon_resource_id_; | 32 const gfx::VectorIcon& icon_; |
| 30 base::string16 message_; | 33 base::string16 message_; |
| 31 | 34 |
| 32 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); | 35 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 } // namespace ash | 38 } // namespace ash |
| 36 | 39 |
| 37 #endif // ASH_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ | 40 #endif // ASH_COMMON_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ |
| OLD | NEW |