OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 const webkit_glue::WebIntentData& intent, | 914 const webkit_glue::WebIntentData& intent, |
915 int intent_id) { | 915 int intent_id) { |
916 delegate()->WebIntentDispatch(this, message.routing_id(), intent, intent_id); | 916 delegate()->WebIntentDispatch(this, message.routing_id(), intent, intent_id); |
917 } | 917 } |
918 | 918 |
919 void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, | 919 void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, |
920 bool is_main_frame, | 920 bool is_main_frame, |
921 const GURL& opener_url, | 921 const GURL& opener_url, |
922 const GURL& url) { | 922 const GURL& url) { |
923 bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); | 923 bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); |
| 924 RenderViewHost* rvh = render_manager_.pending_render_view_host() ? |
| 925 render_manager_.pending_render_view_host() : render_view_host(); |
| 926 |
924 GURL validated_url(url); | 927 GURL validated_url(url); |
925 render_view_host()->FilterURL(ChildProcessSecurityPolicy::GetInstance(), | 928 RenderViewHost::FilterURL(ChildProcessSecurityPolicy::GetInstance(), |
926 GetRenderProcessHost()->GetID(), &validated_url); | 929 rvh->process()->GetID(), &validated_url); |
927 | 930 |
928 RenderViewHost* rvh = | |
929 render_manager_.pending_render_view_host() ? | |
930 render_manager_.pending_render_view_host() : render_view_host(); | |
931 // Notify observers about the start of the provisional load. | 931 // Notify observers about the start of the provisional load. |
932 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 932 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
933 DidStartProvisionalLoadForFrame(frame_id, is_main_frame, | 933 DidStartProvisionalLoadForFrame(frame_id, is_main_frame, |
934 validated_url, is_error_page, rvh)); | 934 validated_url, is_error_page, rvh)); |
935 | 935 |
936 if (is_main_frame) { | 936 if (is_main_frame) { |
937 // Notify observers about the provisional change in the main frame URL. | 937 // Notify observers about the provisional change in the main frame URL. |
938 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 938 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
939 ProvisionalChangeToMainFrameUrl(url, opener_url)); | 939 ProvisionalChangeToMainFrameUrl(url, opener_url)); |
940 } | 940 } |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2051 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2052 // Can be NULL during tests. | 2052 // Can be NULL during tests. |
2053 if (rwh_view) | 2053 if (rwh_view) |
2054 rwh_view->SetSize(view()->GetContainerSize()); | 2054 rwh_view->SetSize(view()->GetContainerSize()); |
2055 } | 2055 } |
2056 | 2056 |
2057 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2057 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
2058 return render_view_host() ? | 2058 return render_view_host() ? |
2059 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2059 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
2060 } | 2060 } |
OLD | NEW |