Index: ash/system/tray/tray_details_view.h |
diff --git a/ash/system/tray/tray_details_view.h b/ash/system/tray/tray_details_view.h |
index f046fcdcdeec65b9c5ef0b51d7c26a5ff1a25161..bcff2511afcea2c8ad5ea59b2065a330d90c3eb7 100644 |
--- a/ash/system/tray/tray_details_view.h |
+++ b/ash/system/tray/tray_details_view.h |
@@ -8,11 +8,13 @@ |
#include <memory> |
#include "ash/ash_export.h" |
+#include "ash/system/tray/actionable_view.h" |
#include "ash/system/tray/tray_constants.h" |
#include "ash/system/tray/view_click_listener.h" |
#include "base/macros.h" |
#include "base/timer/timer.h" |
#include "ui/views/controls/button/button.h" |
+#include "ui/views/controls/button/label_button.h" |
#include "ui/views/view.h" |
namespace gfx { |
@@ -61,16 +63,43 @@ class ASH_EXPORT TrayDetailsView : public views::View, |
class InfoLabel : public View { |
public: |
explicit InfoLabel(int message_id); |
- ~InfoLabel() override; |
+ virtual void SetMessage(int message_id) = 0; |
- void SetMessage(int message_id); |
+ DISALLOW_COPY_AND_ASSIGN(InfoLabel); |
Kyle Horimoto
2017/07/07 17:33:59
This should be private.
lesliewatkins
2017/07/09 00:57:48
Done.
|
+ }; |
+ |
+ class InfoLabelNoAction : public InfoLabel { |
Kyle Horimoto
2017/07/07 17:34:00
nit: tanderson@ probably has a better idea about U
tdanderson
2017/07/07 21:25:11
I made a suggestion above that could avoid introdu
lesliewatkins
2017/07/09 00:57:47
Acknowledged.
|
+ public: |
+ InfoLabelNoAction(int message_id); |
+ |
+ // InfoLabel: |
+ void SetMessage(int message_id) override; |
private: |
views::Label* const label_; |
- DISALLOW_COPY_AND_ASSIGN(InfoLabel); |
+ DISALLOW_COPY_AND_ASSIGN(InfoLabelNoAction); |
}; |
+ class InfoLabelEnableBluetooth : public InfoLabel, |
Kyle Horimoto
2017/07/07 17:33:59
Does this even need to be an InfoLabel at all? The
|
+ public views::ButtonListener { |
tdanderson
2017/07/07 21:25:11
By extending ButtonListener instead of ActionableV
|
+ public: |
+ InfoLabelEnableBluetooth(int message_id); |
+ |
+ // ButtonListener: |
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
+ // InfoLabel: |
Kyle Horimoto
2017/07/07 17:34:00
nit: Newline before this.
|
+ void SetMessage(int message_id) override; |
+ |
+ private: |
+ views::LabelButton* const label_button_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(InfoLabelEnableBluetooth); |
+ }; |
+ |
+ // InfoLabel: Factory method |
Kyle Horimoto
2017/07/07 17:33:59
nit: Remove this comment and/or change the descrip
|
+ InfoLabel* CreateInfoLabel(int message_id); |
Kyle Horimoto
2017/07/07 17:33:59
This should be static.
|
+ |
// views::View: |
void Layout() override; |
int GetHeightForWidth(int width) const override; |