| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include <cmath> | 9 #include <cmath> | 
| 10 #include <utility> | 10 #include <utility> | 
| (...skipping 3879 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3890 void WebContentsImpl::RunBeforeUnloadConfirm( | 3890 void WebContentsImpl::RunBeforeUnloadConfirm( | 
| 3891     RenderFrameHost* render_frame_host, | 3891     RenderFrameHost* render_frame_host, | 
| 3892     bool is_reload, | 3892     bool is_reload, | 
| 3893     IPC::Message* reply_msg) { | 3893     IPC::Message* reply_msg) { | 
| 3894   RenderFrameHostImpl* rfhi = | 3894   RenderFrameHostImpl* rfhi = | 
| 3895       static_cast<RenderFrameHostImpl*>(render_frame_host); | 3895       static_cast<RenderFrameHostImpl*>(render_frame_host); | 
| 3896   if (delegate_) | 3896   if (delegate_) | 
| 3897     delegate_->WillRunBeforeUnloadConfirm(); | 3897     delegate_->WillRunBeforeUnloadConfirm(); | 
| 3898 | 3898 | 
| 3899   bool suppress_this_message = | 3899   bool suppress_this_message = | 
| 3900       rfhi->rfh_state() != RenderFrameHostImpl::STATE_DEFAULT || | 3900       !rfhi->is_active() || | 
| 3901       ShowingInterstitialPage() || !delegate_ || | 3901       ShowingInterstitialPage() || !delegate_ || | 
| 3902       delegate_->ShouldSuppressDialogs(this) || | 3902       delegate_->ShouldSuppressDialogs(this) || | 
| 3903       !delegate_->GetJavaScriptDialogManager(this); | 3903       !delegate_->GetJavaScriptDialogManager(this); | 
| 3904   if (suppress_this_message) { | 3904   if (suppress_this_message) { | 
| 3905     rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), true); | 3905     rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), true); | 
| 3906     return; | 3906     return; | 
| 3907   } | 3907   } | 
| 3908 | 3908 | 
| 3909   is_showing_before_unload_dialog_ = true; | 3909   is_showing_before_unload_dialog_ = true; | 
| 3910   dialog_manager_ = delegate_->GetJavaScriptDialogManager(this); | 3910   dialog_manager_ = delegate_->GetJavaScriptDialogManager(this); | 
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4838   else | 4838   else | 
| 4839     WasHidden(); | 4839     WasHidden(); | 
| 4840 } | 4840 } | 
| 4841 | 4841 | 
| 4842 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4842 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 
| 4843     JavaScriptDialogManager* dialog_manager) { | 4843     JavaScriptDialogManager* dialog_manager) { | 
| 4844   dialog_manager_ = dialog_manager; | 4844   dialog_manager_ = dialog_manager; | 
| 4845 } | 4845 } | 
| 4846 | 4846 | 
| 4847 }  // namespace content | 4847 }  // namespace content | 
| OLD | NEW | 
|---|