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

Unified Diff: chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm

Issue 1234073002: Allow cert-popup for WebView guests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comments. Created 5 years, 5 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/views/certificate_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm
index 54ff89123d38624b0cf371dea480cbe7c67dc412..4f90adc06ad2bab4d01bea1700f40d1213a4a27c 100644
--- a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm
+++ b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm
@@ -14,6 +14,7 @@
#include "chrome/browser/ssl/ssl_client_auth_observer.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
#include "chrome/grit/generated_resources.h"
+#include "components/guest_view/browser/guest_view_base.h"
#include "components/web_modal/popup_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/client_certificate_delegate.h"
@@ -80,9 +81,13 @@ void ShowSSLClientCertificateSelector(
// Not all WebContentses can show modal dialogs.
//
+ // Use the top-level embedder if |contents| is a guest.
+ // GetTopLevelWebContents() will return |contents| otherwise.
// TODO(davidben): Move this hook to the WebContentsDelegate and only try to
// show a dialog in Browser's implementation. https://crbug.com/456255
- if (web_modal::PopupManager::FromWebContents(contents) == nullptr)
+ if (web_modal::PopupManager::FromWebContents(
+ guest_view::GuestViewBase::GetTopLevelWebContents(contents)) ==
+ nullptr)
return;
// The dialog manages its own lifetime.
« no previous file with comments | « no previous file | chrome/browser/ui/views/certificate_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698