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

Side by Side Diff: chrome/browser/gtk/ssl_client_certificate_selector.cc

Issue 2823038: Refactor SSLClientAuthHandler and certificate selection (Closed)
Patch Set: Rebase the patch Created 10 years, 5 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_handler.h" 5 #include "chrome/browser/ssl_client_certificate_selector.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "app/l10n_util.h" 13 #include "app/l10n_util.h"
14 #include "base/i18n/time_formatting.h" 14 #include "base/i18n/time_formatting.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/nss_util.h" 16 #include "base/nss_util.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "chrome/browser/certificate_viewer.h" 18 #include "chrome/browser/certificate_viewer.h"
19 #include "chrome/browser/gtk/gtk_util.h" 19 #include "chrome/browser/gtk/gtk_util.h"
20 #include "chrome/browser/ssl/ssl_client_auth_handler.h"
20 #include "chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h" 21 #include "chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h"
21 #include "chrome/third_party/mozilla_security_manager/nsNSSCertificate.h" 22 #include "chrome/third_party/mozilla_security_manager/nsNSSCertificate.h"
22 #include "chrome/third_party/mozilla_security_manager/nsUsageArrayHelper.h" 23 #include "chrome/third_party/mozilla_security_manager/nsUsageArrayHelper.h"
23 #include "gfx/native_widget_types.h" 24 #include "gfx/native_widget_types.h"
24 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
25 #include "net/base/x509_certificate.h" 26 #include "net/base/x509_certificate.h"
26 27
27 // PSM = Mozilla's Personal Security Manager. 28 // PSM = Mozilla's Personal Security Manager.
28 namespace psm = mozilla_security_manager; 29 namespace psm = mozilla_security_manager;
29 30
(...skipping 22 matching lines...) Expand all
52 const char* nickname); 53 const char* nickname);
53 static std::string FormatDetailsText(CERTCertificate* cert); 54 static std::string FormatDetailsText(CERTCertificate* cert);
54 55
55 static void OnComboBoxChanged(GtkComboBox* combo_box, 56 static void OnComboBoxChanged(GtkComboBox* combo_box,
56 SSLClientCertificateSelector* cert_selector); 57 SSLClientCertificateSelector* cert_selector);
57 static void OnResponse(GtkDialog* dialog, gint response_id, 58 static void OnResponse(GtkDialog* dialog, gint response_id,
58 SSLClientCertificateSelector* cert_selector); 59 SSLClientCertificateSelector* cert_selector);
59 static void OnDestroy(GtkDialog* dialog, 60 static void OnDestroy(GtkDialog* dialog,
60 SSLClientCertificateSelector* cert_selector); 61 SSLClientCertificateSelector* cert_selector);
61 62
62 SSLClientAuthHandler* delegate_; 63 scoped_refptr<SSLClientAuthHandler> delegate_;
63 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; 64 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_;
64 65
65 std::vector<std::string> details_strings_; 66 std::vector<std::string> details_strings_;
66 67
67 GtkWidget* dialog_; 68 GtkWidget* dialog_;
68 GtkWidget* cert_combo_box_; 69 GtkWidget* cert_combo_box_;
69 GtkTextBuffer* cert_details_buffer_; 70 GtkTextBuffer* cert_details_buffer_;
70 }; 71 };
71 72
72 SSLClientCertificateSelector::SSLClientCertificateSelector( 73 SSLClientCertificateSelector::SSLClientCertificateSelector(
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 GtkDialog* dialog, 318 GtkDialog* dialog,
318 SSLClientCertificateSelector* cert_selector) { 319 SSLClientCertificateSelector* cert_selector) {
319 delete cert_selector; 320 delete cert_selector;
320 } 321 }
321 322
322 } // namespace 323 } // namespace
323 324
324 /////////////////////////////////////////////////////////////////////////////// 325 ///////////////////////////////////////////////////////////////////////////////
325 // SSLClientAuthHandler platform specific implementation: 326 // SSLClientAuthHandler platform specific implementation:
326 327
327 void SSLClientAuthHandler::DoSelectCertificate() { 328 namespace browser {
328 // TODO(mattm): Pipe parent gfx::NativeWindow param into here somehow. 329
329 (new SSLClientCertificateSelector(NULL, cert_request_info_, this))->Show(); 330 void ShowSSLClientCertificateSelector(
331 gfx::NativeWindow parent,
332 net::SSLCertRequestInfo* cert_request_info,
333 SSLClientAuthHandler* delegate) {
334 (new SSLClientCertificateSelector(parent,
335 cert_request_info,
336 delegate))->Show();
330 } 337 }
338
339 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/ssl_client_certificate_selector.mm ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698