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

Unified Diff: chromeos/network/network_profile_handler.cc

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.cc
diff --git a/chromeos/network/network_profile_handler.cc b/chromeos/network/network_profile_handler.cc
index 30c8fde78eb00274c715305bae8d8b3596263eae..579bd6935704f50ccff699fad45e0fb48ecb3e19 100644
--- a/chromeos/network/network_profile_handler.cc
+++ b/chromeos/network/network_profile_handler.cc
@@ -18,8 +18,6 @@
namespace chromeos {
-static NetworkProfileHandler* g_profile_handler_instance = NULL;
-
namespace {
bool ConvertListValueToStringVector(const base::ListValue& string_list,
@@ -74,31 +72,6 @@ class NetworkProfileHandlerImpl : public NetworkProfileHandler {
} // namespace
-// static
-NetworkProfileHandler* NetworkProfileHandler::Initialize() {
- CHECK(!g_profile_handler_instance);
- g_profile_handler_instance = new NetworkProfileHandlerImpl();
- return g_profile_handler_instance;
-}
-
-// static
-bool NetworkProfileHandler::IsInitialized() {
- return g_profile_handler_instance;
-}
-
-// static
-void NetworkProfileHandler::Shutdown() {
- CHECK(g_profile_handler_instance);
- delete g_profile_handler_instance;
- g_profile_handler_instance = NULL;
-}
-
-// static
-NetworkProfileHandler* NetworkProfileHandler::Get() {
- CHECK(g_profile_handler_instance);
- return g_profile_handler_instance;
-}
-
void NetworkProfileHandler::AddObserver(NetworkProfileObserver* observer) {
observers_.AddObserver(observer);
}
@@ -182,6 +155,10 @@ void NetworkProfileHandler::GetProfilePropertiesCallback(
AddProfile(NetworkProfile(profile_path, userhash));
}
+void NetworkProfileHandler::AddProfileForTest(const NetworkProfile& profile) {
+ AddProfile(profile);
+}
+
void NetworkProfileHandler::AddProfile(const NetworkProfile& profile) {
VLOG(2) << "Adding profile " << profile.ToDebugString() << ".";
profiles_.push_back(profile);

Powered by Google App Engine
This is Rietveld 408576698