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

Unified Diff: components/wifi_sync/wifi_credential_syncable_service_factory.cc

Issue 1426393003: NOT FOR REVIEW Base URL: https://chromium.googlesource.com/chromium/src.git@submit-4.5-split-wcss
Patch Set: Created 5 years, 1 month 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: components/wifi_sync/wifi_credential_syncable_service_factory.cc
diff --git a/components/wifi_sync/wifi_credential_syncable_service_factory.cc b/components/wifi_sync/wifi_credential_syncable_service_factory.cc
index bd60c0c68ba86f8bdbcb30789c1f6bf1d9af92d9..bfe3050579947522e8b81fa523c5405fc53b3826 100644
--- a/components/wifi_sync/wifi_credential_syncable_service_factory.cc
+++ b/components/wifi_sync/wifi_credential_syncable_service_factory.cc
@@ -18,6 +18,7 @@
#include "chromeos/login/login_state.h"
#include "chromeos/network/network_handler.h"
#include "components/wifi_sync/wifi_config_delegate_chromeos.h"
+#include "components/wifi_sync/wifi_config_observer_chromeos.h"
#endif
namespace wifi_sync {
@@ -80,7 +81,8 @@ KeyedService* WifiCredentialSyncableServiceFactory::BuildServiceInstanceFor(
// crbug.com/430681.
#if defined(OS_CHROMEOS)
return new WifiCredentialSyncableServiceImpl(
- BuildWifiConfigDelegateChromeOs(context));
+ BuildWifiConfigDelegateChromeOs(context),
+ BuildWifiConfigObserverChromeOs(context));
#else
NOTREACHED();
return nullptr;
@@ -99,6 +101,20 @@ WifiCredentialSyncableServiceFactory::BuildWifiConfigDelegateChromeOs(
GetUserHash(context, !ignore_login_state_for_test_),
network_handler->managed_network_configuration_handler()));
}
+
+scoped_ptr<WifiConfigObserver>
+WifiCredentialSyncableServiceFactory::BuildWifiConfigObserverChromeOs(
+ content::BrowserContext* context) const {
+ // Note: NetworkHandler is a singleton that is managed by
+ // ChromeBrowserMainPartsChromeos, and destroyed after all
+ // KeyedService instances are destroyed.
+ chromeos::NetworkHandler* network_handler = chromeos::NetworkHandler::Get();
+ return make_scoped_ptr(new WifiConfigObserverChromeOs(
+ GetUserHash(context, !ignore_login_state_for_test_), // XXX
+ network_handler->managed_network_configuration_handler(),
+ network_handler->network_configuration_handler(),
+ network_handler->network_state_handler()));
+}
#endif
} // namespace wifi_sync

Powered by Google App Engine
This is Rietveld 408576698