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

Unified Diff: chrome/browser/ui/webui/certificate_viewer.cc

Issue 7957002: Reland add --use-more-webui runtime flag to toggle WebUI replacements for native dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. Created 9 years, 3 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 | « chrome/browser/ui/webui/certificate_viewer.h ('k') | chrome/browser/ui/webui/chrome_web_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/certificate_viewer.cc
diff --git a/chrome/browser/ui/webui/certificate_viewer.cc b/chrome/browser/ui/webui/certificate_viewer.cc
index e7a0f7cabb6229d655c46179b881053cc161f88a..f28b21f21f461775809e388d028eac82be9b9f4c 100644
--- a/chrome/browser/ui/webui/certificate_viewer.cc
+++ b/chrome/browser/ui/webui/certificate_viewer.cc
@@ -5,13 +5,15 @@
#include "base/i18n/time_formatting.h"
#include "base/utf_string_conversions.h"
#include "base/string_number_conversions.h"
-#include "chrome/browser/ui/webui/certificate_viewer.h"
-#include "chrome/common/url_constants.h"
+#include "chrome/browser/certificate_viewer.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/gtk/certificate_dialogs.h"
-#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/webui/certificate_viewer.h"
+#include "chrome/browser/ui/webui/chrome_web_ui.h"
#include "chrome/common/net/x509_certificate_model.h"
+#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "grit/generated_resources.h"
@@ -24,10 +26,14 @@ const int kDefaultHeight = 450;
} // namespace
-// Shows a certificate using the WebUI certificate viewer.
+// Shows a certificate using the native or WebUI certificate viewer.
void ShowCertificateViewer(gfx::NativeWindow parent,
net::X509Certificate* cert) {
- CertificateViewerDialog::ShowDialog(parent, cert);
+ if (ChromeWebUI::IsMoreWebUI()) {
+ CertificateViewerDialog::ShowDialog(parent, cert);
+ } else {
+ ShowNativeCertificateViewer(parent, cert);
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -52,6 +58,9 @@ CertificateViewerDialog::CertificateViewerDialog(gfx::NativeWindow parent,
UTF8ToUTF16(x509_certificate_model::GetTitle(cert_chain.front())));
}
+CertificateViewerDialog::~CertificateViewerDialog() {
+}
+
bool CertificateViewerDialog::IsDialogModal() const {
return true;
}
@@ -106,6 +115,9 @@ CertificateViewerDialogHandler::CertificateViewerDialogHandler(
&cert_chain_);
}
+CertificateViewerDialogHandler::~CertificateViewerDialogHandler() {
+}
+
void CertificateViewerDialogHandler::RegisterMessages() {
web_ui_->RegisterMessageCallback("exportCertificate",
NewCallback(this,
« no previous file with comments | « chrome/browser/ui/webui/certificate_viewer.h ('k') | chrome/browser/ui/webui/chrome_web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698