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 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 } | 2461 } |
2462 } | 2462 } |
2463 | 2463 |
2464 // In most cases, we receive this from a swapped out RenderViewHost. | 2464 // In most cases, we receive this from a swapped out RenderViewHost. |
2465 // It is possible to receive it from one that has just been swapped in, | 2465 // It is possible to receive it from one that has just been swapped in, |
2466 // in which case we might as well deliver the message anyway. | 2466 // in which case we might as well deliver the message anyway. |
2467 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( | 2467 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( |
2468 GetRenderViewHost()->GetRoutingID(), new_params)); | 2468 GetRenderViewHost()->GetRoutingID(), new_params)); |
2469 } | 2469 } |
2470 | 2470 |
| 2471 bool WebContentsImpl::ShouldIgnoreNavigation( |
| 2472 RenderViewHost* render_view_host, |
| 2473 const GURL& url, |
| 2474 const content::Referrer& referrer, |
| 2475 bool is_content_initiated) { |
| 2476 if (!delegate_) |
| 2477 return false; |
| 2478 |
| 2479 GURL validated_url(url); |
| 2480 RenderViewHostImpl* render_view_host_impl = |
| 2481 static_cast<RenderViewHostImpl*>(render_view_host); |
| 2482 content::RenderProcessHost* render_process_host = |
| 2483 render_view_host->GetProcess(); |
| 2484 render_view_host_impl->FilterURL( |
| 2485 ChildProcessSecurityPolicyImpl::GetInstance(), |
| 2486 render_process_host->GetID(), |
| 2487 false, |
| 2488 &validated_url); |
| 2489 return delegate_->ShouldIgnoreNavigation( |
| 2490 this, validated_url, referrer, is_content_initiated); |
| 2491 } |
| 2492 |
2471 void WebContentsImpl::RunJavaScriptMessage( | 2493 void WebContentsImpl::RunJavaScriptMessage( |
2472 RenderViewHost* rvh, | 2494 RenderViewHost* rvh, |
2473 const string16& message, | 2495 const string16& message, |
2474 const string16& default_prompt, | 2496 const string16& default_prompt, |
2475 const GURL& frame_url, | 2497 const GURL& frame_url, |
2476 ui::JavascriptMessageType javascript_message_type, | 2498 ui::JavascriptMessageType javascript_message_type, |
2477 IPC::Message* reply_msg, | 2499 IPC::Message* reply_msg, |
2478 bool* did_suppress_message) { | 2500 bool* did_suppress_message) { |
2479 // Suppress JavaScript dialogs when requested. Also suppress messages when | 2501 // Suppress JavaScript dialogs when requested. Also suppress messages when |
2480 // showing an interstitial as it's shown over the previous page and we don't | 2502 // showing an interstitial as it's shown over the previous page and we don't |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2804 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2783 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2805 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2784 // Can be NULL during tests. | 2806 // Can be NULL during tests. |
2785 if (rwh_view) | 2807 if (rwh_view) |
2786 rwh_view->SetSize(GetView()->GetContainerSize()); | 2808 rwh_view->SetSize(GetView()->GetContainerSize()); |
2787 } | 2809 } |
2788 | 2810 |
2789 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2811 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
2790 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2812 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
2791 } | 2813 } |
OLD | NEW |