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

Unified Diff: chromeos/network/network_profile_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: . 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_profile_handler.h
diff --git a/chromeos/network/network_profile_handler.h b/chromeos/network/network_profile_handler.h
index 9dbc5d486df331f5dd1ebc8a6643f18ae4a8eb96..049ec40a317d9087c8cd690c5a716f328a83ff1b 100644
--- a/chromeos/network/network_profile_handler.h
+++ b/chromeos/network/network_profile_handler.h
@@ -15,6 +15,7 @@
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/shill_property_changed_observer.h"
+#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_profile.h"
namespace base {
@@ -30,22 +31,11 @@ class CHROMEOS_EXPORT NetworkProfileHandler
public:
typedef std::vector<NetworkProfile> ProfileList;
- // Initializes the singleton and registers it for DBus events.
- static NetworkProfileHandler* Initialize();
-
- // Returns if the singleton is initialized.
- static bool IsInitialized();
-
- // Unregisters the singleton from DBus events and destroys it.
- static void Shutdown();
-
- // Initialize() must be called before this.
- static NetworkProfileHandler* Get();
+ virtual ~NetworkProfileHandler();
void AddObserver(NetworkProfileObserver* observer);
void RemoveObserver(NetworkProfileObserver* observer);
- void RequestInitialProfileList();
void GetManagerPropertiesCallback(DBusMethodCallStatus call_status,
const base::DictionaryValue& properties);
@@ -61,12 +51,11 @@ class CHROMEOS_EXPORT NetworkProfileHandler
const NetworkProfile* GetProfileForUserhash(
const std::string& userhash) const;
+ void AddProfileForTest(const NetworkProfile& profile);
+
protected:
- // We make the de-/constructor protected to prevent their usage except in
- // tests by deriving a stub (see NetworkProfileHandlerStub). Outside of tests,
- // the singleton should be retrieved with the static Get() function.
+ friend class NetworkHandler;
NetworkProfileHandler();
- virtual ~NetworkProfileHandler();
void AddProfile(const NetworkProfile& profile);
void RemoveProfile(const std::string& profile_path);

Powered by Google App Engine
This is Rietveld 408576698