Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: ash/common/system/tray/system_tray.h

Issue 2558043006: ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: fix gcc Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
50 // Calls TrayBackgroundView::Initialize(), creates the tray items, and 52 // Calls TrayBackgroundView::Initialize(), creates the tray items, and
51 // adds them to SystemTrayNotifier. 53 // adds them to SystemTrayNotifier.
52 void InitializeTrayItems(SystemTrayDelegate* delegate, 54 void InitializeTrayItems(SystemTrayDelegate* delegate,
53 WebNotificationTray* web_notification_tray); 55 WebNotificationTray* web_notification_tray);
54 56
55 // Resets internal pointers. This has to be called before deletion. 57 // Resets internal pointers. This has to be called before deletion.
56 void Shutdown(); 58 void Shutdown();
57 59
58 // Adds a new item in the tray. Takes ownership. 60 // Adds a new item in the tray. Takes ownership.
59 void AddTrayItem(SystemTrayItem* item); 61 void AddTrayItem(SystemTrayItem* item);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 163 }
162 164
163 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. 165 // Get the tray item view (or NULL) for a given |tray_item| in a unit test.
164 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); 166 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item);
165 167
166 TrayCast* GetTrayCastForTesting() const; 168 TrayCast* GetTrayCastForTesting() const;
167 TrayDate* GetTrayDateForTesting() const; 169 TrayDate* GetTrayDateForTesting() const;
168 TrayNetwork* GetTrayNetworkForTesting() const; 170 TrayNetwork* GetTrayNetworkForTesting() const;
169 TraySystemInfo* GetTraySystemInfoForTesting() const; 171 TraySystemInfo* GetTraySystemInfoForTesting() const;
170 TrayTiles* GetTrayTilesForTesting() const; 172 TrayTiles* GetTrayTilesForTesting() const;
171 TrayUpdate* GetTrayUpdateForTesting() const;
172 173
173 // Activates the system tray bubble. 174 // Activates the system tray bubble.
174 void ActivateBubble(); 175 void ActivateBubble();
175 176
176 private: 177 private:
177 class ActivationObserver; 178 class ActivationObserver;
178 179
179 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback. 180 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback.
180 void CloseBubble(const ui::KeyEvent& key_event); 181 void CloseBubble(const ui::KeyEvent& key_event);
181 182
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 std::unique_ptr<KeyEventWatcher> key_event_watcher_; 285 std::unique_ptr<KeyEventWatcher> key_event_watcher_;
285 286
286 std::unique_ptr<ActivationObserver> activation_observer_; 287 std::unique_ptr<ActivationObserver> activation_observer_;
287 288
288 DISALLOW_COPY_AND_ASSIGN(SystemTray); 289 DISALLOW_COPY_AND_ASSIGN(SystemTray);
289 }; 290 };
290 291
291 } // namespace ash 292 } // namespace ash
292 293
293 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ 294 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/default_system_tray_delegate.cc ('k') | ash/common/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698