| 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 3828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3839 RenderFrameHost* render_frame_host, | 3839 RenderFrameHost* render_frame_host, |
| 3840 const base::string16& message, | 3840 const base::string16& message, |
| 3841 const base::string16& default_prompt, | 3841 const base::string16& default_prompt, |
| 3842 const GURL& frame_url, | 3842 const GURL& frame_url, |
| 3843 JavaScriptMessageType javascript_message_type, | 3843 JavaScriptMessageType javascript_message_type, |
| 3844 IPC::Message* reply_msg) { | 3844 IPC::Message* reply_msg) { |
| 3845 // Suppress JavaScript dialogs when requested. Also suppress messages when | 3845 // Suppress JavaScript dialogs when requested. Also suppress messages when |
| 3846 // showing an interstitial as it's shown over the previous page and we don't | 3846 // showing an interstitial as it's shown over the previous page and we don't |
| 3847 // want the hidden page's dialogs to interfere with the interstitial. | 3847 // want the hidden page's dialogs to interfere with the interstitial. |
| 3848 bool suppress_this_message = | 3848 bool suppress_this_message = |
| 3849 static_cast<RenderFrameHostImpl*>(render_frame_host)->is_swapped_out() || | |
| 3850 ShowingInterstitialPage() || !delegate_ || | 3849 ShowingInterstitialPage() || !delegate_ || |
| 3851 delegate_->ShouldSuppressDialogs(this) || | 3850 delegate_->ShouldSuppressDialogs(this) || |
| 3852 !delegate_->GetJavaScriptDialogManager(this); | 3851 !delegate_->GetJavaScriptDialogManager(this); |
| 3853 | 3852 |
| 3854 if (!suppress_this_message) { | 3853 if (!suppress_this_message) { |
| 3855 std::string accept_lang = GetContentClient()->browser()-> | 3854 std::string accept_lang = GetContentClient()->browser()-> |
| 3856 GetAcceptLangs(GetBrowserContext()); | 3855 GetAcceptLangs(GetBrowserContext()); |
| 3857 dialog_manager_ = delegate_->GetJavaScriptDialogManager(this); | 3856 dialog_manager_ = delegate_->GetJavaScriptDialogManager(this); |
| 3858 dialog_manager_->RunJavaScriptDialog( | 3857 dialog_manager_->RunJavaScriptDialog( |
| 3859 this, frame_url, accept_lang, javascript_message_type, message, | 3858 this, frame_url, accept_lang, javascript_message_type, message, |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4839 else | 4838 else |
| 4840 WasHidden(); | 4839 WasHidden(); |
| 4841 } | 4840 } |
| 4842 | 4841 |
| 4843 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4842 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 4844 JavaScriptDialogManager* dialog_manager) { | 4843 JavaScriptDialogManager* dialog_manager) { |
| 4845 dialog_manager_ = dialog_manager; | 4844 dialog_manager_ = dialog_manager; |
| 4846 } | 4845 } |
| 4847 | 4846 |
| 4848 } // namespace content | 4847 } // namespace content |
| OLD | NEW |