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

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 1317443002: Fix UAF in Origin Info Bubble and permission settings UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another Andorid call site. Checked all call sites. Created 5 years, 4 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/website_settings/website_settings_popup_view.cc
diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
index 3e88743b8180dee9f261bc65505515b0344f9c04..f225daaa762436c26552491b930fb1a4092a11a1 100644
--- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
+++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
@@ -314,7 +314,8 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView(
content::WebContents* web_contents,
const GURL& url,
const content::SSLStatus& ssl)
- : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT),
+ : content::WebContentsObserver(web_contents),
+ BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT),
web_contents_(web_contents),
header_(nullptr),
tabbed_pane_(nullptr),
@@ -380,10 +381,15 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView(
views::BubbleDelegateView::CreateBubble(this);
presenter_.reset(new WebsiteSettings(
- this, profile,
- TabSpecificContentSettings::FromWebContents(web_contents),
- InfoBarService::FromWebContents(web_contents), url, ssl,
- content::CertStore::GetInstance()));
+ this, profile, TabSpecificContentSettings::FromWebContents(web_contents),
+ web_contents, url, ssl, content::CertStore::GetInstance()));
+}
+
+void WebsiteSettingsPopupView::RenderFrameDeleted(
+ content::RenderFrameHost* render_frame_host) {
+ if (render_frame_host == web_contents_->GetMainFrame()) {
+ GetWidget()->Close();
+ }
}
void WebsiteSettingsPopupView::OnPermissionChanged(

Powered by Google App Engine
This is Rietveld 408576698