| OLD | NEW |
| 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_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 "net/base/ssl_cert_request_info.h" | 13 #include "net/base/ssl_cert_request_info.h" |
| 14 #include "content/browser/ssl/ssl_client_auth_handler.h" | 14 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 15 #include "content/public/browser/web_ui_message_handler.h" |
| 15 | 16 |
| 16 class TabContentsWrapper; | 17 class TabContentsWrapper; |
| 17 | 18 |
| 18 class SSLClientCertificateSelectorWebUI : public HtmlDialogUIDelegate, | 19 class SSLClientCertificateSelectorWebUI : public HtmlDialogUIDelegate, |
| 19 WebUIMessageHandler { | 20 content::WebUIMessageHandler { |
| 20 public: | 21 public: |
| 21 // Static factory method. | 22 // Static factory method. |
| 22 static void ShowDialog( | 23 static void ShowDialog( |
| 23 TabContentsWrapper* wrapper, | 24 TabContentsWrapper* wrapper, |
| 24 net::SSLCertRequestInfo* cert_request_info, | 25 net::SSLCertRequestInfo* cert_request_info, |
| 25 SSLClientAuthHandler* delegate); | 26 SSLClientAuthHandler* delegate); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 SSLClientCertificateSelectorWebUI(TabContentsWrapper* wrapper, | 29 SSLClientCertificateSelectorWebUI(TabContentsWrapper* wrapper, |
| 29 net::SSLCertRequestInfo* cert_request_info, | 30 net::SSLCertRequestInfo* cert_request_info, |
| 30 SSLClientAuthHandler* delegate); | 31 SSLClientAuthHandler* delegate); |
| 31 virtual ~SSLClientCertificateSelectorWebUI(); | 32 virtual ~SSLClientCertificateSelectorWebUI(); |
| 32 | 33 |
| 33 // Shows the dialog | 34 // Shows the dialog |
| 34 void ShowDialog(); | 35 void ShowDialog(); |
| 35 | 36 |
| 36 // HtmlDialogUIDelegate methods | 37 // HtmlDialogUIDelegate methods |
| 37 virtual bool IsDialogModal() const OVERRIDE; | 38 virtual bool IsDialogModal() const OVERRIDE; |
| 38 virtual string16 GetDialogTitle() const OVERRIDE; | 39 virtual string16 GetDialogTitle() const OVERRIDE; |
| 39 virtual GURL GetDialogContentURL() const OVERRIDE; | 40 virtual GURL GetDialogContentURL() const OVERRIDE; |
| 40 virtual void GetWebUIMessageHandlers( | 41 virtual void GetWebUIMessageHandlers( |
| 41 std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE; | 42 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
| 42 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 43 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
| 43 virtual std::string GetDialogArgs() const OVERRIDE; | 44 virtual std::string GetDialogArgs() const OVERRIDE; |
| 44 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 45 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
| 45 virtual void OnCloseContents(content::WebContents* source, | 46 virtual void OnCloseContents(content::WebContents* source, |
| 46 bool* out_close_dialog) OVERRIDE; | 47 bool* out_close_dialog) OVERRIDE; |
| 47 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 48 virtual bool ShouldShowDialogTitle() const OVERRIDE; |
| 48 | 49 |
| 49 // WebUIMessageHandler | 50 // WebUIMessageHandler |
| 50 virtual void RegisterMessages() OVERRIDE; | 51 virtual void RegisterMessages() OVERRIDE; |
| 51 | 52 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 net::X509Certificate* selected_cert); | 64 net::X509Certificate* selected_cert); |
| 64 | 65 |
| 65 TabContentsWrapper* wrapper_; | 66 TabContentsWrapper* wrapper_; |
| 66 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 67 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
| 67 scoped_refptr<SSLClientAuthHandler> delegate_; | 68 scoped_refptr<SSLClientAuthHandler> delegate_; |
| 68 | 69 |
| 69 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelectorWebUI); | 70 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelectorWebUI); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 #endif // CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_ | 73 #endif // CHROME_BROWSER_UI_WEBUI_SSL_CLIENT_CERTIFICATE_SELECTOR_WEBUI_H_ |
| OLD | NEW |