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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1150843002: Dismiss browser plugin modal dialogs when the embedder needs to. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move test file Created 5 years, 7 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 | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 43d74a22a2d2cfecd0401377b47c8d696772446e..8484d06c44dea57b34122ce30e3fa55d7b4df4d5 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -671,6 +671,13 @@ int WebContentsImpl::GetRoutingID() const {
return GetRenderViewHost()->GetRoutingID();
}
+void WebContentsImpl::CancelActiveAndPendingDialogs() {
+ if (dialog_manager_)
+ dialog_manager_->CancelActiveAndPendingDialogs(this);
+ if (browser_plugin_embedder_)
+ browser_plugin_embedder_->CancelGuestDialogs();
+}
+
int WebContentsImpl::GetFullscreenWidgetRoutingID() const {
return fullscreen_widget_routing_id_;
}
@@ -1984,8 +1991,7 @@ void WebContentsImpl::AttachInterstitialPage(
// Cancel any visible dialogs so that they don't interfere with the
// interstitial.
- if (dialog_manager_)
- dialog_manager_->CancelActiveAndPendingDialogs(this);
+ CancelActiveAndPendingDialogs();
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidAttachInterstitialPage());
@@ -2741,8 +2747,8 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit(
has_accessed_initial_document_ = false;
// If we navigate off the page, close all JavaScript dialogs.
- if (dialog_manager_ && !details.is_in_page)
- dialog_manager_->CancelActiveAndPendingDialogs(this);
+ if (!details.is_in_page)
+ CancelActiveAndPendingDialogs();
// Notify observers about navigation.
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
@@ -3593,8 +3599,7 @@ void WebContentsImpl::RenderViewTerminated(RenderViewHost* rvh,
ExitFullscreenMode();
// Cancel any visible dialogs so they are not left dangling over the sad tab.
- if (dialog_manager_)
- dialog_manager_->CancelActiveAndPendingDialogs(this);
+ CancelActiveAndPendingDialogs();
if (delegate_)
delegate_->HideValidationMessage(this);
@@ -4043,6 +4048,10 @@ void WebContentsImpl::CancelModalDialogsForRenderManager() {
// deferrer would prevent us from swapping out. We also clear the state
// because this is a cross-process navigation, which means that it's a new
// site that should not have to pay for the sins of its predecessor.
+ //
+ // Note that we don't bother telling browser_plugin_embedder_ because the
+ // cross-process navigation will either destroy the browser plugins or not
+ // require their dialogs to close.
if (dialog_manager_)
dialog_manager_->ResetDialogState(this);
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698