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

Unified Diff: chrome/browser/ui/webui/certificate_viewer_webui.h

Issue 10332231: Remove chrome::NOTIFICATION_WEB_DIALOG_SHOWN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add web_dialog_observer.h to chrome_browser.gypi Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/certificate_viewer_webui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/certificate_viewer_webui.h
diff --git a/chrome/browser/ui/webui/certificate_viewer_webui.h b/chrome/browser/ui/webui/certificate_viewer_webui.h
index 6bf94fe9a7e351134f8db353bfea856460f1ca5f..e345a507f563abc52a0a66e3b317f801607fd46f 100644
--- a/chrome/browser/ui/webui/certificate_viewer_webui.h
+++ b/chrome/browser/ui/webui/certificate_viewer_webui.h
@@ -10,12 +10,15 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/observer_list.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/web_dialog_delegate.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "net/base/x509_certificate.h"
#include "ui/gfx/native_widget_types.h"
+class WebDialogObserver;
+
// Displays the native or WebUI certificate viewer dialog for the given
// certificate.
void ShowCertificateViewer(gfx::NativeWindow parent,
@@ -27,20 +30,22 @@ void ShowCertificateViewer(gfx::NativeWindow parent,
// or "View" from the Certificate Manager.
class CertificateViewerDialog : private WebDialogDelegate {
public:
- // Shows the certificate viewer dialog for the passed in certificate.
- static void ShowDialog(gfx::NativeWindow parent,
- net::X509Certificate* cert);
- virtual ~CertificateViewerDialog();
-
- private:
// Construct a certificate viewer for the passed in certificate. A reference
// to the certificate pointer is added for the lifetime of the certificate
// viewer.
explicit CertificateViewerDialog(net::X509Certificate* cert);
+ virtual ~CertificateViewerDialog();
// Show the dialog using the given parent window.
void Show(gfx::NativeWindow parent);
+ // Add WebDialogObserver for this dialog.
+ void AddObserver(WebDialogObserver* observer);
+
+ // Remove WebDialogObserver for this dialog.
+ void RemoveObserver(WebDialogObserver* observer);
+
+ private:
// Overridden from WebDialogDelegate:
virtual ui::ModalType GetDialogModalType() const OVERRIDE;
virtual string16 GetDialogTitle() const OVERRIDE;
@@ -49,6 +54,9 @@ class CertificateViewerDialog : private WebDialogDelegate {
std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
virtual std::string GetDialogArgs() const OVERRIDE;
+ virtual void OnDialogShown(
+ content::WebUI* webui,
+ content::RenderViewHost* render_view_host) OVERRIDE;
virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
virtual void OnCloseContents(
content::WebContents* source, bool* out_close_dialog) OVERRIDE;
@@ -63,6 +71,8 @@ class CertificateViewerDialog : private WebDialogDelegate {
// The title of the certificate viewer dialog, Certificate Viewer: CN.
string16 title_;
+ ObserverList<WebDialogObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialog);
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/certificate_viewer_webui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698