| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we | 793 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we |
| 794 // handle loading of error pages. | 794 // handle loading of error pages. |
| 795 document_state->navigation_state()->set_transition_type( | 795 document_state->navigation_state()->set_transition_type( |
| 796 PAGE_TRANSITION_AUTO_SUBFRAME); | 796 PAGE_TRANSITION_AUTO_SUBFRAME); |
| 797 } | 797 } |
| 798 | 798 |
| 799 FOR_EACH_OBSERVER( | 799 FOR_EACH_OBSERVER( |
| 800 RenderViewObserver, render_view_->observers(), | 800 RenderViewObserver, render_view_->observers(), |
| 801 DidStartProvisionalLoad(frame)); | 801 DidStartProvisionalLoad(frame)); |
| 802 | 802 |
| 803 FOR_EACH_OBSERVER( |
| 804 RenderFrameObserver, observers_, |
| 805 DidStartProvisionalLoad()); |
| 806 |
| 803 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( | 807 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( |
| 804 routing_id_, frame->identifier(), | 808 routing_id_, frame->identifier(), |
| 805 frame->parent() ? frame->parent()->identifier() : -1, | 809 frame->parent() ? frame->parent()->identifier() : -1, |
| 806 is_top_most, ds->request().url())); | 810 is_top_most, ds->request().url())); |
| 807 } | 811 } |
| 808 | 812 |
| 809 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( | 813 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( |
| 810 blink::WebFrame* frame) { | 814 blink::WebFrame* frame) { |
| 811 if (frame->parent()) | 815 if (frame->parent()) |
| 812 return; | 816 return; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 832 blink::WebFrame* frame, | 836 blink::WebFrame* frame, |
| 833 const blink::WebURLError& error) { | 837 const blink::WebURLError& error) { |
| 834 WebDataSource* ds = frame->provisionalDataSource(); | 838 WebDataSource* ds = frame->provisionalDataSource(); |
| 835 DCHECK(ds); | 839 DCHECK(ds); |
| 836 | 840 |
| 837 const WebURLRequest& failed_request = ds->request(); | 841 const WebURLRequest& failed_request = ds->request(); |
| 838 | 842 |
| 839 // Call out to RenderViewImpl, so observers are notified. | 843 // Call out to RenderViewImpl, so observers are notified. |
| 840 render_view_->didFailProvisionalLoad(frame, error); | 844 render_view_->didFailProvisionalLoad(frame, error); |
| 841 | 845 |
| 846 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
| 847 DidFailProvisionalLoad(error)); |
| 848 |
| 842 bool show_repost_interstitial = | 849 bool show_repost_interstitial = |
| 843 (error.reason == net::ERR_CACHE_MISS && | 850 (error.reason == net::ERR_CACHE_MISS && |
| 844 EqualsASCII(failed_request.httpMethod(), "POST")); | 851 EqualsASCII(failed_request.httpMethod(), "POST")); |
| 845 | 852 |
| 846 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 853 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
| 847 params.frame_id = frame->identifier(); | 854 params.frame_id = frame->identifier(); |
| 848 params.frame_unique_name = frame->uniqueName(); | 855 params.frame_unique_name = frame->uniqueName(); |
| 849 params.is_main_frame = !frame->parent(); | 856 params.is_main_frame = !frame->parent(); |
| 850 params.error_code = error.reason; | 857 params.error_code = error.reason; |
| 851 GetContentClient()->renderer()->GetNavigationErrorStrings( | 858 GetContentClient()->renderer()->GetNavigationErrorStrings( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 // * history_list_offset_ | 941 // * history_list_offset_ |
| 935 // * history_list_length_ | 942 // * history_list_length_ |
| 936 // * history_page_ids_ | 943 // * history_page_ids_ |
| 937 // Needed methods | 944 // Needed methods |
| 938 // * webview | 945 // * webview |
| 939 // * UpdateSessionHistory | 946 // * UpdateSessionHistory |
| 940 // * GetLoadingUrl | 947 // * GetLoadingUrl |
| 941 render_view_->didCommitProvisionalLoad(frame, is_new_navigation); | 948 render_view_->didCommitProvisionalLoad(frame, is_new_navigation); |
| 942 | 949 |
| 943 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, | 950 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
| 944 DidCommitProvisionalLoad(frame, is_new_navigation)); | 951 DidCommitProvisionalLoad(is_new_navigation)); |
| 945 } | 952 } |
| 946 | 953 |
| 947 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, | 954 void RenderFrameImpl::didClearWindowObject(blink::WebFrame* frame, |
| 948 int world_id) { | 955 int world_id) { |
| 949 // TODO(nasko): Move implementation here. Needed state: | 956 // TODO(nasko): Move implementation here. Needed state: |
| 950 // * enabled_bindings_ | 957 // * enabled_bindings_ |
| 951 // * dom_automation_controller_ | 958 // * dom_automation_controller_ |
| 952 // * stats_collection_controller_ | 959 // * stats_collection_controller_ |
| 953 render_view_->didClearWindowObject(frame, world_id); | 960 render_view_->didClearWindowObject(frame, world_id); |
| 954 } | 961 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 | 1004 |
| 998 void RenderFrameImpl::didFailLoad(blink::WebFrame* frame, | 1005 void RenderFrameImpl::didFailLoad(blink::WebFrame* frame, |
| 999 const blink::WebURLError& error) { | 1006 const blink::WebURLError& error) { |
| 1000 // TODO(nasko): Move implementation here. No state needed. | 1007 // TODO(nasko): Move implementation here. No state needed. |
| 1001 render_view_->didFailLoad(frame, error); | 1008 render_view_->didFailLoad(frame, error); |
| 1002 } | 1009 } |
| 1003 | 1010 |
| 1004 void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) { | 1011 void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) { |
| 1005 // TODO(nasko): Move implementation here. No state needed, just observers | 1012 // TODO(nasko): Move implementation here. No state needed, just observers |
| 1006 // notification before sending message to the browser process. | 1013 // notification before sending message to the browser process. |
| 1014 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
| 1015 DidFinishLoad()); |
| 1007 render_view_->didFinishLoad(frame); | 1016 render_view_->didFinishLoad(frame); |
| 1008 } | 1017 } |
| 1009 | 1018 |
| 1010 void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, | 1019 void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, |
| 1011 bool is_new_navigation) { | 1020 bool is_new_navigation) { |
| 1012 // TODO(nasko): Move implementation here. No state needed, just observers | 1021 // TODO(nasko): Move implementation here. No state needed, just observers |
| 1013 // notification before sending message to the browser process. | 1022 // notification before sending message to the browser process. |
| 1014 render_view_->didNavigateWithinPage(frame, is_new_navigation); | 1023 render_view_->didNavigateWithinPage(frame, is_new_navigation); |
| 1015 } | 1024 } |
| 1016 | 1025 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) { | 1442 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) { |
| 1434 observers_.AddObserver(observer); | 1443 observers_.AddObserver(observer); |
| 1435 } | 1444 } |
| 1436 | 1445 |
| 1437 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { | 1446 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { |
| 1438 observer->RenderFrameGone(); | 1447 observer->RenderFrameGone(); |
| 1439 observers_.RemoveObserver(observer); | 1448 observers_.RemoveObserver(observer); |
| 1440 } | 1449 } |
| 1441 | 1450 |
| 1442 } // namespace content | 1451 } // namespace content |
| OLD | NEW |