| 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_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 protected: | 81 protected: |
| 82 // The DIAL service. Periodic discovery is active when this is not NULL. | 82 // The DIAL service. Periodic discovery is active when this is not NULL. |
| 83 scoped_ptr<DialService> dial_; | 83 scoped_ptr<DialService> dial_; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 typedef base::hash_map<std::string, linked_ptr<DialDeviceData> > | 86 typedef base::hash_map<std::string, linked_ptr<DialDeviceData> > |
| 87 DeviceByIdMap; | 87 DeviceByIdMap; |
| 88 typedef std::map<std::string, linked_ptr<DialDeviceData> > DeviceByLabelMap; | 88 typedef std::map<std::string, linked_ptr<DialDeviceData> > DeviceByLabelMap; |
| 89 | 89 |
| 90 // DialService::Observer: | 90 // DialService::Observer: |
| 91 virtual void OnDiscoveryRequest(DialService* service) OVERRIDE; | 91 virtual void OnDiscoveryRequest(DialService* service) override; |
| 92 virtual void OnDeviceDiscovered(DialService* service, | 92 virtual void OnDeviceDiscovered(DialService* service, |
| 93 const DialDeviceData& device) OVERRIDE; | 93 const DialDeviceData& device) override; |
| 94 virtual void OnDiscoveryFinished(DialService* service) OVERRIDE; | 94 virtual void OnDiscoveryFinished(DialService* service) override; |
| 95 virtual void OnError(DialService* service, | 95 virtual void OnError(DialService* service, |
| 96 const DialService::DialServiceErrorCode& code) OVERRIDE; | 96 const DialService::DialServiceErrorCode& code) override; |
| 97 | 97 |
| 98 // net::NetworkChangeObserver: | 98 // net::NetworkChangeObserver: |
| 99 virtual void OnNetworkChanged( | 99 virtual void OnNetworkChanged( |
| 100 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 100 net::NetworkChangeNotifier::ConnectionType type) override; |
| 101 | 101 |
| 102 // Starts and stops periodic discovery. Periodic discovery is done when there | 102 // Starts and stops periodic discovery. Periodic discovery is done when there |
| 103 // are registered event listeners. | 103 // are registered event listeners. |
| 104 void StartPeriodicDiscovery(); | 104 void StartPeriodicDiscovery(); |
| 105 void StopPeriodicDiscovery(); | 105 void StopPeriodicDiscovery(); |
| 106 | 106 |
| 107 // Check whether we are in a state ready to discover and dispatch error | 107 // Check whether we are in a state ready to discover and dispatch error |
| 108 // notifications if not. | 108 // notifications if not. |
| 109 bool ReadyToDiscover(); | 109 bool ReadyToDiscover(); |
| 110 | 110 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 TestRemovingListenerDoesNotClearList); | 184 TestRemovingListenerDoesNotClearList); |
| 185 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); | 185 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); |
| 186 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, | 186 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, |
| 187 TestNetworkEventConnectionRestored); | 187 TestNetworkEventConnectionRestored); |
| 188 DISALLOW_COPY_AND_ASSIGN(DialRegistry); | 188 DISALLOW_COPY_AND_ASSIGN(DialRegistry); |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 } // namespace extensions | 191 } // namespace extensions |
| 192 | 192 |
| 193 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 193 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
| OLD | NEW |