| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" | 5 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 13 #include "components/wifi_sync/wifi_config_delegate.h" | 13 #include "components/wifi_sync/wifi_config_delegate.h" |
| 14 #include "components/wifi_sync/wifi_credential_syncable_service.h" | 14 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 15 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
| 16 | 16 |
| 17 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
| 18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
| 19 #include "chromeos/login/login_state.h" | 19 #include "chromeos/login/login_state.h" |
| 20 #include "chromeos/network/network_handler.h" | 20 #include "chromeos/network/network_handler.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #if defined(OS_CHROMEOS) | 82 #if defined(OS_CHROMEOS) |
| 83 return new WifiCredentialSyncableService( | 83 return new WifiCredentialSyncableService( |
| 84 BuildWifiConfigDelegateChromeOs(context)); | 84 BuildWifiConfigDelegateChromeOs(context)); |
| 85 #else | 85 #else |
| 86 NOTREACHED(); | 86 NOTREACHED(); |
| 87 return nullptr; | 87 return nullptr; |
| 88 #endif | 88 #endif |
| 89 } | 89 } |
| 90 | 90 |
| 91 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
| 92 scoped_ptr<WifiConfigDelegate> | 92 std::unique_ptr<WifiConfigDelegate> |
| 93 WifiCredentialSyncableServiceFactory::BuildWifiConfigDelegateChromeOs( | 93 WifiCredentialSyncableServiceFactory::BuildWifiConfigDelegateChromeOs( |
| 94 content::BrowserContext* context) const { | 94 content::BrowserContext* context) const { |
| 95 // Note: NetworkHandler is a singleton that is managed by | 95 // Note: NetworkHandler is a singleton that is managed by |
| 96 // ChromeBrowserMainPartsChromeos, and destroyed after all | 96 // ChromeBrowserMainPartsChromeos, and destroyed after all |
| 97 // KeyedService instances are destroyed. | 97 // KeyedService instances are destroyed. |
| 98 chromeos::NetworkHandler* network_handler = chromeos::NetworkHandler::Get(); | 98 chromeos::NetworkHandler* network_handler = chromeos::NetworkHandler::Get(); |
| 99 return make_scoped_ptr(new WifiConfigDelegateChromeOs( | 99 return base::WrapUnique(new WifiConfigDelegateChromeOs( |
| 100 GetUserHash(context, !ignore_login_state_for_test_), | 100 GetUserHash(context, !ignore_login_state_for_test_), |
| 101 network_handler->managed_network_configuration_handler())); | 101 network_handler->managed_network_configuration_handler())); |
| 102 } | 102 } |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 } // namespace wifi_sync | 105 } // namespace wifi_sync |
| OLD | NEW |