Chromium Code Reviews| 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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 class SystemBubbleWrapper; | 24 class SystemBubbleWrapper; |
| 25 class SystemTrayDelegate; | 25 class SystemTrayDelegate; |
| 26 class SystemTrayItem; | 26 class SystemTrayItem; |
| 27 class TrayAccessibility; | 27 class TrayAccessibility; |
| 28 class TrayAudio; | 28 class TrayAudio; |
| 29 class TrayCast; | 29 class TrayCast; |
| 30 class TrayDate; | 30 class TrayDate; |
| 31 class TrayUpdate; | 31 class TrayUpdate; |
| 32 class TrayUser; | 32 class TrayUser; |
| 33 class WebNotificationTray; | 33 class WebNotificationTray; |
| 34 class WmShelfObserver; | |
| 34 | 35 |
| 35 // There are different methods for creating bubble views. | 36 // There are different methods for creating bubble views. |
| 36 enum BubbleCreationType { | 37 enum BubbleCreationType { |
| 37 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 38 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
| 38 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 39 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 class ASH_EXPORT SystemTray : public TrayBackgroundView, | 42 class ASH_EXPORT SystemTray : public TrayBackgroundView, |
| 42 public views::TrayBubbleView::Delegate { | 43 public views::TrayBubbleView::Delegate { |
| 43 public: | 44 public: |
| 44 explicit SystemTray(WmShelf* wm_shelf); | 45 explicit SystemTray(WmShelf* wm_shelf, WmShelfObserver* wm_shelf_observer); |
|
James Cook
2016/08/09 00:25:17
no explicit
yiyix
2016/08/11 01:23:19
Done.
| |
| 45 ~SystemTray() override; | 46 ~SystemTray() override; |
| 46 | 47 |
| 47 // Calls TrayBackgroundView::Initialize(), creates the tray items, and | 48 // Calls TrayBackgroundView::Initialize(), creates the tray items, and |
| 48 // adds them to SystemTrayNotifier. | 49 // adds them to SystemTrayNotifier. |
| 49 void InitializeTrayItems(SystemTrayDelegate* delegate, | 50 void InitializeTrayItems(SystemTrayDelegate* delegate, |
| 50 WebNotificationTray* web_notification_tray); | 51 WebNotificationTray* web_notification_tray); |
| 51 | 52 |
| 52 // Resets internal pointers. | 53 // Resets internal pointers. |
| 53 void Shutdown(); | 54 void Shutdown(); |
| 54 | 55 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 | 211 |
| 211 // Deactivate the system tray in the shelf if it was active before. | 212 // Deactivate the system tray in the shelf if it was active before. |
| 212 void CloseSystemBubbleAndDeactivateSystemTray(); | 213 void CloseSystemBubbleAndDeactivateSystemTray(); |
| 213 | 214 |
| 214 // Records UMA metrics for the number of user-visible rows in the system menu | 215 // Records UMA metrics for the number of user-visible rows in the system menu |
| 215 // and the percentage of the work area height covered by the system menu. | 216 // and the percentage of the work area height covered by the system menu. |
| 216 void RecordSystemMenuMetrics(); | 217 void RecordSystemMenuMetrics(); |
| 217 | 218 |
| 218 const ScopedVector<SystemTrayItem>& items() const { return items_; } | 219 const ScopedVector<SystemTrayItem>& items() const { return items_; } |
| 219 | 220 |
| 221 // Sets an empty border around the system tray to change user-visible size | |
| 222 // of the dark background. Doesn't do anything in MD. | |
|
James Cook
2016/08/09 00:25:17
nice documentation, esp. noting the MD vs non-MD s
yiyix
2016/08/11 01:23:19
Thank you :D
| |
| 223 void AdjustStatusTrayBackground(); | |
| 224 | |
| 220 // Overridden from ActionableView. | 225 // Overridden from ActionableView. |
| 221 bool PerformAction(const ui::Event& event) override; | 226 bool PerformAction(const ui::Event& event) override; |
| 222 | 227 |
| 223 // The web notification tray view that appears adjacent to this view. | 228 // The web notification tray view that appears adjacent to this view. |
| 224 WebNotificationTray* web_notification_tray_; | 229 WebNotificationTray* web_notification_tray_; |
| 225 | 230 |
| 226 // Owned items. | 231 // Owned items. |
| 227 ScopedVector<SystemTrayItem> items_; | 232 ScopedVector<SystemTrayItem> items_; |
| 228 | 233 |
| 229 // Pointers to members of |items_|. | 234 // Pointers to members of |items_|. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 // A reference to the Screen share and capture item. | 267 // A reference to the Screen share and capture item. |
| 263 ScreenTrayItem* screen_capture_tray_item_; // not owned | 268 ScreenTrayItem* screen_capture_tray_item_; // not owned |
| 264 ScreenTrayItem* screen_share_tray_item_; // not owned | 269 ScreenTrayItem* screen_share_tray_item_; // not owned |
| 265 | 270 |
| 266 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 271 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 267 }; | 272 }; |
| 268 | 273 |
| 269 } // namespace ash | 274 } // namespace ash |
| 270 | 275 |
| 271 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 276 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |