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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // Returns the number of currently active notifications. | 43 // Returns the number of currently active notifications. |
44 unsigned int GetNotificationCount() const; | 44 unsigned int GetNotificationCount() const; |
45 | 45 |
46 // Returns a reference to the notification at index |index|. | 46 // Returns a reference to the notification at index |index|. |
47 const Notification& GetNotificationAt(unsigned int index) const; | 47 const Notification& GetNotificationAt(unsigned int index) const; |
48 | 48 |
49 // Sets a one-shot callback that will be invoked when a notification has been | 49 // Sets a one-shot callback that will be invoked when a notification has been |
50 // added to the Notification UI manager. Will be invoked on the UI thread. | 50 // added to the Notification UI manager. Will be invoked on the UI thread. |
51 void SetNotificationAddedCallback(const base::Closure& callback); | 51 void SetNotificationAddedCallback(const base::Closure& callback); |
52 | 52 |
53 // Emulates clearing a notification from the notification center | |
54 // without running any of the delegates. This is often possible | |
55 // from native notification centers. | |
Peter Beverloo
2016/12/02 13:43:34
s/This is...notification/centers/ -->
This may ha
Miguel Garcia
2016/12/06 12:01:18
Done.
| |
56 bool ClearNotificationById(const std::string& delegate_id, | |
Peter Beverloo
2016/12/02 13:43:34
nit: what about "SilentDismissById" to further dis
Miguel Garcia
2016/12/06 12:01:18
Done.
| |
57 ProfileID profile_id); | |
58 | |
53 // NotificationUIManager implementation. | 59 // NotificationUIManager implementation. |
54 void Add(const Notification& notification, Profile* profile) override; | 60 void Add(const Notification& notification, Profile* profile) override; |
55 bool Update(const Notification& notification, Profile* profile) override; | 61 bool Update(const Notification& notification, Profile* profile) override; |
56 const Notification* FindById(const std::string& delegate_id, | 62 const Notification* FindById(const std::string& delegate_id, |
57 ProfileID profile_id) const override; | 63 ProfileID profile_id) const override; |
58 bool CancelById(const std::string& delegate_id, | 64 bool CancelById(const std::string& delegate_id, |
59 ProfileID profile_id) override; | 65 ProfileID profile_id) override; |
60 std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 66 std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
61 ProfileID profile_id, | 67 ProfileID profile_id, |
62 const GURL& source) override; | 68 const GURL& source) override; |
(...skipping 20 matching lines...) Expand all Loading... | |
83 void Wait(); | 89 void Wait(); |
84 | 90 |
85 private: | 91 private: |
86 Browser* browser_; | 92 Browser* browser_; |
87 bool desired_state_; | 93 bool desired_state_; |
88 | 94 |
89 DISALLOW_COPY_AND_ASSIGN(FullscreenStateWaiter); | 95 DISALLOW_COPY_AND_ASSIGN(FullscreenStateWaiter); |
90 }; | 96 }; |
91 | 97 |
92 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ | 98 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ |
OLD | NEW |