| 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 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 FOR_EACH_OBSERVER( | 2871 FOR_EACH_OBSERVER( |
| 2872 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); | 2872 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); |
| 2873 | 2873 |
| 2874 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 2874 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
| 2875 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), | 2875 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), |
| 2876 ds->request().url())); | 2876 ds->request().url())); |
| 2877 } | 2877 } |
| 2878 | 2878 |
| 2879 void RenderViewImpl::didReceiveServerRedirectForProvisionalLoad( | |
| 2880 WebFrame* frame) { | |
| 2881 if (frame->parent()) | |
| 2882 return; | |
| 2883 // Received a redirect on the main frame. | |
| 2884 WebDataSource* data_source = frame->provisionalDataSource(); | |
| 2885 if (!data_source) { | |
| 2886 // Should only be invoked when we have a data source. | |
| 2887 NOTREACHED(); | |
| 2888 return; | |
| 2889 } | |
| 2890 std::vector<GURL> redirects; | |
| 2891 GetRedirectChain(data_source, &redirects); | |
| 2892 if (redirects.size() >= 2) { | |
| 2893 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, | |
| 2894 GetOpenerUrl(), redirects[redirects.size() - 2], redirects.back())); | |
| 2895 } | |
| 2896 } | |
| 2897 | |
| 2898 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, | 2879 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, |
| 2899 const WebURLError& error) { | 2880 const WebURLError& error) { |
| 2900 // Notify the browser that we failed a provisional load with an error. | 2881 // Notify the browser that we failed a provisional load with an error. |
| 2901 // | 2882 // |
| 2902 // Note: It is important this notification occur before DidStopLoading so the | 2883 // Note: It is important this notification occur before DidStopLoading so the |
| 2903 // SSL manager can react to the provisional load failure before being | 2884 // SSL manager can react to the provisional load failure before being |
| 2904 // notified the load stopped. | 2885 // notified the load stopped. |
| 2905 // | 2886 // |
| 2906 WebDataSource* ds = frame->provisionalDataSource(); | 2887 WebDataSource* ds = frame->provisionalDataSource(); |
| 2907 DCHECK(ds); | 2888 DCHECK(ds); |
| (...skipping 2646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5554 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5535 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5555 return !!RenderThreadImpl::current()->compositor_thread(); | 5536 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5556 } | 5537 } |
| 5557 | 5538 |
| 5558 void RenderViewImpl::OnJavaBridgeInit() { | 5539 void RenderViewImpl::OnJavaBridgeInit() { |
| 5559 DCHECK(!java_bridge_dispatcher_); | 5540 DCHECK(!java_bridge_dispatcher_); |
| 5560 #if defined(ENABLE_JAVA_BRIDGE) | 5541 #if defined(ENABLE_JAVA_BRIDGE) |
| 5561 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5542 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5562 #endif | 5543 #endif |
| 5563 } | 5544 } |
| OLD | NEW |