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

Unified Diff: chromeos/network/network_connection_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: Fix chromeos_unittests 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
Index: chromeos/network/network_connection_handler.h
diff --git a/chromeos/network/network_connection_handler.h b/chromeos/network/network_connection_handler.h
index cc147befe6ff3c5d28889aa3640e606e19111c8f..a4d233defa9c98315c1f63eaa805280714f93cf0 100644
--- a/chromeos/network/network_connection_handler.h
+++ b/chromeos/network/network_connection_handler.h
@@ -14,6 +14,7 @@
#include "base/values.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/dbus_method_call_status.h"
+#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_handler_callbacks.h"
namespace chromeos {
@@ -49,14 +50,7 @@ class CHROMEOS_EXPORT NetworkConnectionHandler
static const char kErrorShillError[];
static const char kErrorPreviousConnectFailed[];
- // 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 NetworkConnectionHandler* Get();
+ ~NetworkConnectionHandler();
// ConnectToNetwork() will start an asynchronous connection attempt.
// On success, |success_callback| will be called.
@@ -89,8 +83,12 @@ class CHROMEOS_EXPORT NetworkConnectionHandler
const network_handler::ErrorCallback& error_callback);
private:
+ friend class NetworkHandler;
+ friend class NetworkConnectionHandlerTest;
NetworkConnectionHandler();
- ~NetworkConnectionHandler();
+
+ void Init(NetworkStateHandler* network_state_handler,
+ NetworkConfigurationHandler* network_configuration_handler);
// Calls Shill.Manager.Connect asynchronously.
void CallShillConnect(
@@ -133,6 +131,11 @@ class CHROMEOS_EXPORT NetworkConnectionHandler
const std::string& error_name,
const std::string& error_message);
+ // Local references to the associated handler instances.
+ NetworkStateHandler* network_state_handler_;
+ NetworkProfileHandler* network_profile_handler_;
+ NetworkConfigurationHandler* network_configuration_handler_;
+
// Set of pending connect requests, used to prevent repeat attempts while
// waiting for Shill.
std::set<std::string> pending_requests_;
« no previous file with comments | « chromeos/network/network_configuration_handler_unittest.cc ('k') | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698