| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROMEOS_NETWORK_NETWORK_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_HANDLER_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 class CertLoader; | 14 class CertLoader; |
| 15 class GeolocationHandler; | 15 class GeolocationHandler; |
| 16 class ManagedNetworkConfigurationHandler; | 16 class ManagedNetworkConfigurationHandler; |
| 17 class NetworkConfigurationHandler; | 17 class NetworkConfigurationHandler; |
| 18 class NetworkConnectionHandler; | 18 class NetworkConnectionHandler; |
| 19 class NetworkProfileHandler; | 19 class NetworkProfileHandler; |
| 20 class NetworkStateHandler; | 20 class NetworkStateHandler; |
| 21 | 21 |
| 22 // Class for handling initialization and access to chromeos network handlers. | 22 // Class for handling initialization and access to chromeos network handlers. |
| 23 // This class should NOT be used in unit tests. Instead, construct individual | 23 // This class should NOT be used in unit tests. Instead, construct individual |
| 24 // classes independently. | 24 // classes independently. |
| 25 class CHROMEOS_EXPORT NetworkHandler { | 25 class CHROMEOS_EXPORT NetworkHandler { |
| 26 public: | 26 public: |
| 27 // Sets the global instance. Must be called before any calls to Get(). | 27 // Sets the global instance. Must be called before any calls to Get(). |
| 28 static void Initialize(); | 28 static void Initialize(); |
| 29 | 29 |
| 30 // Sets the global instance for testing. |
| 31 static void InitializeForTest(); |
| 32 |
| 30 // Destroys the global instance. | 33 // Destroys the global instance. |
| 31 static void Shutdown(); | 34 static void Shutdown(); |
| 32 | 35 |
| 33 // Gets the global instance. Initialize() must be called first. | 36 // Gets the global instance. Initialize() must be called first. |
| 34 static NetworkHandler* Get(); | 37 static NetworkHandler* Get(); |
| 35 | 38 |
| 36 // Returns true if the global instance has been initialized. | 39 // Returns true if the global instance has been initialized. |
| 37 static bool IsInitialized(); | 40 static bool IsInitialized(); |
| 38 | 41 |
| 39 // Do not use these accessors within this module; all dependencies should be | 42 // Do not use these accessors within this module; all dependencies should be |
| (...skipping 22 matching lines...) Expand all Loading... |
| 62 managed_network_configuration_handler_; | 65 managed_network_configuration_handler_; |
| 63 scoped_ptr<NetworkConnectionHandler> network_connection_handler_; | 66 scoped_ptr<NetworkConnectionHandler> network_connection_handler_; |
| 64 scoped_ptr<GeolocationHandler> geolocation_handler_; | 67 scoped_ptr<GeolocationHandler> geolocation_handler_; |
| 65 | 68 |
| 66 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); | 69 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 } // namespace chromeos | 72 } // namespace chromeos |
| 70 | 73 |
| 71 #endif // CHROMEOS_NETWORK_NETWORK_HANDLER_H_ | 74 #endif // CHROMEOS_NETWORK_NETWORK_HANDLER_H_ |
| OLD | NEW |