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