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

Side by Side Diff: chrome/browser/ssl/ssl_client_auth_requestor_mock.cc

Issue 1304143010: Plumbing SSLPrivateKey Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase. Created 4 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl/ssl_client_auth_requestor_mock.h" 5 #include "chrome/browser/ssl/ssl_client_auth_requestor_mock.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "content/public/browser/client_certificate_delegate.h" 8 #include "content/public/browser/client_certificate_delegate.h"
9 #include "net/ssl/ssl_cert_request_info.h" 9 #include "net/ssl/ssl_cert_request_info.h"
10 #include "net/ssl/ssl_private_key.h"
10 #include "net/url_request/url_request.h" 11 #include "net/url_request/url_request.h"
11 12
12 namespace { 13 namespace {
13 14
14 class FakeClientCertificateDelegate 15 class FakeClientCertificateDelegate
15 : public content::ClientCertificateDelegate { 16 : public content::ClientCertificateDelegate {
16 public: 17 public:
17 explicit FakeClientCertificateDelegate(SSLClientAuthRequestorMock* requestor) 18 explicit FakeClientCertificateDelegate(SSLClientAuthRequestorMock* requestor)
18 : requestor_(requestor) {} 19 : requestor_(requestor) {}
19 20
20 ~FakeClientCertificateDelegate() override { 21 ~FakeClientCertificateDelegate() override {
21 if (requestor_) 22 if (requestor_)
22 requestor_->CancelCertificateSelection(); 23 requestor_->CancelCertificateSelection();
23 } 24 }
24 25
25 // content::ClientCertificateDelegate implementation: 26 // content::ClientCertificateDelegate implementation:
26 void ContinueWithCertificate(net::X509Certificate* cert) override { 27 void ContinueWithCertificate(net::X509Certificate* cert,
28 net::SSLPrivateKey* private_key) override {
27 requestor_->CertificateSelected(cert); 29 requestor_->CertificateSelected(cert);
28 requestor_ = nullptr; 30 requestor_ = nullptr;
29 } 31 }
30 32
31 private: 33 private:
32 scoped_refptr<SSLClientAuthRequestorMock> requestor_; 34 scoped_refptr<SSLClientAuthRequestorMock> requestor_;
33 35
34 DISALLOW_COPY_AND_ASSIGN(FakeClientCertificateDelegate); 36 DISALLOW_COPY_AND_ASSIGN(FakeClientCertificateDelegate);
35 }; 37 };
36 38
37 } // namespace 39 } // namespace
38 40
39 SSLClientAuthRequestorMock::SSLClientAuthRequestorMock( 41 SSLClientAuthRequestorMock::SSLClientAuthRequestorMock(
40 net::URLRequest* request, 42 net::URLRequest* request,
41 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info) 43 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info)
42 : cert_request_info_(cert_request_info) { 44 : cert_request_info_(cert_request_info) {
43 } 45 }
44 46
45 SSLClientAuthRequestorMock::~SSLClientAuthRequestorMock() {} 47 SSLClientAuthRequestorMock::~SSLClientAuthRequestorMock() {}
46 48
47 scoped_ptr<content::ClientCertificateDelegate> 49 scoped_ptr<content::ClientCertificateDelegate>
48 SSLClientAuthRequestorMock::CreateDelegate() { 50 SSLClientAuthRequestorMock::CreateDelegate() {
49 return make_scoped_ptr(new FakeClientCertificateDelegate(this)); 51 return make_scoped_ptr(new FakeClientCertificateDelegate(this));
50 } 52 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_client_auth_observer.cc ('k') | chrome/browser/ui/android/ssl_client_certificate_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698