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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 155133: Windowed plugins like Flash would cause the hung plugin dialog to show up whe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/renderer_host/render_view_host.cc
===================================================================
--- chrome/browser/renderer_host/render_view_host.cc (revision 20235)
+++ chrome/browser/renderer_host/render_view_host.cc (working copy)
@@ -559,8 +559,7 @@
}
void RenderViewHost::JavaScriptMessageBoxWindowDestroyed() {
- if (--modal_dialog_count_ == 0)
- modal_dialog_event_->Reset();
+ ResetModalDialogEvent();
}
void RenderViewHost::ModalHTMLDialogClosed(IPC::Message* reply_msg,
@@ -568,8 +567,7 @@
if (is_waiting_for_unload_ack_)
StartHangMonitorTimeout(TimeDelta::FromMilliseconds(kUnloadTimeoutMS));
- if (--modal_dialog_count_ == 0)
- modal_dialog_event_->Reset();
+ ResetModalDialogEvent();
ViewHostMsg_ShowModalHTMLDialog::WriteReplyParams(reply_msg, json_retval);
Send(reply_msg);
@@ -812,8 +810,7 @@
void RenderViewHost::Shutdown() {
// If we are being run modally (see RunModal), then we need to cleanup.
if (run_modal_reply_msg_) {
- if (--modal_dialog_count_ == 0)
- modal_dialog_event_->Reset();
+ ResetModalDialogEvent();
Send(run_modal_reply_msg_);
run_modal_reply_msg_ = NULL;
}
@@ -865,8 +862,7 @@
void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) {
DCHECK(!run_modal_reply_msg_);
- if (modal_dialog_count_++ == 0)
- modal_dialog_event_->Signal();
+ SignalModalDialogEvent();
run_modal_reply_msg_ = reply_msg;
// TODO(darin): Bug 1107929: Need to inform our delegate to show this view in
@@ -1200,8 +1196,7 @@
const int flags,
IPC::Message* reply_msg) {
StopHangMonitorTimeout();
- if (modal_dialog_count_++ == 0)
- modal_dialog_event_->Signal();
+ SignalModalDialogEvent();
delegate_->RunJavaScriptMessage(message, default_prompt, frame_url, flags,
reply_msg,
&are_javascript_messages_suppressed_);
@@ -1211,8 +1206,7 @@
const std::wstring& message,
IPC::Message* reply_msg) {
StopHangMonitorTimeout();
- if (modal_dialog_count_++ == 0)
- modal_dialog_event_->Signal();
+ SignalModalDialogEvent();
delegate_->RunBeforeUnloadConfirm(message, reply_msg);
}
@@ -1220,8 +1214,7 @@
const GURL& url, int width, int height, const std::string& json_arguments,
IPC::Message* reply_msg) {
StopHangMonitorTimeout();
- if (modal_dialog_count_++ == 0)
- modal_dialog_event_->Signal();
+ SignalModalDialogEvent();
delegate_->ShowModalHTMLDialog(url, width, height, json_arguments, reply_msg);
}
@@ -1509,3 +1502,13 @@
void RenderViewHost::OnCSSInserted() {
delegate_->DidInsertCSS();
}
+
+void RenderViewHost::SignalModalDialogEvent() {
+ if (modal_dialog_count_++ == 0)
+ modal_dialog_event_->Signal();
+}
+
+void RenderViewHost::ResetModalDialogEvent() {
+ if (--modal_dialog_count_ == 0)
+ modal_dialog_event_->Reset();
+}
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/render_widget_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698