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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2398 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) | 2398 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) |
2399 OnDidStartLoading(true); | 2399 OnDidStartLoading(true); |
2400 } | 2400 } |
2401 | 2401 |
2402 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { | 2402 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
2403 DCHECK(data_url.SchemeIs(url::kDataScheme)); | 2403 DCHECK(data_url.SchemeIs(url::kDataScheme)); |
2404 CommonNavigationParams common_params( | 2404 CommonNavigationParams common_params( |
2405 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, | 2405 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, |
2406 FrameMsg_Navigate_Type::NORMAL, NavigationGestureAuto, false, false, | 2406 FrameMsg_Navigate_Type::NORMAL, NavigationGestureAuto, false, false, |
2407 base::TimeTicks::Now(), FrameMsg_UILoadMetricsReportType::NO_REPORT, | 2407 base::TimeTicks::Now(), FrameMsg_UILoadMetricsReportType::NO_REPORT, |
2408 GURL(), GURL(), LOFI_OFF, base::TimeTicks::Now(), "GET", nullptr); | 2408 GURL(), GURL(), PREVIEWS_OFF, base::TimeTicks::Now(), "GET", nullptr); |
2409 if (IsBrowserSideNavigationEnabled()) { | 2409 if (IsBrowserSideNavigationEnabled()) { |
2410 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), | 2410 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), |
2411 false); | 2411 false); |
2412 } else { | 2412 } else { |
2413 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); | 2413 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
2414 } | 2414 } |
2415 } | 2415 } |
2416 | 2416 |
2417 void RenderFrameHostImpl::Stop() { | 2417 void RenderFrameHostImpl::Stop() { |
2418 Send(new FrameMsg_Stop(routing_id_)); | 2418 Send(new FrameMsg_Stop(routing_id_)); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 DCHECK(!GetParent()); | 2581 DCHECK(!GetParent()); |
2582 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); | 2582 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); |
2583 } | 2583 } |
2584 | 2584 |
2585 const GURL body_url = body.get() ? body->GetURL() : GURL(); | 2585 const GURL body_url = body.get() ? body->GetURL() : GURL(); |
2586 const ResourceResponseHead head = response ? | 2586 const ResourceResponseHead head = response ? |
2587 response->head : ResourceResponseHead(); | 2587 response->head : ResourceResponseHead(); |
2588 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, | 2588 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, |
2589 request_params)); | 2589 request_params)); |
2590 | 2590 |
2591 // If a network request was made, update the LoFi state. | 2591 // If a network request was made, update the Previews state. |
2592 if (ShouldMakeNetworkRequestForURL(common_params.url)) | 2592 if (ShouldMakeNetworkRequestForURL(common_params.url)) |
2593 last_navigation_lofi_state_ = common_params.lofi_state; | 2593 last_navigation_previews_state_ = common_params.previews_state; |
2594 | 2594 |
2595 // TODO(clamy): Release the stream handle once the renderer has finished | 2595 // TODO(clamy): Release the stream handle once the renderer has finished |
2596 // reading it. | 2596 // reading it. |
2597 stream_handle_ = std::move(body); | 2597 stream_handle_ = std::move(body); |
2598 | 2598 |
2599 // When navigating to a debug url, no commit is expected from the | 2599 // When navigating to a debug url, no commit is expected from the |
2600 // RenderFrameHost, nor should the throbber start. The NavigationRequest is | 2600 // RenderFrameHost, nor should the throbber start. The NavigationRequest is |
2601 // also not stored in the FrameTreeNode. Therefore do not reset it, as this | 2601 // also not stored in the FrameTreeNode. Therefore do not reset it, as this |
2602 // could cancel an existing pending navigation. | 2602 // could cancel an existing pending navigation. |
2603 if (!IsRendererDebugURL(common_params.url)) { | 2603 if (!IsRendererDebugURL(common_params.url)) { |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3328 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3328 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3329 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3329 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3330 return NavigationHandleImpl::Create( | 3330 return NavigationHandleImpl::Create( |
3331 params.url, frame_tree_node_, is_renderer_initiated, | 3331 params.url, frame_tree_node_, is_renderer_initiated, |
3332 params.was_within_same_page, base::TimeTicks::Now(), | 3332 params.was_within_same_page, base::TimeTicks::Now(), |
3333 entry_id_for_data_nav, params.gesture, | 3333 entry_id_for_data_nav, params.gesture, |
3334 false); // started_from_context_menu | 3334 false); // started_from_context_menu |
3335 } | 3335 } |
3336 | 3336 |
3337 } // namespace content | 3337 } // namespace content |
OLD | NEW |