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

Side by Side Diff: components/wifi_sync/network_state_helper_chromeos.cc

Issue 1917673002: Convert //components/[u-z]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « components/wifi/wifi_test.cc ('k') | components/wifi_sync/wifi_config_delegate_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "chromeos/network/network_state.h" 10 #include "chromeos/network/network_state.h"
9 #include "chromeos/network/network_state_handler.h" 11 #include "chromeos/network/network_state_handler.h"
10 #include "chromeos/network/network_type_pattern.h" 12 #include "chromeos/network/network_type_pattern.h"
11 #include "components/wifi_sync/wifi_security_class.h" 13 #include "components/wifi_sync/wifi_security_class.h"
12 14
13 namespace wifi_sync { 15 namespace wifi_sync {
14 16
15 WifiCredential::CredentialSet GetWifiCredentialsForShillProfile( 17 WifiCredential::CredentialSet GetWifiCredentialsForShillProfile(
16 chromeos::NetworkStateHandler* network_state_handler, 18 chromeos::NetworkStateHandler* network_state_handler,
17 const std::string& shill_profile_path) { 19 const std::string& shill_profile_path) {
18 DCHECK(network_state_handler); 20 DCHECK(network_state_handler);
19 21
20 chromeos::NetworkStateHandler::NetworkStateList networks; 22 chromeos::NetworkStateHandler::NetworkStateList networks;
21 network_state_handler->GetNetworkListByType( 23 network_state_handler->GetNetworkListByType(
22 chromeos::NetworkTypePattern::WiFi(), 24 chromeos::NetworkTypePattern::WiFi(),
23 true /* configured_only */, 25 true /* configured_only */,
24 false /* visible_only */, 26 false /* visible_only */,
25 0 /* unlimited result size */, 27 0 /* unlimited result size */,
26 &networks); 28 &networks);
27 29
28 auto credentials(WifiCredential::MakeSet()); 30 auto credentials(WifiCredential::MakeSet());
29 for (const chromeos::NetworkState* network : networks) { 31 for (const chromeos::NetworkState* network : networks) {
30 if (network->profile_path() != shill_profile_path) 32 if (network->profile_path() != shill_profile_path)
31 continue; 33 continue;
32 34
33 // TODO(quiche): Fill in the actual passphrase via an asynchronous 35 // TODO(quiche): Fill in the actual passphrase via an asynchronous
34 // call to a chromeos::NetworkConfigurationHandler instance's 36 // call to a chromeos::NetworkConfigurationHandler instance's
35 // GetProperties method. 37 // GetProperties method.
36 scoped_ptr<WifiCredential> credential = 38 std::unique_ptr<WifiCredential> credential = WifiCredential::Create(
37 WifiCredential::Create( 39 network->raw_ssid(),
38 network->raw_ssid(), 40 WifiSecurityClassFromShillSecurity(network->security_class()),
39 WifiSecurityClassFromShillSecurity(network->security_class()), 41 "" /* empty passphrase */);
40 "" /* empty passphrase */);
41 if (!credential) 42 if (!credential)
42 LOG(ERROR) << "Failed to create credential"; 43 LOG(ERROR) << "Failed to create credential";
43 else 44 else
44 credentials.insert(*credential); 45 credentials.insert(*credential);
45 } 46 }
46 return credentials; 47 return credentials;
47 } 48 }
48 49
49 } // namespace wifi_sync 50 } // namespace wifi_sync
OLDNEW
« no previous file with comments | « components/wifi/wifi_test.cc ('k') | components/wifi_sync/wifi_config_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698