summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 17:19:19 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 17:19:19 +0000
commite2ede971c1aeec2a2e508d37dac6bebfec889b1f (patch)
treea9e770a67f8cd864f6b369093438adab98ecbb5a
parentabe94db24a17e066049e6316a48f690061acf6c5 (diff)
downloadchromium_src-e2ede971c1aeec2a2e508d37dac6bebfec889b1f.zip
chromium_src-e2ede971c1aeec2a2e508d37dac6bebfec889b1f.tar.gz
chromium_src-e2ede971c1aeec2a2e508d37dac6bebfec889b1f.tar.bz2
fix native certificate view on win aura desktop
(previously silently did nothing) R=ben@chromium.org BUG=175259 Review URL: https://codereview.chromium.org/12432024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188429 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/certificate_viewer_win.cc36
-rw-r--r--chrome/browser/ui/views/stubs_aura.cc8
-rw-r--r--chrome/chrome_browser_ui.gypi1
3 files changed, 33 insertions, 12 deletions
diff --git a/chrome/browser/ui/views/certificate_viewer_win.cc b/chrome/browser/ui/views/certificate_viewer_win.cc
index 16de479..f1097df 100644
--- a/chrome/browser/ui/views/certificate_viewer_win.cc
+++ b/chrome/browser/ui/views/certificate_viewer_win.cc
@@ -11,9 +11,17 @@
#include "base/logging.h"
#include "net/base/x509_certificate.h"
-void ShowCertificateViewer(content::WebContents* web_contents,
- gfx::NativeWindow parent,
- net::X509Certificate* cert) {
+#if defined(USE_AURA)
+#include "chrome/browser/ui/host_desktop.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#endif
+
+namespace {
+
+void ShowCertificateViewerImpl(content::WebContents* web_contents,
+ HWND parent,
+ net::X509Certificate* cert) {
// Create a new cert context and store containing just the certificate
// and its intermediate certificates.
PCCERT_CONTEXT cert_list = cert->CreateOSCertChainForCert();
@@ -38,3 +46,25 @@ void ShowCertificateViewer(content::WebContents* web_contents,
CertFreeCertificateContext(cert_list);
}
+
+} // namespace
+
+#if defined(USE_AURA)
+void ShowCertificateViewer(content::WebContents* web_contents,
+ gfx::NativeWindow parent,
+ net::X509Certificate* cert) {
+ if (chrome::GetHostDesktopTypeForNativeWindow(parent) !=
+ chrome::HOST_DESKTOP_TYPE_ASH) {
+ ShowCertificateViewerImpl(
+ web_contents, parent->GetRootWindow()->GetAcceleratedWidget(), cert);
+ } else {
+ NOTIMPLEMENTED();
+ }
+}
+#else
+void ShowCertificateViewer(content::WebContents* web_contents,
+ gfx::NativeWindow parent,
+ net::X509Certificate* cert) {
+ ShowCertificateViewerImpl(web_contents, parent, cert);
+}
+#endif
diff --git a/chrome/browser/ui/views/stubs_aura.cc b/chrome/browser/ui/views/stubs_aura.cc
index bd4e878..5abe4b8 100644
--- a/chrome/browser/ui/views/stubs_aura.cc
+++ b/chrome/browser/ui/views/stubs_aura.cc
@@ -45,14 +45,6 @@ void ShowAboutIPCDialog() {
} // namespace chrome
-#if defined(OS_WIN)
-void ShowCertificateViewer(content::WebContents* web_contents,
- gfx::NativeWindow parent,
- net::X509Certificate* cert) {
- // No certificate viewer on Windows.
-}
-#endif // OS_WIN
-
namespace importer {
void ShowImportProgressDialog(uint16 items,
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index a26e572..77cda3b 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -2436,7 +2436,6 @@
['exclude', '^browser/ui/panels/taskbar_window_thumbnailer_win.h'],
['exclude', '^browser/ui/views/about_ipc_dialog.cc'],
['exclude', '^browser/ui/views/app_menu_button_win.cc'],
- ['exclude', '^browser/ui/views/certificate_viewer_win.cc'],
['exclude', '^browser/ui/views/dropdown_bar_host_win.cc'],
['exclude', '^browser/ui/views/external_protocol_dialog.cc'],
['exclude', '^browser/ui/views/find_bar_host_win.cc'],