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

Side by Side Diff: chrome/browser/ui/webui/ssl_client_certificate_selector_webui.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) 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 #ifndef CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_
6 #define CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 #include <string> 10 #include <string>
11 11
12 #include "chrome/browser/ui/webui/html_dialog_ui.h" 12 #include "chrome/browser/ui/webui/html_dialog_ui.h"
13 #include "chrome/browser/ssl/ssl_client_auth_observer.h"
14 #include "content/public/browser/web_ui_message_handler.h"
13 #include "net/base/ssl_cert_request_info.h" 15 #include "net/base/ssl_cert_request_info.h"
14 #include "content/browser/ssl/ssl_client_auth_handler.h"
15 #include "content/public/browser/web_ui_message_handler.h"
16 16
17 class TabContentsWrapper; 17 class TabContentsWrapper;
18 18
19 class SSLClientCertificateSelectorWebUI : public HtmlDialogUIDelegate, 19 class SSLClientCertificateSelectorWebUI : public SSLClientAuthObserver,
20 public HtmlDialogUIDelegate,
20 content::WebUIMessageHandler { 21 content::WebUIMessageHandler {
21 public: 22 public:
22 // Static factory method. 23 // Static factory method.
23 static void ShowDialog( 24 static void ShowDialog(
24 TabContentsWrapper* wrapper, 25 TabContentsWrapper* wrapper,
26 const net::HttpNetworkSession* network_session,
25 net::SSLCertRequestInfo* cert_request_info, 27 net::SSLCertRequestInfo* cert_request_info,
26 SSLClientAuthHandler* delegate); 28 const base::Callback<void(net::X509Certificate*)>& callback);
27 29
28 private: 30 private:
29 SSLClientCertificateSelectorWebUI(TabContentsWrapper* wrapper, 31 SSLClientCertificateSelectorWebUI(
30 net::SSLCertRequestInfo* cert_request_info, 32 TabContentsWrapper* wrapper,
31 SSLClientAuthHandler* delegate); 33 const net::HttpNetworkSession* network_session,
34 net::SSLCertRequestInfo* cert_request_info,
35 const base::Callback<void(net::X509Certificate*)>& callback);
32 virtual ~SSLClientCertificateSelectorWebUI(); 36 virtual ~SSLClientCertificateSelectorWebUI();
33 37
34 // Shows the dialog 38 // SSLClientAuthObserver methods
35 void ShowDialog(); 39 virtual void OnCertSelectedByNotification() OVERRIDE;
36 40
37 // HtmlDialogUIDelegate methods 41 // HtmlDialogUIDelegate methods
38 virtual ui::ModalType GetDialogModalType() const OVERRIDE; 42 virtual ui::ModalType GetDialogModalType() const OVERRIDE;
39 virtual string16 GetDialogTitle() const OVERRIDE; 43 virtual string16 GetDialogTitle() const OVERRIDE;
40 virtual GURL GetDialogContentURL() const OVERRIDE; 44 virtual GURL GetDialogContentURL() const OVERRIDE;
41 virtual void GetWebUIMessageHandlers( 45 virtual void GetWebUIMessageHandlers(
42 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; 46 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
43 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; 47 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
44 virtual std::string GetDialogArgs() const OVERRIDE; 48 virtual std::string GetDialogArgs() const OVERRIDE;
45 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; 49 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
46 virtual void OnCloseContents(content::WebContents* source, 50 virtual void OnCloseContents(content::WebContents* source,
47 bool* out_close_dialog) OVERRIDE; 51 bool* out_close_dialog) OVERRIDE;
48 virtual bool ShouldShowDialogTitle() const OVERRIDE; 52 virtual bool ShouldShowDialogTitle() const OVERRIDE;
49 53
50 // WebUIMessageHandler 54 // WebUIMessageHandler
51 virtual void RegisterMessages() OVERRIDE; 55 virtual void RegisterMessages() OVERRIDE;
52 56
53 // Closes the dialog from javascript. 57 // Closes the dialog from javascript.
54 void CloseDialog(); 58 void CloseDialog();
55 59
56 // Called by JavaScript to get details for dialog. 60 // Called by JavaScript to get details for dialog.
57 void RequestDetails(const base::ListValue* args); 61 void RequestDetails(const base::ListValue* args);
58 62
59 // Called by JavaScript to show a certificate. 63 // Called by JavaScript to show a certificate.
60 void ViewCertificate(const base::ListValue* args); 64 void ViewCertificate(const base::ListValue* args);
61 65
62 // Callback for unlocking of the certificate when processing OK button.
63 static void Unlocked(SSLClientAuthHandler* delegate,
64 net::X509Certificate* selected_cert);
65
66 TabContentsWrapper* wrapper_; 66 TabContentsWrapper* wrapper_;
67 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_;
68 scoped_refptr<SSLClientAuthHandler> delegate_;
69 67
70 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelectorWebUI); 68 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelectorWebUI);
71 }; 69 };
72 70
73 #endif // CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_ 71 #endif // CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/stubs_aura.cc ('k') | chrome/browser/ui/webui/ssl_client_certificate_selector_webui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698