| 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/renderer/render_view.h" | 5 #include "content/renderer/render_view.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 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2239 completed_client_redirect_src_ = GURL(); | 2239 completed_client_redirect_src_ = GURL(); |
| 2240 } else if (frame->parent()->isLoading()) { | 2240 } else if (frame->parent()->isLoading()) { |
| 2241 // Take note of AUTO_SUBFRAME loads here, so that we can know how to | 2241 // Take note of AUTO_SUBFRAME loads here, so that we can know how to |
| 2242 // load an error page. See didFailProvisionalLoad. | 2242 // load an error page. See didFailProvisionalLoad. |
| 2243 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); | 2243 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); |
| 2244 } | 2244 } |
| 2245 | 2245 |
| 2246 FOR_EACH_OBSERVER( | 2246 FOR_EACH_OBSERVER( |
| 2247 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); | 2247 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); |
| 2248 | 2248 |
| 2249 bool has_opener_set = opener_id_ != MSG_ROUTING_NONE; |
| 2249 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 2250 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
| 2250 routing_id_, frame->identifier(), is_top_most, ds->request().url())); | 2251 routing_id_, frame->identifier(), is_top_most, has_opener_set, |
| 2252 ds->request().url())); |
| 2251 } | 2253 } |
| 2252 | 2254 |
| 2253 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) { | 2255 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) { |
| 2254 if (frame->parent()) | 2256 if (frame->parent()) |
| 2255 return; | 2257 return; |
| 2256 // Received a redirect on the main frame. | 2258 // Received a redirect on the main frame. |
| 2257 WebDataSource* data_source = frame->provisionalDataSource(); | 2259 WebDataSource* data_source = frame->provisionalDataSource(); |
| 2258 if (!data_source) { | 2260 if (!data_source) { |
| 2259 // Should only be invoked when we have a data source. | 2261 // Should only be invoked when we have a data source. |
| 2260 NOTREACHED(); | 2262 NOTREACHED(); |
| 2261 return; | 2263 return; |
| 2262 } | 2264 } |
| 2263 std::vector<GURL> redirects; | 2265 std::vector<GURL> redirects; |
| 2264 GetRedirectChain(data_source, &redirects); | 2266 GetRedirectChain(data_source, &redirects); |
| 2265 if (redirects.size() >= 2) { | 2267 if (redirects.size() >= 2) { |
| 2268 bool has_opener_set = opener_id_ != MSG_ROUTING_NONE; |
| 2266 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, | 2269 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, |
| 2267 redirects[redirects.size() - 2], redirects.back())); | 2270 has_opener_set, redirects[redirects.size() - 2], redirects.back())); |
| 2268 } | 2271 } |
| 2269 } | 2272 } |
| 2270 | 2273 |
| 2271 void RenderView::didFailProvisionalLoad(WebFrame* frame, | 2274 void RenderView::didFailProvisionalLoad(WebFrame* frame, |
| 2272 const WebURLError& error) { | 2275 const WebURLError& error) { |
| 2273 // Notify the browser that we failed a provisional load with an error. | 2276 // Notify the browser that we failed a provisional load with an error. |
| 2274 // | 2277 // |
| 2275 // Note: It is important this notification occur before DidStopLoading so the | 2278 // Note: It is important this notification occur before DidStopLoading so the |
| 2276 // SSL manager can react to the provisional load failure before being | 2279 // SSL manager can react to the provisional load failure before being |
| 2277 // notified the load stopped. | 2280 // notified the load stopped. |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4103 const webkit_glue::CustomContextMenuContext& custom_context) { | 4106 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4104 if (custom_context.is_pepper_menu) | 4107 if (custom_context.is_pepper_menu) |
| 4105 pepper_delegate_.OnContextMenuClosed(custom_context); | 4108 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4106 else | 4109 else |
| 4107 context_menu_node_.reset(); | 4110 context_menu_node_.reset(); |
| 4108 } | 4111 } |
| 4109 | 4112 |
| 4110 void RenderView::OnNetworkStateChanged(bool online) { | 4113 void RenderView::OnNetworkStateChanged(bool online) { |
| 4111 WebNetworkStateNotifier::setOnLine(online); | 4114 WebNetworkStateNotifier::setOnLine(online); |
| 4112 } | 4115 } |
| OLD | NEW |