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

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_mac.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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
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 "chrome/browser/extensions/api/networking_private/networking_private_cr edentials_getter.h" 5 #include "chrome/browser/extensions/api/networking_private/networking_private_cr edentials_getter.h"
6 6
7 #include <Security/Security.h> 7 #include <Security/Security.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "base/base64.h" 12 #include "base/base64.h"
11 #include "base/bind.h" 13 #include "base/bind.h"
12 #include "base/macros.h" 14 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/common/extensions/api/networking_private/networking_private_cry pto.h" 15 #include "chrome/common/extensions/api/networking_private/networking_private_cry pto.h"
15 #include "components/wifi/wifi_service.h" 16 #include "components/wifi/wifi_service.h"
16 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
17 18
18 const char kErrorEncryption[] = "Error.Encryption"; 19 const char kErrorEncryption[] = "Error.Encryption";
19 20
20 using content::BrowserThread; 21 using content::BrowserThread;
21 22
22 namespace extensions { 23 namespace extensions {
23 24
(...skipping 15 matching lines...) Expand all
39 NetworkingPrivateCredentialsGetterMac::NetworkingPrivateCredentialsGetterMac() { 40 NetworkingPrivateCredentialsGetterMac::NetworkingPrivateCredentialsGetterMac() {
40 } 41 }
41 42
42 NetworkingPrivateCredentialsGetterMac:: 43 NetworkingPrivateCredentialsGetterMac::
43 ~NetworkingPrivateCredentialsGetterMac() {} 44 ~NetworkingPrivateCredentialsGetterMac() {}
44 45
45 void NetworkingPrivateCredentialsGetterMac::Start( 46 void NetworkingPrivateCredentialsGetterMac::Start(
46 const std::string& network_guid, 47 const std::string& network_guid,
47 const std::string& public_key, 48 const std::string& public_key,
48 const CredentialsCallback& callback) { 49 const CredentialsCallback& callback) {
49 scoped_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create()); 50 std::unique_ptr<wifi::WiFiService> wifi_service(wifi::WiFiService::Create());
50 wifi_service->Initialize(NULL); 51 wifi_service->Initialize(NULL);
51 std::string key_data; 52 std::string key_data;
52 std::string error; 53 std::string error;
53 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error); 54 wifi_service->GetKeyFromSystem(network_guid, &key_data, &error);
54 55
55 if (!error.empty()) { 56 if (!error.empty()) {
56 callback.Run("", error); 57 callback.Run("", error);
57 return; 58 return;
58 } 59 }
59 60
(...skipping 12 matching lines...) Expand all
72 &base64_encoded_ciphertext); 73 &base64_encoded_ciphertext);
73 callback.Run(base64_encoded_ciphertext, ""); 74 callback.Run(base64_encoded_ciphertext, "");
74 } 75 }
75 76
76 NetworkingPrivateCredentialsGetter* 77 NetworkingPrivateCredentialsGetter*
77 NetworkingPrivateCredentialsGetter::Create() { 78 NetworkingPrivateCredentialsGetter::Create() {
78 return new NetworkingPrivateCredentialsGetterMac(); 79 return new NetworkingPrivateCredentialsGetterMac();
79 } 80 }
80 81
81 } // namespace extensions 82 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698