| 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 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2272 completed_client_redirect_src_ = GURL(); | 2272 completed_client_redirect_src_ = GURL(); |
| 2273 } else if (frame->parent()->isLoading()) { | 2273 } else if (frame->parent()->isLoading()) { |
| 2274 // Take note of AUTO_SUBFRAME loads here, so that we can know how to | 2274 // Take note of AUTO_SUBFRAME loads here, so that we can know how to |
| 2275 // load an error page. See didFailProvisionalLoad. | 2275 // load an error page. See didFailProvisionalLoad. |
| 2276 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); | 2276 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); |
| 2277 } | 2277 } |
| 2278 | 2278 |
| 2279 FOR_EACH_OBSERVER( | 2279 FOR_EACH_OBSERVER( |
| 2280 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); | 2280 RenderViewObserver, observers_, DidStartProvisionalLoad(frame)); |
| 2281 | 2281 |
| 2282 bool has_opener_set = opener_id_ != MSG_ROUTING_NONE; |
| 2282 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( | 2283 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( |
| 2283 routing_id_, frame->identifier(), is_top_most, ds->request().url())); | 2284 routing_id_, frame->identifier(), is_top_most, has_opener_set, |
| 2285 ds->request().url())); |
| 2284 } | 2286 } |
| 2285 | 2287 |
| 2286 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) { | 2288 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) { |
| 2287 if (frame->parent()) | 2289 if (frame->parent()) |
| 2288 return; | 2290 return; |
| 2289 // Received a redirect on the main frame. | 2291 // Received a redirect on the main frame. |
| 2290 WebDataSource* data_source = frame->provisionalDataSource(); | 2292 WebDataSource* data_source = frame->provisionalDataSource(); |
| 2291 if (!data_source) { | 2293 if (!data_source) { |
| 2292 // Should only be invoked when we have a data source. | 2294 // Should only be invoked when we have a data source. |
| 2293 NOTREACHED(); | 2295 NOTREACHED(); |
| 2294 return; | 2296 return; |
| 2295 } | 2297 } |
| 2296 std::vector<GURL> redirects; | 2298 std::vector<GURL> redirects; |
| 2297 GetRedirectChain(data_source, &redirects); | 2299 GetRedirectChain(data_source, &redirects); |
| 2298 if (redirects.size() >= 2) { | 2300 if (redirects.size() >= 2) { |
| 2301 bool has_opener_set = opener_id_ != MSG_ROUTING_NONE; |
| 2299 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, | 2302 Send(new ViewHostMsg_DidRedirectProvisionalLoad(routing_id_, page_id_, |
| 2300 redirects[redirects.size() - 2], redirects.back())); | 2303 has_opener_set, redirects[redirects.size() - 2], redirects.back())); |
| 2301 } | 2304 } |
| 2302 } | 2305 } |
| 2303 | 2306 |
| 2304 void RenderView::didFailProvisionalLoad(WebFrame* frame, | 2307 void RenderView::didFailProvisionalLoad(WebFrame* frame, |
| 2305 const WebURLError& error) { | 2308 const WebURLError& error) { |
| 2306 // Notify the browser that we failed a provisional load with an error. | 2309 // Notify the browser that we failed a provisional load with an error. |
| 2307 // | 2310 // |
| 2308 // Note: It is important this notification occur before DidStopLoading so the | 2311 // Note: It is important this notification occur before DidStopLoading so the |
| 2309 // SSL manager can react to the provisional load failure before being | 2312 // SSL manager can react to the provisional load failure before being |
| 2310 // notified the load stopped. | 2313 // notified the load stopped. |
| (...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4183 const webkit_glue::CustomContextMenuContext& custom_context) { | 4186 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4184 if (custom_context.is_pepper_menu) | 4187 if (custom_context.is_pepper_menu) |
| 4185 pepper_delegate_.OnContextMenuClosed(custom_context); | 4188 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4186 else | 4189 else |
| 4187 context_menu_node_.reset(); | 4190 context_menu_node_.reset(); |
| 4188 } | 4191 } |
| 4189 | 4192 |
| 4190 void RenderView::OnNetworkStateChanged(bool online) { | 4193 void RenderView::OnNetworkStateChanged(bool online) { |
| 4191 WebNetworkStateNotifier::setOnLine(online); | 4194 WebNetworkStateNotifier::setOnLine(online); |
| 4192 } | 4195 } |
| OLD | NEW |