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 CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Returns the number of notifications received since the last reset. | 64 // Returns the number of notifications received since the last reset. |
65 size_t size() const { return events_.size(); } | 65 size_t size() const { return events_.size(); } |
66 | 66 |
67 // Returns the information about the event at the given index. The index must | 67 // Returns the information about the event at the given index. The index must |
68 // be in [0, size). | 68 // be in [0, size). |
69 const Event& at(size_t i) const { return events_[i]; } | 69 const Event& at(size_t i) const { return events_[i]; } |
70 | 70 |
71 protected: | 71 protected: |
72 virtual void Observe(int type, | 72 virtual void Observe(int type, |
73 const NotificationSource& source, | 73 const NotificationSource& source, |
74 const NotificationDetails& details) OVERRIDE; | 74 const NotificationDetails& details) override; |
75 private: | 75 private: |
76 NotificationRegistrar registrar_; | 76 NotificationRegistrar registrar_; |
77 | 77 |
78 // Lists all received since last cleared, in the order they were received. | 78 // Lists all received since last cleared, in the order they were received. |
79 std::vector<Event> events_; | 79 std::vector<Event> events_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); | 81 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
85 | 85 |
86 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 86 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
OLD | NEW |