OLD | NEW |
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_CERTIFICATE_VIEWER_WEBUI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 14 #include "chrome/browser/ui/webui/web_dialog_ui.h" |
15 #include "content/public/browser/web_ui_message_handler.h" | 15 #include "content/public/browser/web_ui_message_handler.h" |
16 #include "net/base/x509_certificate.h" | 16 #include "net/base/x509_certificate.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 | 18 |
19 // Displays the native or WebUI certificate viewer dialog for the given | 19 // Displays the native or WebUI certificate viewer dialog for the given |
20 // certificate. | 20 // certificate. |
21 void ShowCertificateViewer(gfx::NativeWindow parent, | 21 void ShowCertificateViewer(gfx::NativeWindow parent, |
22 net::X509Certificate*); | 22 net::X509Certificate*); |
23 | 23 |
24 // Dialog for displaying detailed certificate information. This is used in linux | 24 // Dialog for displaying detailed certificate information. This is used in linux |
25 // and chromeos builds to display detailed information in a floating dialog when | 25 // and chromeos builds to display detailed information in a floating dialog when |
26 // the user clicks on "Certificate Information" from the lock icon of a web site | 26 // the user clicks on "Certificate Information" from the lock icon of a web site |
27 // or "View" from the Certificate Manager. | 27 // or "View" from the Certificate Manager. |
28 class CertificateViewerDialog : private HtmlDialogUIDelegate { | 28 class CertificateViewerDialog : private WebDialogDelegate { |
29 public: | 29 public: |
30 // Shows the certificate viewer dialog for the passed in certificate. | 30 // Shows the certificate viewer dialog for the passed in certificate. |
31 static void ShowDialog(gfx::NativeWindow parent, | 31 static void ShowDialog(gfx::NativeWindow parent, |
32 net::X509Certificate* cert); | 32 net::X509Certificate* cert); |
33 virtual ~CertificateViewerDialog(); | 33 virtual ~CertificateViewerDialog(); |
34 | 34 |
35 private: | 35 private: |
36 // Construct a certificate viewer for the passed in certificate. A reference | 36 // Construct a certificate viewer for the passed in certificate. A reference |
37 // to the certificate pointer is added for the lifetime of the certificate | 37 // to the certificate pointer is added for the lifetime of the certificate |
38 // viewer. | 38 // viewer. |
39 explicit CertificateViewerDialog(net::X509Certificate* cert); | 39 explicit CertificateViewerDialog(net::X509Certificate* cert); |
40 | 40 |
41 // Show the dialog using the given parent window. | 41 // Show the dialog using the given parent window. |
42 void Show(gfx::NativeWindow parent); | 42 void Show(gfx::NativeWindow parent); |
43 | 43 |
44 // Overridden from HtmlDialogUI::Delegate: | 44 // Overridden from WebDialogDelegate: |
45 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | 45 virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
46 virtual string16 GetDialogTitle() const OVERRIDE; | 46 virtual string16 GetDialogTitle() const OVERRIDE; |
47 virtual GURL GetDialogContentURL() const OVERRIDE; | 47 virtual GURL GetDialogContentURL() const OVERRIDE; |
48 virtual void GetWebUIMessageHandlers( | 48 virtual void GetWebUIMessageHandlers( |
49 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 49 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
50 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 50 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
51 virtual std::string GetDialogArgs() const OVERRIDE; | 51 virtual std::string GetDialogArgs() const OVERRIDE; |
52 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 52 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
53 virtual void OnCloseContents( | 53 virtual void OnCloseContents( |
54 content::WebContents* source, bool* out_close_dialog) OVERRIDE; | 54 content::WebContents* source, bool* out_close_dialog) OVERRIDE; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // The dialog window. | 101 // The dialog window. |
102 gfx::NativeWindow window_; | 102 gfx::NativeWindow window_; |
103 | 103 |
104 // The certificate chain. | 104 // The certificate chain. |
105 net::X509Certificate::OSCertHandles cert_chain_; | 105 net::X509Certificate::OSCertHandles cert_chain_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialogHandler); | 107 DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialogHandler); |
108 }; | 108 }; |
109 | 109 |
110 #endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ | 110 #endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ |
OLD | NEW |