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

Unified Diff: chrome/browser/ssl/ssl_client_auth_handler.h

Issue 147233: Basic implentation of the client auth UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ssl/ssl_client_auth_handler.h
===================================================================
--- chrome/browser/ssl/ssl_client_auth_handler.h (revision 0)
+++ chrome/browser/ssl/ssl_client_auth_handler.h (revision 0)
@@ -0,0 +1,60 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H
+#define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H
+
+#include "base/basictypes.h"
+#include "base/ref_counted.h"
+#include "net/base/ssl_cert_request_info.h"
+
+namespace net {
+class X509Certificate;
+}
+class MessageLoop;
+class URLRequest;
+
+// This class handles the approval and selection of a certificate for SSL client
+// authentication by the user.
+// It is self-owned and deletes itself when the UI reports the user selection or
+// when the URLRequest is cancelled.
+class SSLClientAuthHandler : public base::RefCounted<SSLClientAuthHandler> {
+ public:
+ SSLClientAuthHandler(URLRequest* request,
+ net::SSLCertRequestInfo* cert_request_info,
+ MessageLoop* io_loop,
+ MessageLoop* ui_loop);
+ ~SSLClientAuthHandler();
+
+ // Asks the user for a certificate and resumes the URL request with that
wtc 2009/06/26 23:03:52 Nit: "for" => "to select" because we already found
+ // certificate.
+ // Should only be called on the IO thread.
+ void SelectCertificate();
+
+ // Invoked when the request associated with this handler is cancelled.
+ // Should only be called on the IO thread.
+ void OnRequestCancelled();
+
+ private:
+ // Prompts the user for a cert.
+ // Called on the UI thread.
+ void AskUserForCertificate();
wtc 2009/06/26 23:03:52 You can just name this DoSelectCertificate -- we s
+
+ // Notifies that the user has selected a cert.
+ // Called on the IO thread.
+ void CertificateSelected(net::X509Certificate* cert);
+
+ // The URLRequest that triggered this client auth.
+ URLRequest* request_;
+
+ // The certs to choose from.
+ scoped_refptr<net::SSLCertRequestInfo> cert_request_info_;
+
+ MessageLoop* io_loop_;
+ MessageLoop* ui_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler);
+};
+
+#endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H
Property changes on: chrome\browser\ssl\ssl_client_auth_handler.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | chrome/browser/ssl/ssl_client_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698