| 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 18 matching lines...) Expand all Loading... |
| 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): Switch away from network->security(), once we have | 33 // TODO(quiche): Switch away from network->security(), once we have |
| 34 // a security_class() field in NetworkState. | 34 // a security_class() field in NetworkState. |
| 35 // | 35 // |
| 36 // TODO(quiche): Fill in the actual passphrase via an asynchronous | 36 // TODO(quiche): Fill in the actual passphrase via an asynchronous |
| 37 // call to a chromeos::NetworkConfigurationHandler instance's | 37 // call to a chromeos::NetworkConfigurationHandler instance's |
| 38 // GetProperties method. | 38 // GetProperties method. |
| 39 credentials.insert( | 39 scoped_ptr<WifiCredential> credential = |
| 40 WifiCredential(network->raw_ssid(), | 40 WifiCredential::Create( |
| 41 WifiSecurityClassFromShillSecurity(network->security()), | 41 network->raw_ssid(), |
| 42 "" /* empty passphrase */)); | 42 WifiSecurityClassFromShillSecurity(network->security()), |
| 43 "" /* empty passphrase */); |
| 44 if (!credential) { |
| 45 LOG(ERROR) << "Failed to create credential"; |
| 46 } else { |
| 47 credentials.insert(*credential); |
| 48 } |
| 43 } | 49 } |
| 44 return credentials; | 50 return credentials; |
| 45 } | 51 } |
| 46 | 52 |
| 47 } // namespace wifi_sync | 53 } // namespace wifi_sync |
| OLD | NEW |