OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 pending_commit_(false), | 328 pending_commit_(false), |
329 nav_entry_id_(0), | 329 nav_entry_id_(0), |
330 accessibility_reset_token_(0), | 330 accessibility_reset_token_(0), |
331 accessibility_reset_count_(0), | 331 accessibility_reset_count_(0), |
332 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), | 332 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), |
333 no_create_browser_accessibility_manager_for_testing_(false), | 333 no_create_browser_accessibility_manager_for_testing_(false), |
334 web_ui_type_(WebUI::kNoWebUI), | 334 web_ui_type_(WebUI::kNoWebUI), |
335 pending_web_ui_type_(WebUI::kNoWebUI), | 335 pending_web_ui_type_(WebUI::kNoWebUI), |
336 should_reuse_web_ui_(false), | 336 should_reuse_web_ui_(false), |
337 has_selection_(false), | 337 has_selection_(false), |
338 last_navigation_lofi_state_(LOFI_UNSPECIFIED), | 338 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED), |
339 frame_host_binding_(this), | 339 frame_host_binding_(this), |
340 waiting_for_init_(renderer_initiated_creation), | 340 waiting_for_init_(renderer_initiated_creation), |
341 has_focused_editable_element_(false), | 341 has_focused_editable_element_(false), |
342 weak_ptr_factory_(this) { | 342 weak_ptr_factory_(this) { |
343 frame_tree_->AddRenderViewHostRef(render_view_host_); | 343 frame_tree_->AddRenderViewHostRef(render_view_host_); |
344 GetProcess()->AddRoute(routing_id_, this); | 344 GetProcess()->AddRoute(routing_id_, this); |
345 g_routing_id_frame_map.Get().insert(std::make_pair( | 345 g_routing_id_frame_map.Get().insert(std::make_pair( |
346 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 346 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
347 this)); | 347 this)); |
348 site_instance_->AddObserver(this); | 348 site_instance_->AddObserver(this); |
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 // done here either. | 2441 // done here either. |
2442 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) | 2442 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) |
2443 OnDidStartLoading(true); | 2443 OnDidStartLoading(true); |
2444 } | 2444 } |
2445 | 2445 |
2446 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { | 2446 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
2447 DCHECK(data_url.SchemeIs(url::kDataScheme)); | 2447 DCHECK(data_url.SchemeIs(url::kDataScheme)); |
2448 CommonNavigationParams common_params( | 2448 CommonNavigationParams common_params( |
2449 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, | 2449 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, |
2450 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), | 2450 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), |
2451 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, | 2451 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), PREVIEWS_OFF, |
2452 base::TimeTicks::Now(), "GET", nullptr); | 2452 base::TimeTicks::Now(), "GET", nullptr); |
2453 if (IsBrowserSideNavigationEnabled()) { | 2453 if (IsBrowserSideNavigationEnabled()) { |
2454 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), | 2454 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), |
2455 false); | 2455 false); |
2456 } else { | 2456 } else { |
2457 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); | 2457 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
2458 } | 2458 } |
2459 } | 2459 } |
2460 | 2460 |
2461 void RenderFrameHostImpl::Stop() { | 2461 void RenderFrameHostImpl::Stop() { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2625 DCHECK(!GetParent()); | 2625 DCHECK(!GetParent()); |
2626 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); | 2626 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); |
2627 } | 2627 } |
2628 | 2628 |
2629 const GURL body_url = body.get() ? body->GetURL() : GURL(); | 2629 const GURL body_url = body.get() ? body->GetURL() : GURL(); |
2630 const ResourceResponseHead head = response ? | 2630 const ResourceResponseHead head = response ? |
2631 response->head : ResourceResponseHead(); | 2631 response->head : ResourceResponseHead(); |
2632 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, | 2632 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, |
2633 request_params)); | 2633 request_params)); |
2634 | 2634 |
2635 // If a network request was made, update the LoFi state. | 2635 // If a network request was made, update the Previews state. |
2636 if (ShouldMakeNetworkRequestForURL(common_params.url)) | 2636 if (ShouldMakeNetworkRequestForURL(common_params.url)) |
2637 last_navigation_lofi_state_ = common_params.lofi_state; | 2637 last_navigation_previews_state_ = common_params.previews_state; |
2638 | 2638 |
2639 // TODO(clamy): Release the stream handle once the renderer has finished | 2639 // TODO(clamy): Release the stream handle once the renderer has finished |
2640 // reading it. | 2640 // reading it. |
2641 stream_handle_ = std::move(body); | 2641 stream_handle_ = std::move(body); |
2642 | 2642 |
2643 // When navigating to a debug url, no commit is expected from the | 2643 // When navigating to a debug url, no commit is expected from the |
2644 // RenderFrameHost, nor should the throbber start. The NavigationRequest is | 2644 // RenderFrameHost, nor should the throbber start. The NavigationRequest is |
2645 // also not stored in the FrameTreeNode. Therefore do not reset it, as this | 2645 // also not stored in the FrameTreeNode. Therefore do not reset it, as this |
2646 // could cancel an existing pending navigation. | 2646 // could cancel an existing pending navigation. |
2647 if (!IsRendererDebugURL(common_params.url)) { | 2647 if (!IsRendererDebugURL(common_params.url)) { |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3384 // There is no pending NavigationEntry in these cases, so pass 0 as the |
3385 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3385 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3386 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3386 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3387 return NavigationHandleImpl::Create( | 3387 return NavigationHandleImpl::Create( |
3388 params.url, frame_tree_node_, is_renderer_initiated, | 3388 params.url, frame_tree_node_, is_renderer_initiated, |
3389 params.was_within_same_page, base::TimeTicks::Now(), | 3389 params.was_within_same_page, base::TimeTicks::Now(), |
3390 entry_id_for_data_nav, false); // started_from_context_menu | 3390 entry_id_for_data_nav, false); // started_from_context_menu |
3391 } | 3391 } |
3392 | 3392 |
3393 } // namespace content | 3393 } // namespace content |
OLD | NEW |