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

Unified Diff: chromeos/network/network_handler.h

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + elim LoginState dependency Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/network/network_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_handler.h
diff --git a/chromeos/network/network_handler.h b/chromeos/network/network_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..81ecda80740bd41ed12232264a2a41c3c4f82dcb
--- /dev/null
+++ b/chromeos/network/network_handler.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_NETWORK_NETWORK_HANDLER_H_
+#define CHROMEOS_NETWORK_NETWORK_HANDLER_H_
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+class CertLoader;
+class GeolocationHandler;
+class ManagedNetworkConfigurationHandler;
+class NetworkConfigurationHandler;
+class NetworkConnectionHandler;
+class NetworkProfileHandler;
+class NetworkStateHandler;
+
+// Class for handling initialization and access to chromeos network handlers.
+// This clas should NOT be used in unit tests. Instead, construct individual
gauravsh 2013/05/24 17:20:24 class
+// classes independently.
+class CHROMEOS_EXPORT NetworkHandler {
+ public:
+ // Sets the global instance. Must be called before any calls to Get().
+ static void Initialize();
+
+ // Destroys the global instance.
+ static void Shutdown();
+
+ // Gets the global instance. Initialize() must be called first.
+ static NetworkHandler* Get();
+
+ // Returns true if the global instance has been initialized.
+ static bool IsInitialized();
+
+ // Do not use these accessors within this module; all dependencies should be
+ // explicit so that classes can be constructed explicitly in tests without
+ // NetworkHandler.
+ CertLoader* cert_loader();
+ NetworkStateHandler* network_state_handler();
+ NetworkProfileHandler* network_profile_handler();
+ NetworkConfigurationHandler* network_configuration_handler();
+ ManagedNetworkConfigurationHandler* managed_network_configuration_handler();
+ NetworkConnectionHandler* network_connection_handler();
+ GeolocationHandler* geolocation_handler();
+
+ private:
+ NetworkHandler();
+ virtual ~NetworkHandler();
+
+ void Init();
+
+ // The order of these determines the (inverse) destruction order.
+ scoped_ptr<CertLoader> cert_loader_;
+ scoped_ptr<NetworkStateHandler> network_state_handler_;
+ scoped_ptr<NetworkProfileHandler> network_profile_handler_;
+ scoped_ptr<NetworkConfigurationHandler> network_configuration_handler_;
+ scoped_ptr<ManagedNetworkConfigurationHandler>
+ managed_network_configuration_handler_;
+ scoped_ptr<NetworkConnectionHandler> network_connection_handler_;
+ scoped_ptr<GeolocationHandler> geolocation_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_NETWORK_NETWORK_HANDLER_H_
« no previous file with comments | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/network/network_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698