Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index f4a1764606c21c284b86b1f78f1e0c49e95a2688..6a323ac6b3c57033293e6b7b2b92acedb80d3954 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -1028,6 +1028,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params) |
| media_player_delegate_(NULL), |
| is_using_lofi_(false), |
| is_pasting_(false), |
| + suppress_further_dialogs_(false), |
| blame_context_(nullptr), |
| weak_factory_(this) { |
| std::pair<RoutingIDFrameMap::iterator, bool> result = |
| @@ -1443,6 +1444,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { |
| IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
| IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
| IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| + IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
| + OnSuppressFurtherDialogs) |
| #if defined(OS_ANDROID) |
| IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
| OnActivateNearestFindResult) |
| @@ -1574,11 +1577,6 @@ void RenderFrameImpl::OnSwapOut( |
| blink::WebPageVisibilityStateHidden, false); |
| } |
| - // It is now safe to show modal dialogs again. |
| - // TODO(creis): Deal with modal dialogs from subframes. |
| - if (is_main_frame_) |
| - render_view_->suppress_dialogs_until_swap_out_ = false; |
|
Charlie Reis
2016/04/08 17:27:40
Yes, I agree with removing this. This RenderFrame
|
| - |
| Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); |
| RenderViewImpl* render_view = render_view_.get(); |
| @@ -2150,8 +2148,8 @@ bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, |
| const GURL& frame_url, |
| base::string16* result) { |
| // Don't allow further dialogs if we are waiting to swap out, since the |
| - // PageGroupLoadDeferrer in our stack prevents it. |
| - if (render_view()->suppress_dialogs_until_swap_out_) |
| + // ScopedPageLoadDeferrer in our stack prevents it. |
| + if (suppress_further_dialogs_) |
| return false; |
| bool success = false; |
| @@ -3614,8 +3612,8 @@ bool RenderFrameImpl::runModalPromptDialog( |
| bool RenderFrameImpl::runModalBeforeUnloadDialog(bool is_reload) { |
| // Don't allow further dialogs if we are waiting to swap out, since the |
| - // PageGroupLoadDeferrer in our stack prevents it. |
| - if (render_view()->suppress_dialogs_until_swap_out_) |
| + // ScopedPageLoadDeferrer in our stack prevents it. |
| + if (suppress_further_dialogs_) |
| return false; |
| bool success = false; |
| @@ -5128,6 +5126,10 @@ void RenderFrameImpl::OnEnableViewSourceMode() { |
| frame_->enableViewSourceMode(true); |
| } |
| +void RenderFrameImpl::OnSuppressFurtherDialogs() { |
| + suppress_further_dialogs_ = true; |
| +} |
| + |
| #if defined(OS_ANDROID) |
| void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
| float x, |