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 |