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

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: Inline Mac check for top-level web-contents. 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
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..044a7192d42320f3311f39ec1ea3a9fb428d7c56 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 GetTopLevelWebContents() below to find top-level embedder if |contents|
davidben 2015/07/15 21:30:13 Nit: to find the top-level embedder
wjmaclean 2015/07/15 23:06:24 Done.
+ // happens to be a guest. It returns contents if it's not a guest.
davidben 2015/07/15 21:30:13 Nit: contents -> |contents|. Also this is confusin
wjmaclean 2015/07/15 23:06:24 Done.
// 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') | chrome/browser/ui/views/certificate_selector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698