| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TEST_TEST_NOTIFICATION_TRACKER_H_ | 5 #ifndef CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| 6 #define CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ | 6 #define CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 NotificationType type2, | 56 NotificationType type2, |
| 57 NotificationType type3); | 57 NotificationType type3); |
| 58 | 58 |
| 59 // Returns the number of notifications received since the last reset. | 59 // Returns the number of notifications received since the last reset. |
| 60 size_t size() const { return events_.size(); } | 60 size_t size() const { return events_.size(); } |
| 61 | 61 |
| 62 // Returns the information about the event at the given index. The index must | 62 // Returns the information about the event at the given index. The index must |
| 63 // be in [0, size). | 63 // be in [0, size). |
| 64 const Event& at(size_t i) const { return events_[i]; } | 64 const Event& at(size_t i) const { return events_[i]; } |
| 65 | 65 |
| 66 private: | 66 protected: |
| 67 virtual void Observe(NotificationType type, | 67 virtual void Observe(NotificationType type, |
| 68 const NotificationSource& source, | 68 const NotificationSource& source, |
| 69 const NotificationDetails& details); | 69 const NotificationDetails& details); |
| 70 | 70 private: |
| 71 NotificationRegistrar registrar_; | 71 NotificationRegistrar registrar_; |
| 72 | 72 |
| 73 // Lists all received since last cleared, in the order they were received. | 73 // Lists all received since last cleared, in the order they were received. |
| 74 std::vector<Event> events_; | 74 std::vector<Event> events_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); | 76 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ | 79 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| OLD | NEW |