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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 } | 2721 } |
2722 } | 2722 } |
2723 | 2723 |
2724 // In most cases, we receive this from a swapped out RenderViewHost. | 2724 // In most cases, we receive this from a swapped out RenderViewHost. |
2725 // It is possible to receive it from one that has just been swapped in, | 2725 // It is possible to receive it from one that has just been swapped in, |
2726 // in which case we might as well deliver the message anyway. | 2726 // in which case we might as well deliver the message anyway. |
2727 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( | 2727 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( |
2728 GetRenderViewHost()->GetRoutingID(), new_params)); | 2728 GetRenderViewHost()->GetRoutingID(), new_params)); |
2729 } | 2729 } |
2730 | 2730 |
| 2731 bool WebContentsImpl::ShouldIgnoreNavigation( |
| 2732 const GURL& url, |
| 2733 const content::Referrer& referrer, |
| 2734 bool is_content_initiated) { |
| 2735 if (!delegate_) |
| 2736 return false; |
| 2737 |
| 2738 GURL validated_url(url); |
| 2739 RenderViewHostImpl* render_view_host_impl = GetRenderViewHostImpl(); |
| 2740 if (!render_view_host_impl) |
| 2741 return false; |
| 2742 render_view_host_impl->FilterURL( |
| 2743 ChildProcessSecurityPolicyImpl::GetInstance(), |
| 2744 render_view_host_impl->GetProcess()->GetID(), |
| 2745 false, |
| 2746 &validated_url); |
| 2747 return delegate_->ShouldIgnoreNavigation( |
| 2748 this, validated_url, referrer, is_content_initiated); |
| 2749 } |
| 2750 |
2731 void WebContentsImpl::RunJavaScriptMessage( | 2751 void WebContentsImpl::RunJavaScriptMessage( |
2732 RenderViewHost* rvh, | 2752 RenderViewHost* rvh, |
2733 const string16& message, | 2753 const string16& message, |
2734 const string16& default_prompt, | 2754 const string16& default_prompt, |
2735 const GURL& frame_url, | 2755 const GURL& frame_url, |
2736 ui::JavascriptMessageType javascript_message_type, | 2756 ui::JavascriptMessageType javascript_message_type, |
2737 IPC::Message* reply_msg, | 2757 IPC::Message* reply_msg, |
2738 bool* did_suppress_message) { | 2758 bool* did_suppress_message) { |
2739 // Suppress JavaScript dialogs when requested. Also suppress messages when | 2759 // Suppress JavaScript dialogs when requested. Also suppress messages when |
2740 // showing an interstitial as it's shown over the previous page and we don't | 2760 // showing an interstitial as it's shown over the previous page and we don't |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 browser_plugin_host()->embedder_render_process_host(); | 3084 browser_plugin_host()->embedder_render_process_host(); |
3065 *embedder_container_id = browser_plugin_host()->instance_id(); | 3085 *embedder_container_id = browser_plugin_host()->instance_id(); |
3066 int embedder_process_id = | 3086 int embedder_process_id = |
3067 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3087 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3068 if (embedder_process_id != -1) { | 3088 if (embedder_process_id != -1) { |
3069 *embedder_channel_name = | 3089 *embedder_channel_name = |
3070 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3090 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3071 embedder_process_id); | 3091 embedder_process_id); |
3072 } | 3092 } |
3073 } | 3093 } |
OLD | NEW |