| 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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 } | 2761 } |
| 2762 | 2762 |
| 2763 FOR_EACH_OBSERVER( | 2763 FOR_EACH_OBSERVER( |
| 2764 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); | 2764 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); |
| 2765 | 2765 |
| 2766 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 2766 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
| 2767 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), | 2767 routing_id_, frame->identifier(), is_top_most, GetOpenerUrl(), |
| 2768 ds->request().url())); | 2768 ds->request().url())); |
| 2769 } | 2769 } |
| 2770 | 2770 |
| 2771 void RenderViewImpl::didReceiveServerRedirectForProvisionalLoad( | |
| 2772 WebFrame* frame) { | |
| 2773 if (frame->parent()) | |
| 2774 return; | |
| 2775 // Received a redirect on the main frame. | |
| 2776 WebDataSource* data_source = frame->provisionalDataSource(); | |
| 2777 if (!data_source) { | |
| 2778 // Should only be invoked when we have a data source. | |
| 2779 NOTREACHED(); | |
| 2780 return; | |
| 2781 } | |
| 2782 std::vector<GURL> redirects; | |
| 2783 GetRedirectChain(data_source, &redirects); | |
| 2784 if (redirects.size() >= 2) { | |
| 2785 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, | |
| 2786 GetOpenerUrl(), redirects[redirects.size() - 2], redirects.back())); | |
| 2787 } | |
| 2788 } | |
| 2789 | |
| 2790 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, | 2771 void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame, |
| 2791 const WebURLError& error) { | 2772 const WebURLError& error) { |
| 2792 // Notify the browser that we failed a provisional load with an error. | 2773 // Notify the browser that we failed a provisional load with an error. |
| 2793 // | 2774 // |
| 2794 // Note: It is important this notification occur before DidStopLoading so the | 2775 // Note: It is important this notification occur before DidStopLoading so the |
| 2795 // SSL manager can react to the provisional load failure before being | 2776 // SSL manager can react to the provisional load failure before being |
| 2796 // notified the load stopped. | 2777 // notified the load stopped. |
| 2797 // | 2778 // |
| 2798 WebDataSource* ds = frame->provisionalDataSource(); | 2779 WebDataSource* ds = frame->provisionalDataSource(); |
| 2799 DCHECK(ds); | 2780 DCHECK(ds); |
| (...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5390 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5371 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5391 return !!RenderThreadImpl::current()->compositor_thread(); | 5372 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5392 } | 5373 } |
| 5393 | 5374 |
| 5394 void RenderViewImpl::OnJavaBridgeInit() { | 5375 void RenderViewImpl::OnJavaBridgeInit() { |
| 5395 DCHECK(!java_bridge_dispatcher_); | 5376 DCHECK(!java_bridge_dispatcher_); |
| 5396 #if defined(ENABLE_JAVA_BRIDGE) | 5377 #if defined(ENABLE_JAVA_BRIDGE) |
| 5397 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5378 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5398 #endif | 5379 #endif |
| 5399 } | 5380 } |
| OLD | NEW |