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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2103733002: Handle WebContents going away in content settings bubbles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 525410cd7ac64bbe61a81541991868d353fb70cb..1ac88d4f98ea1e825c7f92483c0147fe9cd4f95f 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -976,7 +976,9 @@ ContentSettingMixedScriptBubbleModel::ContentSettingMixedScriptBubbleModel(
}
void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() {
- DCHECK(web_contents());
+ if (!web_contents())
+ return;
+
web_contents()->SendToAllFrames(
new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true));
web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
@@ -1079,6 +1081,9 @@ void ContentSettingRPHBubbleModel::OnRadioClicked(int radio_index) {
}
void ContentSettingRPHBubbleModel::OnDoneClicked() {
+ if (!web_contents())
+ return;
+
// The user has one chance to deal with the RPH content setting UI,
// then we remove it.
TabSpecificContentSettings::FromWebContents(web_contents())->
@@ -1090,6 +1095,9 @@ void ContentSettingRPHBubbleModel::OnDoneClicked() {
}
void ContentSettingRPHBubbleModel::RegisterProtocolHandler() {
+ if (!web_contents())
+ return;
+
// A no-op if the handler hasn't been ignored, but needed in case the user
// selects sequences like register/ignore/register.
registry_->RemoveIgnoredHandler(pending_handler_);
@@ -1100,6 +1108,9 @@ void ContentSettingRPHBubbleModel::RegisterProtocolHandler() {
}
void ContentSettingRPHBubbleModel::UnregisterProtocolHandler() {
+ if (!web_contents())
+ return;
+
registry_->OnDenyRegisterProtocolHandler(pending_handler_);
TabSpecificContentSettings::FromWebContents(web_contents())->
set_pending_protocol_handler_setting(CONTENT_SETTING_BLOCK);
@@ -1107,6 +1118,9 @@ void ContentSettingRPHBubbleModel::UnregisterProtocolHandler() {
}
void ContentSettingRPHBubbleModel::IgnoreProtocolHandler() {
+ if (!web_contents())
+ return;
+
registry_->OnIgnoreRegisterProtocolHandler(pending_handler_);
TabSpecificContentSettings::FromWebContents(web_contents())->
set_pending_protocol_handler_setting(CONTENT_SETTING_DEFAULT);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698