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

Unified Diff: chromeos/network/network_state_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 + Add NetworkConnectionHandler to NetworkHandler 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_state_handler.h
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index a68e33ad1013d4d1cbc955a9461bd7c89e4c493b..d9768c82d8021cb2005a307cb76e2fe7c0c3b071 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -16,6 +16,7 @@
#include "base/observer_list.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/network/managed_state.h"
+#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_handler_callbacks.h"
#include "chromeos/network/shill_property_handler.h"
@@ -67,18 +68,6 @@ class CHROMEOS_EXPORT NetworkStateHandler
virtual ~NetworkStateHandler();
- // Sets the global instance. Must be called before any calls to Get().
- static void Initialize();
-
- // Returns true if the global instance has been initialized.
- static bool IsInitialized();
-
- // Destroys the global instance.
- static void Shutdown();
-
- // Gets the global instance. Initialize() must be called first.
- static NetworkStateHandler* Get();
-
// Add/remove observers.
void AddObserver(NetworkStateHandlerObserver* observer);
void RemoveObserver(NetworkStateHandlerObserver* observer);
@@ -167,12 +156,16 @@ class CHROMEOS_EXPORT NetworkStateHandler
void GetNetworkStatePropertiesForTest(
base::DictionaryValue* dictionary) const;
+ // Construct and initialize an instance for testing.
+ static NetworkStateHandler* InitializeForTest();
+
static const char kMatchTypeDefault[];
static const char kMatchTypeWireless[];
static const char kMatchTypeMobile[];
static const char kMatchTypeNonVirtual[];
protected:
+ friend class NetworkHandler;
NetworkStateHandler();
// ShillPropertyHandler::Listener overrides.
@@ -215,7 +208,7 @@ class CHROMEOS_EXPORT NetworkStateHandler
virtual void ManagedStateListChanged(
ManagedState::ManagedType type) OVERRIDE;
- // Called in Initialize(). Called explicitly by tests after adding
+ // Called after construction. Called explicitly by tests after adding
// test observers.
void InitShillPropertyHandler();

Powered by Google App Engine
This is Rietveld 408576698