Chromium Code Reviews| Index: content/browser/tab_contents/tab_contents.cc |
| diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc |
| index 013f8d56eca31777e282c120ae83f4b9465560df..d162d372b850c3b6b856cb3ec9226de18782b282 100644 |
| --- a/content/browser/tab_contents/tab_contents.cc |
| +++ b/content/browser/tab_contents/tab_contents.cc |
| @@ -2006,7 +2006,7 @@ void TabContents::RequestTransferURL(const GURL& url, |
| } |
| void TabContents::RunJavaScriptMessage( |
| - const RenderViewHost* rvh, |
| + RenderViewHost* rvh, |
| const string16& message, |
| const string16& default_prompt, |
| const GURL& frame_url, |
| @@ -2050,13 +2050,13 @@ void TabContents::RunJavaScriptMessage( |
| if (suppress_this_message) { |
| // If we are suppressing messages, just reply as if the user immediately |
| // pressed "Cancel". |
| - OnDialogClosed(reply_msg, false, string16()); |
| + OnDialogClosed(rvh, reply_msg, false, string16()); |
| } |
| *did_suppress_message = suppress_this_message; |
| } |
| -void TabContents::RunBeforeUnloadConfirm(const RenderViewHost* rvh, |
| +void TabContents::RunBeforeUnloadConfirm(RenderViewHost* rvh, |
| const string16& message, |
| IPC::Message* reply_msg) { |
| if (delegate_) |
| @@ -2067,7 +2067,7 @@ void TabContents::RunBeforeUnloadConfirm(const RenderViewHost* rvh, |
| !delegate_ || |
| delegate_->ShouldSuppressDialogs(); |
| if (suppress_this_message) { |
| - GetRenderViewHost()->JavaScriptDialogClosed(reply_msg, true, string16()); |
| + rvh->JavaScriptDialogClosed(reply_msg, true, string16()); |
| return; |
| } |
| @@ -2253,7 +2253,8 @@ bool TabContents::CreateRenderViewForRenderManager( |
| return true; |
| } |
| -void TabContents::OnDialogClosed(IPC::Message* reply_msg, |
| +void TabContents::OnDialogClosed(RenderViewHost* rvh, |
| + IPC::Message* reply_msg, |
| bool success, |
| const string16& user_input) { |
| if (is_showing_before_unload_dialog_ && !success) { |
| @@ -2264,7 +2265,11 @@ void TabContents::OnDialogClosed(IPC::Message* reply_msg, |
| tab_close_start_time_ = base::TimeTicks(); |
| } |
| is_showing_before_unload_dialog_ = false; |
| - GetRenderViewHost()->JavaScriptDialogClosed(reply_msg, success, user_input); |
| + // TODO(creis): We shouldn't have this. The API should make it possible |
| + // to send the reply to the right RVH implicitly. |
|
jam
2012/01/26 00:29:21
I don't understand which API you mean? and how thi
|
| + if (!rvh) |
| + rvh = GetRenderViewHost(); |
| + rvh->JavaScriptDialogClosed(reply_msg, success, user_input); |
|
Charlie Reis
2012/01/26 00:17:52
I recognize that we probably don't want to add Ren
|
| } |
| gfx::NativeWindow TabContents::GetDialogRootWindow() const { |