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/network_state_helper_chromeos.h" | 5 #include "components/wifi_sync/network_state_helper_chromeos.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chromeos/network/network_state.h" | 8 #include "chromeos/network/network_state.h" |
9 #include "chromeos/network/network_state_handler.h" | 9 #include "chromeos/network/network_state_handler.h" |
10 #include "chromeos/network/network_type_pattern.h" | 10 #include "chromeos/network/network_type_pattern.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 &networks); | 26 &networks); |
27 | 27 |
28 auto credentials(WifiCredential::MakeSet()); | 28 auto credentials(WifiCredential::MakeSet()); |
29 for (const chromeos::NetworkState* network : networks) { | 29 for (const chromeos::NetworkState* network : networks) { |
30 if (network->profile_path() != shill_profile_path) | 30 if (network->profile_path() != shill_profile_path) |
31 continue; | 31 continue; |
32 | 32 |
33 // TODO(quiche): Fill in the actual passphrase via an asynchronous | 33 // TODO(quiche): Fill in the actual passphrase via an asynchronous |
34 // call to a chromeos::NetworkConfigurationHandler instance's | 34 // call to a chromeos::NetworkConfigurationHandler instance's |
35 // GetProperties method. | 35 // GetProperties method. |
36 scoped_ptr<WifiCredential> credential = | 36 std::unique_ptr<WifiCredential> credential = WifiCredential::Create( |
danakj
2016/04/25 18:32:58
include memory
dcheng
2016/04/25 19:55:06
Done.
| |
37 WifiCredential::Create( | 37 network->raw_ssid(), |
38 network->raw_ssid(), | 38 WifiSecurityClassFromShillSecurity(network->security_class()), |
39 WifiSecurityClassFromShillSecurity(network->security_class()), | 39 "" /* empty passphrase */); |
40 "" /* empty passphrase */); | |
41 if (!credential) | 40 if (!credential) |
42 LOG(ERROR) << "Failed to create credential"; | 41 LOG(ERROR) << "Failed to create credential"; |
43 else | 42 else |
44 credentials.insert(*credential); | 43 credentials.insert(*credential); |
45 } | 44 } |
46 return credentials; | 45 return credentials; |
47 } | 46 } |
48 | 47 |
49 } // namespace wifi_sync | 48 } // namespace wifi_sync |
OLD | NEW |