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 CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 ExtensionNotificationObserver(content::NotificationSource source, | 26 ExtensionNotificationObserver(content::NotificationSource source, |
27 const std::set<std::string>& extension_ids); | 27 const std::set<std::string>& extension_ids); |
28 | 28 |
29 virtual ~ExtensionNotificationObserver(); | 29 virtual ~ExtensionNotificationObserver(); |
30 | 30 |
31 // Each of these methods returns a testing::AssertionSuccess if exactly those | 31 // Each of these methods returns a testing::AssertionSuccess if exactly those |
32 // notifications occurred for any extensions in |extension_ids|, and no more, | 32 // notifications occurred for any extensions in |extension_ids|, and no more, |
33 // since the last time any of these methods were called. | 33 // since the last time any of these methods were called. |
34 testing::AssertionResult CheckNotifications() WARN_UNUSED_RESULT; | 34 testing::AssertionResult CheckNotifications() WARN_UNUSED_RESULT; |
35 testing::AssertionResult CheckNotifications( | 35 testing::AssertionResult CheckNotifications( |
36 chrome::NotificationType type) WARN_UNUSED_RESULT; | 36 //NOCOMMIT: All these will become extensions::NotificationType. |
| 37 chrome::ExtensionNotificationType type) WARN_UNUSED_RESULT; |
37 testing::AssertionResult CheckNotifications( | 38 testing::AssertionResult CheckNotifications( |
38 chrome::NotificationType t1, | 39 chrome::ExtensionNotificationType t1, |
39 chrome::NotificationType t2) WARN_UNUSED_RESULT; | 40 chrome::ExtensionNotificationType t2) WARN_UNUSED_RESULT; |
40 testing::AssertionResult CheckNotifications( | 41 testing::AssertionResult CheckNotifications( |
41 chrome::NotificationType t1, | 42 chrome::ExtensionNotificationType t1, |
42 chrome::NotificationType t2, | 43 chrome::ExtensionNotificationType t2, |
43 chrome::NotificationType t3) WARN_UNUSED_RESULT; | 44 chrome::ExtensionNotificationType t3) WARN_UNUSED_RESULT; |
44 testing::AssertionResult CheckNotifications( | 45 testing::AssertionResult CheckNotifications( |
45 chrome::NotificationType t1, | 46 chrome::ExtensionNotificationType t1, |
46 chrome::NotificationType t2, | 47 chrome::ExtensionNotificationType t2, |
47 chrome::NotificationType t3, | 48 chrome::ExtensionNotificationType t3, |
48 chrome::NotificationType t4, | 49 chrome::ExtensionNotificationType t4, |
49 chrome::NotificationType t5, | 50 chrome::ExtensionNotificationType t5, |
50 chrome::NotificationType t6) WARN_UNUSED_RESULT; | 51 chrome::ExtensionNotificationType t6) WARN_UNUSED_RESULT; |
51 | 52 |
52 private: | 53 private: |
53 // content::NotificationObserver implementation. | 54 // content::NotificationObserver implementation. |
54 virtual void Observe(int type, | 55 virtual void Observe(int type, |
55 const content::NotificationSource& source, | 56 const content::NotificationSource& source, |
56 const content::NotificationDetails& details) OVERRIDE; | 57 const content::NotificationDetails& details) OVERRIDE; |
57 | 58 |
58 // Checks then clears notifications for our extensions. | 59 // Checks then clears notifications for our extensions. |
59 testing::AssertionResult CheckNotifications( | 60 testing::AssertionResult CheckNotifications( |
60 const std::vector<chrome::NotificationType>& types); | 61 const std::vector<chrome::ExtensionNotificationType>& types); |
61 | 62 |
62 const std::set<std::string> extension_ids_; | 63 const std::set<std::string> extension_ids_; |
63 std::vector<chrome::NotificationType> notifications_; | 64 std::vector<chrome::ExtensionNotificationType> notifications_; |
64 content::NotificationRegistrar registrar_; | 65 content::NotificationRegistrar registrar_; |
65 }; | 66 }; |
66 | 67 |
67 } // namespace extensions | 68 } // namespace extensions |
68 | 69 |
69 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ | 70 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_NOTIFICATION_OBSERVER_H_ |
OLD | NEW |