diff options
| author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 19:34:49 +0000 |
|---|---|---|
| committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 19:34:49 +0000 |
| commit | 1f18184a07252103a8cd9652d64de749f41ef09f (patch) | |
| tree | 7e0c5eb9dea2890d8231eb7ad69dec318ac6e610 /chrome/browser/ssl/ssl_client_auth_handler.h | |
| parent | 348b9bc12d4e2ccd03a7fbcb327a3975207a5fec (diff) | |
| download | chromium_src-1f18184a07252103a8cd9652d64de749f41ef09f.zip chromium_src-1f18184a07252103a8cd9652d64de749f41ef09f.tar.gz chromium_src-1f18184a07252103a8cd9652d64de749f41ef09f.tar.bz2 | |
Refactor SSLClientAuthHandler and certificate selection
This cleans up much of the code involved in displaying a certificate selection
dialog to the user.
- Adds a new inner class to RenderViewHostDelegate (later to be populated
with more SSL things).
- Adds a helper class for TabContents' implementation.
- Moves the certificate dialogs themselves to have a common entry point.
- Makes SSLClientAuthHandler call the RVHDelegate to query the user, with the
TabContents implementation displaying the dialogs.
- Picks the correct parent window for the dialog on all platforms, instead of
relying on BrowserList::GetLastActive
- Makes the OS X implementation use an asynchronous sheet, now that we know the
parent.
- Fixes an index-mismatch problem in the OS X implementation, should we fail to create an identity.
R=agl,brettw,mark
BUG=148
TEST=selecting client certificates still works
Review URL: http://codereview.chromium.org/2823038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_client_auth_handler.h')
| -rw-r--r-- | chrome/browser/ssl/ssl_client_auth_handler.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/ssl/ssl_client_auth_handler.h b/chrome/browser/ssl/ssl_client_auth_handler.h index f63d4c9..05148d5 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.h +++ b/chrome/browser/ssl/ssl_client_auth_handler.h @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "base/ref_counted.h" +#include "chrome/browser/chrome_thread.h" #include "net/base/ssl_cert_request_info.h" namespace net { @@ -19,7 +20,8 @@ class URLRequest; // It is self-owned and deletes itself when the UI reports the user selection or // when the URLRequest is cancelled. class SSLClientAuthHandler - : public base::RefCountedThreadSafe<SSLClientAuthHandler> { + : public base::RefCountedThreadSafe<SSLClientAuthHandler, + ChromeThread::DeleteOnIOThread> { public: SSLClientAuthHandler(URLRequest* request, net::SSLCertRequestInfo* cert_request_info); @@ -38,15 +40,15 @@ class SSLClientAuthHandler // be long after DoSelectCertificate returns, if the UI is modeless/async.) void CertificateSelected(net::X509Certificate* cert); + // Returns the SSLCertRequestInfo for this handler. + net::SSLCertRequestInfo* cert_request_info() { return cert_request_info_; } + private: - friend class base::RefCountedThreadSafe<SSLClientAuthHandler>; + friend class ChromeThread; + friend class DeleteTask<SSLClientAuthHandler>; ~SSLClientAuthHandler(); - // Asks the user for a cert. - // Called on the UI thread. - void DoSelectCertificate(); - // Notifies that the user has selected a cert. // Called on the IO thread. void DoCertificateSelected(net::X509Certificate* cert); |
