| 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_LABEL_TRAY_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ |
| 6 #define ASH_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ | 6 #define ASH_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 { | 12 namespace gfx { |
| 13 struct VectorIcon; | 13 struct VectorIcon; |
| 14 } // namespace gfx | 14 } // namespace gfx |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 class ViewClickListener; | 17 class ViewClickListener; |
| 18 | 18 |
| 19 // A view to display an icon and message text in the system menu which | 19 // A view to display an icon and message text in the system menu which |
| 20 // automatically hides when the message text is empty. Multi-line message text | 20 // automatically hides when the message text is empty. Multi-line message text |
| 21 // is supported. | 21 // is supported. |
| 22 class LabelTrayView : public views::View { | 22 class LabelTrayView : public views::View { |
| 23 public: | 23 public: |
| 24 // If |click_listener| is null then no action is taken on click. |
| 24 LabelTrayView(ViewClickListener* click_listener, const gfx::VectorIcon& icon); | 25 LabelTrayView(ViewClickListener* click_listener, const gfx::VectorIcon& icon); |
| 25 ~LabelTrayView() override; | 26 ~LabelTrayView() override; |
| 27 |
| 28 const base::string16& message() { return message_; } |
| 29 |
| 26 void SetMessage(const base::string16& message); | 30 void SetMessage(const base::string16& message); |
| 27 | 31 |
| 28 private: | 32 private: |
| 29 views::View* CreateChildView(const base::string16& message) const; | 33 views::View* CreateChildView(const base::string16& message) const; |
| 30 | 34 |
| 31 ViewClickListener* click_listener_; | 35 ViewClickListener* click_listener_; |
| 32 const gfx::VectorIcon& icon_; | 36 const gfx::VectorIcon& icon_; |
| 33 base::string16 message_; | 37 base::string16 message_; |
| 34 | 38 |
| 35 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); | 39 DISALLOW_COPY_AND_ASSIGN(LabelTrayView); |
| 36 }; | 40 }; |
| 37 | 41 |
| 38 } // namespace ash | 42 } // namespace ash |
| 39 | 43 |
| 40 #endif // ASH_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ | 44 #endif // ASH_SYSTEM_TRAY_LABEL_TRAY_VIEW_H_ |
| OLD | NEW |