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

Side by Side Diff: content/public/test/test_notification_tracker.h

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « content/public/test/test_navigation_observer.cc ('k') | content/public/test/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 15 matching lines...) Expand all
26 26
27 int type; 27 int type;
28 NotificationSource source; 28 NotificationSource source;
29 NotificationDetails details; 29 NotificationDetails details;
30 }; 30 };
31 31
32 // By default, it won't listen for any notifications. You'll need to call 32 // By default, it won't listen for any notifications. You'll need to call
33 // ListenFor for the notifications you are interested in. 33 // ListenFor for the notifications you are interested in.
34 TestNotificationTracker(); 34 TestNotificationTracker();
35 35
36 virtual ~TestNotificationTracker(); 36 ~TestNotificationTracker() override;
37 37
38 // Makes this object listen for the given notification with the given source. 38 // Makes this object listen for the given notification with the given source.
39 void ListenFor(int type, const NotificationSource& source); 39 void ListenFor(int type, const NotificationSource& source);
40 40
41 // Makes this object listen for notifications of the given type coming from 41 // Makes this object listen for notifications of the given type coming from
42 // any source. 42 // any source.
43 void ListenForAll(int type); 43 void ListenForAll(int type);
44 44
45 // Clears the list of events. 45 // Clears the list of events.
46 void Reset(); 46 void Reset();
(...skipping 15 matching lines...) Expand all
62 int type3); 62 int type3);
63 63
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 void Observe(int type,
73 const NotificationSource& source, 73 const NotificationSource& source,
74 const NotificationDetails& details) override; 74 const NotificationDetails& details) override;
75
75 private: 76 private:
76 NotificationRegistrar registrar_; 77 NotificationRegistrar registrar_;
77 78
78 // Lists all received since last cleared, in the order they were received. 79 // Lists all received since last cleared, in the order they were received.
79 std::vector<Event> events_; 80 std::vector<Event> events_;
80 81
81 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); 82 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker);
82 }; 83 };
83 84
84 } // namespace content 85 } // namespace content
85 86
86 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ 87 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_
OLDNEW
« no previous file with comments | « content/public/test/test_navigation_observer.cc ('k') | content/public/test/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698