| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // The base tray item for screen capture and screen sharing. The | 87 // The base tray item for screen capture and screen sharing. The |
| 88 // Start method brings up a notification and a tray item, and the user | 88 // Start method brings up a notification and a tray item, and the user |
| 89 // can stop the screen capture/sharing by pressing the stop button. | 89 // can stop the screen capture/sharing by pressing the stop button. |
| 90 class ASH_EXPORT ScreenTrayItem : public SystemTrayItem { | 90 class ASH_EXPORT ScreenTrayItem : public SystemTrayItem { |
| 91 public: | 91 public: |
| 92 ScreenTrayItem(SystemTray* system_tray, UmaType uma_type); | 92 ScreenTrayItem(SystemTray* system_tray, UmaType uma_type); |
| 93 ~ScreenTrayItem() override; | 93 ~ScreenTrayItem() override; |
| 94 | 94 |
| 95 tray::ScreenTrayView* tray_view() { return tray_view_; } | 95 tray::ScreenTrayView* tray_view() { return tray_view_; } |
| 96 void set_tray_view(tray::ScreenTrayView* tray_view) { | |
| 97 tray_view_ = tray_view; | |
| 98 } | |
| 99 | 96 |
| 100 tray::ScreenStatusView* default_view() { return default_view_; } | 97 tray::ScreenStatusView* default_view() { return default_view_; } |
| 101 void set_default_view(tray::ScreenStatusView* default_view) { | 98 void set_default_view(tray::ScreenStatusView* default_view) { |
| 102 default_view_ = default_view; | 99 default_view_ = default_view; |
| 103 } | 100 } |
| 104 | 101 |
| 105 bool is_started() const { return is_started_; } | 102 bool is_started() const { return is_started_; } |
| 106 void set_is_started(bool is_started) { is_started_ = is_started; } | 103 void set_is_started(bool is_started) { is_started_ = is_started; } |
| 107 | 104 |
| 108 void Update(); | 105 void Update(); |
| 109 void Start(const base::Closure& stop_callback); | 106 void Start(const base::Closure& stop_callback); |
| 110 void Stop(); | 107 void Stop(); |
| 111 | 108 |
| 112 // Creates or updates the notification for the tray item. | 109 // Creates or updates the notification for the tray item. |
| 113 virtual void CreateOrUpdateNotification() = 0; | 110 virtual void CreateOrUpdateNotification() = 0; |
| 114 | 111 |
| 115 // Returns the id of the notification for the tray item. | 112 // Returns the id of the notification for the tray item. |
| 116 virtual std::string GetNotificationId() = 0; | 113 virtual std::string GetNotificationId() = 0; |
| 117 | 114 |
| 118 // Called after Stop() is invoked from the default view. | 115 // Called after Stop() is invoked from the default view. |
| 119 virtual void RecordStoppedFromDefaultViewMetric() = 0; | 116 virtual void RecordStoppedFromDefaultViewMetric() = 0; |
| 120 | 117 |
| 121 // Called after Stop() is invoked from the notification view. | 118 // Called after Stop() is invoked from the notification view. |
| 122 virtual void RecordStoppedFromNotificationViewMetric() = 0; | 119 virtual void RecordStoppedFromNotificationViewMetric() = 0; |
| 123 | 120 |
| 124 // Overridden from SystemTrayItem. | 121 // Overridden from SystemTrayItem. |
| 125 views::View* CreateTrayView(LoginStatus status) override = 0; | 122 views::View* CreateTrayView(LoginStatus status) override; |
| 126 views::View* CreateDefaultView(LoginStatus status) override = 0; | 123 views::View* CreateDefaultView(LoginStatus status) override = 0; |
| 127 void DestroyTrayView() override; | 124 void DestroyTrayView() override; |
| 128 void DestroyDefaultView() override; | 125 void DestroyDefaultView() override; |
| 129 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; | |
| 130 | 126 |
| 131 private: | 127 private: |
| 132 tray::ScreenTrayView* tray_view_; | 128 tray::ScreenTrayView* tray_view_; |
| 133 tray::ScreenStatusView* default_view_; | 129 tray::ScreenStatusView* default_view_; |
| 134 bool is_started_; | 130 bool is_started_; |
| 135 base::Closure stop_callback_; | 131 base::Closure stop_callback_; |
| 136 | 132 |
| 137 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); | 133 DISALLOW_COPY_AND_ASSIGN(ScreenTrayItem); |
| 138 }; | 134 }; |
| 139 | 135 |
| 140 } // namespace ash | 136 } // namespace ash |
| 141 | 137 |
| 142 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ | 138 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SCREEN_SECURITY_SCREEN_TRAY_ITEM_H_ |
| OLD | NEW |