Chromium Code Reviews| 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_); |