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_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 protected: | 56 protected: |
57 virtual ~Observer() {} | 57 virtual ~Observer() {} |
58 }; | 58 }; |
59 | 59 |
60 static DialRegistry* GetInstance(); | 60 static DialRegistry* GetInstance(); |
61 | 61 |
62 // Called by the DIAL API when event listeners are added or removed. The dial | 62 // Called by the DIAL API when event listeners are added or removed. The dial |
63 // service is started after the first listener is added and stopped after the | 63 // service is started after the first listener is added and stopped after the |
64 // last listener is removed. | 64 // last listener is removed. |
65 void OnListenerAdded(); | 65 virtual void OnListenerAdded(); |
66 void OnListenerRemoved(); | 66 virtual void OnListenerRemoved(); |
67 | 67 |
68 // pass a reference of |observer| to allow it to notify on DIAL device events. | 68 // pass a reference of |observer| to allow it to notify on DIAL device events. |
69 // This class does not take ownership of observer. | 69 // This class does not take ownership of observer. |
70 virtual void RegisterObserver(Observer* observer); | 70 virtual void RegisterObserver(Observer* observer); |
71 virtual void UnregisterObserver(Observer* observer); | 71 virtual void UnregisterObserver(Observer* observer); |
72 | 72 |
73 // Called by the DIAL API to try to kickoff a discovery if there is not one | 73 // Called by the DIAL API to try to kickoff a discovery if there is not one |
74 // already active. | 74 // already active. |
75 bool DiscoverNow(); | 75 bool DiscoverNow(); |
76 | 76 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 TestRemovingListenerDoesNotClearList); | 206 TestRemovingListenerDoesNotClearList); |
207 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); | 207 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); |
208 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, | 208 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, |
209 TestNetworkEventConnectionRestored); | 209 TestNetworkEventConnectionRestored); |
210 DISALLOW_COPY_AND_ASSIGN(DialRegistry); | 210 DISALLOW_COPY_AND_ASSIGN(DialRegistry); |
211 }; | 211 }; |
212 | 212 |
213 } // namespace media_router | 213 } // namespace media_router |
214 | 214 |
215 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ | 215 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_H_ |
OLD | NEW |