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

Side by Side Diff: chrome/browser/ui/views/ssl_client_certificate_selector.h

Issue 9384014: Remove knowledge about SSLClientAuthHandler from chrome. Instead a callback is given to the embed... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments+sync Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
6 #define CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 6 #define CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/string16.h" 14 #include "base/string16.h"
15 #include "content/browser/ssl/ssl_client_auth_handler.h" 15 #include "chrome/browser/ssl/ssl_client_auth_observer.h"
16 #include "ui/views/controls/button/button.h" 16 #include "ui/views/controls/button/button.h"
17 #include "ui/views/controls/table/table_view_observer.h" 17 #include "ui/views/controls/table/table_view_observer.h"
18 #include "ui/views/view.h" 18 #include "ui/views/view.h"
19 #include "ui/views/window/dialog_delegate.h" 19 #include "ui/views/window/dialog_delegate.h"
20 20
21 // This header file exists only for testing. Chrome should access the 21 // This header file exists only for testing. Chrome should access the
22 // certificate selector only through the cross-platform interface 22 // certificate selector only through the cross-platform interface
23 // chrome/browser/ssl_client_certificate_selector.h. 23 // chrome/browser/ssl_client_certificate_selector.h.
24 24
25 namespace net {
26 class SSLCertRequestInfo;
27 class X509Certificate;
28 }
29
25 namespace views { 30 namespace views {
26 class TableView; 31 class TableView;
27 class TextButton; 32 class TextButton;
28 } 33 }
29 34
30 class CertificateSelectorTableModel; 35 class CertificateSelectorTableModel;
31 class ConstrainedWindow; 36 class ConstrainedWindow;
32 class TabContentsWrapper; 37 class TabContentsWrapper;
33 38
34 class SSLClientCertificateSelector : public SSLClientAuthObserver, 39 class SSLClientCertificateSelector : public SSLClientAuthObserver,
35 public views::DialogDelegateView, 40 public views::DialogDelegateView,
36 public views::ButtonListener, 41 public views::ButtonListener,
37 public views::TableViewObserver { 42 public views::TableViewObserver {
38 public: 43 public:
39 SSLClientCertificateSelector( 44 SSLClientCertificateSelector(
40 TabContentsWrapper* wrapper, 45 TabContentsWrapper* wrapper,
46 const net::HttpNetworkSession* network_session,
41 net::SSLCertRequestInfo* cert_request_info, 47 net::SSLCertRequestInfo* cert_request_info,
42 SSLClientAuthHandler* delegate); 48 const base::Callback<void(net::X509Certificate*)>& callback);
43 virtual ~SSLClientCertificateSelector(); 49 virtual ~SSLClientCertificateSelector();
44 50
45 void Init(); 51 void Init();
46 52
47 net::X509Certificate* GetSelectedCert() const; 53 net::X509Certificate* GetSelectedCert() const;
48 54
49 // SSLClientAuthObserver implementation: 55 // SSLClientAuthObserver implementation:
50 virtual void OnCertSelectedByNotification() OVERRIDE; 56 virtual void OnCertSelectedByNotification() OVERRIDE;
51 57
52 // DialogDelegateView: 58 // DialogDelegateView:
(...skipping 12 matching lines...) Expand all
65 const views::Event& event) OVERRIDE; 71 const views::Event& event) OVERRIDE;
66 72
67 // views::TableViewObserver: 73 // views::TableViewObserver:
68 virtual void OnSelectionChanged() OVERRIDE; 74 virtual void OnSelectionChanged() OVERRIDE;
69 virtual void OnDoubleClick() OVERRIDE; 75 virtual void OnDoubleClick() OVERRIDE;
70 76
71 private: 77 private:
72 void CreateCertTable(); 78 void CreateCertTable();
73 void CreateViewCertButton(); 79 void CreateViewCertButton();
74 80
75 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_;
76
77 scoped_refptr<SSLClientAuthHandler> delegate_;
78
79 scoped_ptr<CertificateSelectorTableModel> model_; 81 scoped_ptr<CertificateSelectorTableModel> model_;
80 82
81 TabContentsWrapper* wrapper_; 83 TabContentsWrapper* wrapper_;
82 84
83 ConstrainedWindow* window_; 85 ConstrainedWindow* window_;
84 views::TableView* table_; 86 views::TableView* table_;
85 views::TextButton* view_cert_button_; 87 views::TextButton* view_cert_button_;
86 views::View* view_cert_button_container_; 88 views::View* view_cert_button_container_;
87 89
88 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelector); 90 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelector);
89 }; 91 };
90 92
91 #endif // CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 93 #endif // CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/ssl_client_certificate_selector.cc ('k') | chrome/browser/ui/views/ssl_client_certificate_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698