| 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 29 matching lines...) Expand all Loading... |
| 40 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 40 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
| 41 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 41 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class ASH_EXPORT SystemTray : public TrayBackgroundView, | 44 class ASH_EXPORT SystemTray : public TrayBackgroundView, |
| 45 public views::TrayBubbleView::Delegate { | 45 public views::TrayBubbleView::Delegate { |
| 46 public: | 46 public: |
| 47 explicit SystemTray(WmShelf* wm_shelf); | 47 explicit SystemTray(WmShelf* wm_shelf); |
| 48 ~SystemTray() override; | 48 ~SystemTray() override; |
| 49 | 49 |
| 50 TrayUpdate* tray_update() { return tray_update_; } | |
| 51 | |
| 52 // Calls TrayBackgroundView::Initialize(), creates the tray items, and | 50 // Calls TrayBackgroundView::Initialize(), creates the tray items, and |
| 53 // adds them to SystemTrayNotifier. | 51 // adds them to SystemTrayNotifier. |
| 54 void InitializeTrayItems(SystemTrayDelegate* delegate, | 52 void InitializeTrayItems(SystemTrayDelegate* delegate, |
| 55 WebNotificationTray* web_notification_tray); | 53 WebNotificationTray* web_notification_tray); |
| 56 | 54 |
| 57 // Resets internal pointers. This has to be called before deletion. | 55 // Resets internal pointers. This has to be called before deletion. |
| 58 void Shutdown(); | 56 void Shutdown(); |
| 59 | 57 |
| 60 // Adds a new item in the tray. Takes ownership. | 58 // Adds a new item in the tray. Takes ownership. |
| 61 void AddTrayItem(SystemTrayItem* item); | 59 void AddTrayItem(SystemTrayItem* item); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 161 } |
| 164 | 162 |
| 165 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. | 163 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. |
| 166 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); | 164 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); |
| 167 | 165 |
| 168 TrayCast* GetTrayCastForTesting() const; | 166 TrayCast* GetTrayCastForTesting() const; |
| 169 TrayDate* GetTrayDateForTesting() const; | 167 TrayDate* GetTrayDateForTesting() const; |
| 170 TrayNetwork* GetTrayNetworkForTesting() const; | 168 TrayNetwork* GetTrayNetworkForTesting() const; |
| 171 TraySystemInfo* GetTraySystemInfoForTesting() const; | 169 TraySystemInfo* GetTraySystemInfoForTesting() const; |
| 172 TrayTiles* GetTrayTilesForTesting() const; | 170 TrayTiles* GetTrayTilesForTesting() const; |
| 171 TrayUpdate* GetTrayUpdateForTesting() const; |
| 173 | 172 |
| 174 // Activates the system tray bubble. | 173 // Activates the system tray bubble. |
| 175 void ActivateBubble(); | 174 void ActivateBubble(); |
| 176 | 175 |
| 177 private: | 176 private: |
| 178 class ActivationObserver; | 177 class ActivationObserver; |
| 179 | 178 |
| 180 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback. | 179 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback. |
| 181 void CloseBubble(const ui::KeyEvent& key_event); | 180 void CloseBubble(const ui::KeyEvent& key_event); |
| 182 | 181 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 std::unique_ptr<KeyEventWatcher> key_event_watcher_; | 284 std::unique_ptr<KeyEventWatcher> key_event_watcher_; |
| 286 | 285 |
| 287 std::unique_ptr<ActivationObserver> activation_observer_; | 286 std::unique_ptr<ActivationObserver> activation_observer_; |
| 288 | 287 |
| 289 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 288 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 290 }; | 289 }; |
| 291 | 290 |
| 292 } // namespace ash | 291 } // namespace ash |
| 293 | 292 |
| 294 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 293 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |