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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 pending_commit_(false), | 327 pending_commit_(false), |
328 nav_entry_id_(0), | 328 nav_entry_id_(0), |
329 accessibility_reset_token_(0), | 329 accessibility_reset_token_(0), |
330 accessibility_reset_count_(0), | 330 accessibility_reset_count_(0), |
331 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), | 331 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), |
332 no_create_browser_accessibility_manager_for_testing_(false), | 332 no_create_browser_accessibility_manager_for_testing_(false), |
333 web_ui_type_(WebUI::kNoWebUI), | 333 web_ui_type_(WebUI::kNoWebUI), |
334 pending_web_ui_type_(WebUI::kNoWebUI), | 334 pending_web_ui_type_(WebUI::kNoWebUI), |
335 should_reuse_web_ui_(false), | 335 should_reuse_web_ui_(false), |
336 has_selection_(false), | 336 has_selection_(false), |
337 last_navigation_lofi_state_(LOFI_UNSPECIFIED), | 337 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED), |
338 frame_host_binding_(this), | 338 frame_host_binding_(this), |
339 waiting_for_init_(renderer_initiated_creation), | 339 waiting_for_init_(renderer_initiated_creation), |
340 weak_ptr_factory_(this) { | 340 weak_ptr_factory_(this) { |
341 frame_tree_->AddRenderViewHostRef(render_view_host_); | 341 frame_tree_->AddRenderViewHostRef(render_view_host_); |
342 GetProcess()->AddRoute(routing_id_, this); | 342 GetProcess()->AddRoute(routing_id_, this); |
343 g_routing_id_frame_map.Get().insert(std::make_pair( | 343 g_routing_id_frame_map.Get().insert(std::make_pair( |
344 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 344 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
345 this)); | 345 this)); |
346 site_instance_->AddObserver(this); | 346 site_instance_->AddObserver(this); |
347 GetSiteInstance()->IncrementActiveFrameCount(); | 347 GetSiteInstance()->IncrementActiveFrameCount(); |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) | 2400 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) |
2401 OnDidStartLoading(true); | 2401 OnDidStartLoading(true); |
2402 } | 2402 } |
2403 | 2403 |
2404 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { | 2404 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
2405 DCHECK(data_url.SchemeIs(url::kDataScheme)); | 2405 DCHECK(data_url.SchemeIs(url::kDataScheme)); |
2406 CommonNavigationParams common_params( | 2406 CommonNavigationParams common_params( |
2407 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, | 2407 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, |
2408 FrameMsg_Navigate_Type::NORMAL, NavigationGestureAuto, false, false, | 2408 FrameMsg_Navigate_Type::NORMAL, NavigationGestureAuto, false, false, |
2409 base::TimeTicks::Now(), FrameMsg_UILoadMetricsReportType::NO_REPORT, | 2409 base::TimeTicks::Now(), FrameMsg_UILoadMetricsReportType::NO_REPORT, |
2410 GURL(), GURL(), LOFI_OFF, base::TimeTicks::Now(), "GET", nullptr); | 2410 GURL(), GURL(), PREVIEWS_OFF, base::TimeTicks::Now(), "GET", nullptr); |
2411 if (IsBrowserSideNavigationEnabled()) { | 2411 if (IsBrowserSideNavigationEnabled()) { |
2412 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), | 2412 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), |
2413 false); | 2413 false); |
2414 } else { | 2414 } else { |
2415 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); | 2415 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
2416 } | 2416 } |
2417 } | 2417 } |
2418 | 2418 |
2419 void RenderFrameHostImpl::Stop() { | 2419 void RenderFrameHostImpl::Stop() { |
2420 Send(new FrameMsg_Stop(routing_id_)); | 2420 Send(new FrameMsg_Stop(routing_id_)); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 DCHECK(!GetParent()); | 2583 DCHECK(!GetParent()); |
2584 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); | 2584 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); |
2585 } | 2585 } |
2586 | 2586 |
2587 const GURL body_url = body.get() ? body->GetURL() : GURL(); | 2587 const GURL body_url = body.get() ? body->GetURL() : GURL(); |
2588 const ResourceResponseHead head = response ? | 2588 const ResourceResponseHead head = response ? |
2589 response->head : ResourceResponseHead(); | 2589 response->head : ResourceResponseHead(); |
2590 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, | 2590 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, |
2591 request_params)); | 2591 request_params)); |
2592 | 2592 |
2593 // If a network request was made, update the LoFi state. | 2593 // If a network request was made, update the Previews state. |
2594 if (ShouldMakeNetworkRequestForURL(common_params.url)) | 2594 if (ShouldMakeNetworkRequestForURL(common_params.url)) |
2595 last_navigation_lofi_state_ = common_params.lofi_state; | 2595 last_navigation_previews_state_ = common_params.previews_state; |
2596 | 2596 |
2597 // TODO(clamy): Release the stream handle once the renderer has finished | 2597 // TODO(clamy): Release the stream handle once the renderer has finished |
2598 // reading it. | 2598 // reading it. |
2599 stream_handle_ = std::move(body); | 2599 stream_handle_ = std::move(body); |
2600 | 2600 |
2601 // When navigating to a debug url, no commit is expected from the | 2601 // When navigating to a debug url, no commit is expected from the |
2602 // RenderFrameHost, nor should the throbber start. The NavigationRequest is | 2602 // RenderFrameHost, nor should the throbber start. The NavigationRequest is |
2603 // also not stored in the FrameTreeNode. Therefore do not reset it, as this | 2603 // also not stored in the FrameTreeNode. Therefore do not reset it, as this |
2604 // could cancel an existing pending navigation. | 2604 // could cancel an existing pending navigation. |
2605 if (!IsRendererDebugURL(common_params.url)) { | 2605 if (!IsRendererDebugURL(common_params.url)) { |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3330 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3330 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3331 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3331 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3332 return NavigationHandleImpl::Create( | 3332 return NavigationHandleImpl::Create( |
3333 params.url, frame_tree_node_, is_renderer_initiated, | 3333 params.url, frame_tree_node_, is_renderer_initiated, |
3334 params.was_within_same_page, base::TimeTicks::Now(), | 3334 params.was_within_same_page, base::TimeTicks::Now(), |
3335 entry_id_for_data_nav, params.gesture, | 3335 entry_id_for_data_nav, params.gesture, |
3336 false); // started_from_context_menu | 3336 false); // started_from_context_menu |
3337 } | 3337 } |
3338 | 3338 |
3339 } // namespace content | 3339 } // namespace content |
OLD | NEW |