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

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

Issue 2384813002: Don't wait to close tabs waiting for JavaScript dialogs. (Closed)
Patch Set: now a bit on webcontents, no timer fiddling Created 4 years, 2 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: 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 7cb552bb0560ff31b2017a15d23a51fa9ea36289..e9f93fc948ff68f1ff9ba6bc7e7d5fae44539e5f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4138,6 +4138,7 @@ void WebContentsImpl::RunJavaScriptMessage(
!delegate_->GetJavaScriptDialogManager(this);
if (!suppress_this_message) {
+ is_showing_javascript_dialog_ = true;
dialog_manager_ = delegate_->GetJavaScriptDialogManager(this);
dialog_manager_->RunJavaScriptDialog(
this, frame_url, javascript_message_type, message, default_prompt,
@@ -4188,6 +4189,10 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
false));
}
+bool WebContentsImpl::IsJavaScriptDialogShowing() const {
+ return is_showing_javascript_dialog_;
+}
+
void WebContentsImpl::RunFileChooser(RenderFrameHost* render_frame_host,
const FileChooserParams& params) {
if (delegate_)
@@ -5063,6 +5068,7 @@ void WebContentsImpl::OnDialogClosed(int render_process_id,
BeforeUnloadDialogCancelled());
}
+ is_showing_javascript_dialog_ = false;
is_showing_before_unload_dialog_ = false;
if (rfh) {
rfh->JavaScriptDialogClosed(reply_msg, success, user_input,

Powered by Google App Engine
This is Rietveld 408576698