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

Unified Diff: chrome/browser/ui/views/certificate_selector.cc

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
Index: chrome/browser/ui/views/certificate_selector.cc
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc
index d2d5afb7efdd76ad6fb720c4fa4def035e56206c..1e353735c37072040e2ba579bf9d786ad1b99041 100644
--- a/chrome/browser/ui/views/certificate_selector.cc
+++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -13,6 +13,8 @@
#include "chrome/browser/certificate_viewer.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
+#include "components/guest_view/browser/guest_view_base.h"
+#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/table_model.h"
@@ -87,6 +89,15 @@ CertificateSelector::~CertificateSelector() {
table_->SetModel(nullptr);
}
+// static
+bool CertificateSelector::CanShow(content::WebContents* web_contents) {
+ // GetTopLevelWebContents returns |web_contents| if it is not a guest.
+ content::WebContents* top_level_web_contents =
+ guest_view::GuestViewBase::GetTopLevelWebContents(web_contents);
+ return web_modal::WebContentsModalDialogManager::FromWebContents(
+ top_level_web_contents) != nullptr;
+}
+
void CertificateSelector::Show() {
constrained_window::ShowWebModalDialogViews(this, web_contents_);
« no previous file with comments | « chrome/browser/ui/views/certificate_selector.h ('k') | chrome/browser/ui/views/ssl_client_certificate_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698