| 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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2894 } | 2894 } |
| 2895 | 2895 |
| 2896 FOR_EACH_OBSERVER( | 2896 FOR_EACH_OBSERVER( |
| 2897 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); | 2897 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); |
| 2898 | 2898 |
| 2899 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 2899 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
| 2900 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), | 2900 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), |
| 2901 ds->request().url())); | 2901 ds->request().url())); |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 void RenderViewImpl::didReceiveServerRedirectForProvisionalLoad( | |
| 2905 WebFrame* frame) { | |
| 2906 if (frame->parent()) | |
| 2907 return; | |
| 2908 // Received a redirect on the main frame. | |
| 2909 WebDataSource* data_source = frame->provisionalDataSource(); | |
| 2910 if (!data_source) { | |
| 2911 // Should only be invoked when we have a data source. | |
| 2912 NOTREACHED(); | |
| 2913 return; | |
| 2914 } | |
| 2915 std::vector<GURL> redirects; | |
| 2916 GetRedirectChain(data_source, &redirects); | |
| 2917 if (redirects.size() >= 2) { | |
| 2918 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, | |
| 2919 GetOpenerUrl(), redirects[redirects.size() - 2], redirects.back())); | |
| 2920 } | |
| 2921 } | |
| 2922 | |
| 2923 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, | 2904 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, |
| 2924 const WebURLError& error) { | 2905 const WebURLError& error) { |
| 2925 // Notify the browser that we failed a provisional load with an error. | 2906 // Notify the browser that we failed a provisional load with an error. |
| 2926 // | 2907 // |
| 2927 // Note: It is important this notification occur before DidStopLoading so the | 2908 // Note: It is important this notification occur before DidStopLoading so the |
| 2928 // SSL manager can react to the provisional load failure before being | 2909 // SSL manager can react to the provisional load failure before being |
| 2929 // notified the load stopped. | 2910 // notified the load stopped. |
| 2930 // | 2911 // |
| 2931 WebDataSource* ds = frame->provisionalDataSource(); | 2912 WebDataSource* ds = frame->provisionalDataSource(); |
| 2932 DCHECK(ds); | 2913 DCHECK(ds); |
| (...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5605 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5586 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5606 return !!RenderThreadImpl::current()->compositor_thread(); | 5587 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5607 } | 5588 } |
| 5608 | 5589 |
| 5609 void RenderViewImpl::OnJavaBridgeInit() { | 5590 void RenderViewImpl::OnJavaBridgeInit() { |
| 5610 DCHECK(!java_bridge_dispatcher_); | 5591 DCHECK(!java_bridge_dispatcher_); |
| 5611 #if defined(ENABLE_JAVA_BRIDGE) | 5592 #if defined(ENABLE_JAVA_BRIDGE) |
| 5612 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5593 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5613 #endif | 5594 #endif |
| 5614 } | 5595 } |
| OLD | NEW |