| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SCREEN_TRAY_ITEM_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_ | 6 #define ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_ |
| 7 | 7 |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
| 10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class ScreenStatusView : public views::View, | 40 class ScreenStatusView : public views::View, |
| 41 public views::ButtonListener { | 41 public views::ButtonListener { |
| 42 public: | 42 public: |
| 43 ScreenStatusView(ScreenTrayItem* screen_tray_item, | 43 ScreenStatusView(ScreenTrayItem* screen_tray_item, |
| 44 int icon_id, | 44 int icon_id, |
| 45 const base::string16& label_text, | 45 const base::string16& label_text, |
| 46 const base::string16& stop_button_text); | 46 const base::string16& stop_button_text); |
| 47 virtual ~ScreenStatusView(); | 47 virtual ~ScreenStatusView(); |
| 48 | 48 |
| 49 // Overridden from views::View. | 49 // Overridden from views::View. |
| 50 virtual void Layout() OVERRIDE; | 50 virtual void Layout() override; |
| 51 | 51 |
| 52 // Overridden from views::ButtonListener. | 52 // Overridden from views::ButtonListener. |
| 53 virtual void ButtonPressed(views::Button* sender, | 53 virtual void ButtonPressed(views::Button* sender, |
| 54 const ui::Event& event) OVERRIDE; | 54 const ui::Event& event) override; |
| 55 | 55 |
| 56 void CreateItems(); | 56 void CreateItems(); |
| 57 void Update(); | 57 void Update(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 ScreenTrayItem* screen_tray_item_; | 60 ScreenTrayItem* screen_tray_item_; |
| 61 views::ImageView* icon_; | 61 views::ImageView* icon_; |
| 62 views::Label* label_; | 62 views::Label* label_; |
| 63 TrayPopupLabelButton* stop_button_; | 63 TrayPopupLabelButton* stop_button_; |
| 64 int icon_id_; | 64 int icon_id_; |
| 65 base::string16 label_text_; | 65 base::string16 label_text_; |
| 66 base::string16 stop_button_text_; | 66 base::string16 stop_button_text_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ScreenStatusView); | 68 DISALLOW_COPY_AND_ASSIGN(ScreenStatusView); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class ScreenNotificationDelegate : public message_center::NotificationDelegate { | 71 class ScreenNotificationDelegate : public message_center::NotificationDelegate { |
| 72 public: | 72 public: |
| 73 explicit ScreenNotificationDelegate(ScreenTrayItem* screen_tray); | 73 explicit ScreenNotificationDelegate(ScreenTrayItem* screen_tray); |
| 74 | 74 |
| 75 // message_center::NotificationDelegate overrides: | 75 // message_center::NotificationDelegate overrides: |
| 76 virtual void Display() OVERRIDE; | 76 virtual void Display() override; |
| 77 virtual void Error() OVERRIDE; | 77 virtual void Error() override; |
| 78 virtual void Close(bool by_user) OVERRIDE; | 78 virtual void Close(bool by_user) override; |
| 79 virtual void Click() OVERRIDE; | 79 virtual void Click() override; |
| 80 virtual void ButtonClick(int button_index) OVERRIDE; | 80 virtual void ButtonClick(int button_index) override; |
| 81 | 81 |
| 82 protected: | 82 protected: |
| 83 virtual ~ScreenNotificationDelegate(); | 83 virtual ~ScreenNotificationDelegate(); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 ScreenTrayItem* screen_tray_; | 86 ScreenTrayItem* screen_tray_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(ScreenNotificationDelegate); | 88 DISALLOW_COPY_AND_ASSIGN(ScreenNotificationDelegate); |
| 89 }; | 89 }; |
| 90 | 90 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 void Start(const base::Closure& stop_callback); | 116 void Start(const base::Closure& stop_callback); |
| 117 void Stop(); | 117 void Stop(); |
| 118 | 118 |
| 119 // Creates or updates the notification for the tray item. | 119 // Creates or updates the notification for the tray item. |
| 120 virtual void CreateOrUpdateNotification() = 0; | 120 virtual void CreateOrUpdateNotification() = 0; |
| 121 | 121 |
| 122 // Returns the id of the notification for the tray item. | 122 // Returns the id of the notification for the tray item. |
| 123 virtual std::string GetNotificationId() = 0; | 123 virtual std::string GetNotificationId() = 0; |
| 124 | 124 |
| 125 // Overridden from SystemTrayItem. | 125 // Overridden from SystemTrayItem. |
| 126 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE = 0; | 126 virtual views::View* CreateTrayView(user::LoginStatus status) override = 0; |
| 127 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE = 0; | 127 virtual views::View* CreateDefaultView(user::LoginStatus status) override = 0; |
| 128 virtual void DestroyTrayView() OVERRIDE; | 128 virtual void DestroyTrayView() override; |
| 129 virtual void DestroyDefaultView() OVERRIDE; | 129 virtual void DestroyDefaultView() override; |
| 130 virtual void UpdateAfterShelfAlignmentChange( | 130 virtual void UpdateAfterShelfAlignmentChange( |
| 131 ShelfAlignment alignment) OVERRIDE; | 131 ShelfAlignment alignment) override; |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 tray::ScreenTrayView* tray_view_; | 134 tray::ScreenTrayView* tray_view_; |
| 135 tray::ScreenStatusView* default_view_; | 135 tray::ScreenStatusView* default_view_; |
| 136 bool is_started_; | 136 bool is_started_; |
| 137 base::Closure stop_callback_; | 137 base::Closure stop_callback_; |
| 138 | 138 |
| 139 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); | 139 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace ash | 142 } // namespace ash |
| 143 | 143 |
| 144 #endif // ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_ | 144 #endif // ASH_SYSTEM_CHROMEOS_SCREEN_TRAY_ITEM_H_ |
| OLD | NEW |