| 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_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 DISALLOW_COPY_AND_ASSIGN(ScreenTrayView); | 39 DISALLOW_COPY_AND_ASSIGN(ScreenTrayView); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class ScreenStatusView : public views::View, public views::ButtonListener { | 42 class ScreenStatusView : public views::View, public views::ButtonListener { |
| 43 public: | 43 public: |
| 44 ScreenStatusView(ScreenTrayItem* screen_tray_item, | 44 ScreenStatusView(ScreenTrayItem* screen_tray_item, |
| 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 ~ScreenStatusView() override; | 47 ~ScreenStatusView() override; |
| 48 | 48 |
| 49 // Overridden from views::View. | |
| 50 void Layout() override; | |
| 51 | |
| 52 // Overridden from views::ButtonListener. | 49 // Overridden from views::ButtonListener. |
| 53 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 50 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 54 | 51 |
| 55 void CreateItems(); | 52 void CreateItems(); |
| 56 void Update(); | 53 void UpdateFromScreenTrayItem(); |
| 54 |
| 55 protected: |
| 56 views::ImageView* icon() { return icon_; } |
| 57 views::Label* label() { return label_; } |
| 57 | 58 |
| 58 private: | 59 private: |
| 60 // The controller for this view. May be null. |
| 59 ScreenTrayItem* screen_tray_item_; | 61 ScreenTrayItem* screen_tray_item_; |
| 60 views::ImageView* icon_; | 62 views::ImageView* icon_; |
| 61 views::Label* label_; | 63 views::Label* label_; |
| 62 TrayPopupLabelButton* stop_button_; | 64 views::View* stop_button_; |
| 63 base::string16 label_text_; | 65 base::string16 label_text_; |
| 64 base::string16 stop_button_text_; | 66 base::string16 stop_button_text_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(ScreenStatusView); | 68 DISALLOW_COPY_AND_ASSIGN(ScreenStatusView); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 class ScreenNotificationDelegate : public message_center::NotificationDelegate { | 71 class ScreenNotificationDelegate : public message_center::NotificationDelegate { |
| 70 public: | 72 public: |
| 71 explicit ScreenNotificationDelegate(ScreenTrayItem* screen_tray); | 73 explicit ScreenNotificationDelegate(ScreenTrayItem* screen_tray); |
| 72 | 74 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 tray::ScreenStatusView* default_view_; | 131 tray::ScreenStatusView* default_view_; |
| 130 bool is_started_; | 132 bool is_started_; |
| 131 base::Closure stop_callback_; | 133 base::Closure stop_callback_; |
| 132 | 134 |
| 133 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); | 135 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace ash | 138 } // namespace ash |
| 137 | 139 |
| 138 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ | 140 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ |
| OLD | NEW |