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

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: 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/views/certificate_selector.cc
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc
index d2d5afb7efdd76ad6fb720c4fa4def035e56206c..cbfa8474fbdb35f85a3bef111b8c7f1f2218106a 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,16 @@ CertificateSelector::~CertificateSelector() {
table_->SetModel(nullptr);
}
+// Static.
davidben 2015/07/15 21:30:14 I think we usually just do: // static No caps or
wjmaclean 2015/07/15 23:06:24 Done.
+bool CertificateSelector::CanShow(content::WebContents* web_contents) {
+ // Note: in the following call, if web_contents is not a guest, then it is
+ // just used as the return value.
davidben 2015/07/15 21:30:14 Nit: This is a bit wordy. I would maybe phrase it
+ 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_);

Powered by Google App Engine
This is Rietveld 408576698