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/test/test_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( | 330 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( |
331 const GURL& url, | 331 const GURL& url, |
332 bool has_user_gesture) { | 332 bool has_user_gesture) { |
333 // Since this is renderer-initiated navigation, the RenderFrame must be | 333 // Since this is renderer-initiated navigation, the RenderFrame must be |
334 // initialized. Do it if it hasn't happened yet. | 334 // initialized. Do it if it hasn't happened yet. |
335 InitializeRenderFrameIfNeeded(); | 335 InitializeRenderFrameIfNeeded(); |
336 | 336 |
337 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 337 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
338 switches::kEnableBrowserSideNavigation)) { | 338 switches::kEnableBrowserSideNavigation)) { |
339 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, | 339 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, |
340 has_user_gesture); | 340 has_user_gesture, false, |
| 341 REQUEST_CONTEXT_TYPE_HYPERLINK); |
341 CommonNavigationParams common_params; | 342 CommonNavigationParams common_params; |
342 common_params.url = url; | 343 common_params.url = url; |
343 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 344 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
344 common_params.transition = ui::PAGE_TRANSITION_LINK; | 345 common_params.transition = ui::PAGE_TRANSITION_LINK; |
345 OnBeginNavigation(common_params, begin_params, | 346 OnBeginNavigation(common_params, begin_params, |
346 scoped_refptr<ResourceRequestBody>()); | 347 scoped_refptr<ResourceRequestBody>()); |
347 } | 348 } |
348 } | 349 } |
349 | 350 |
350 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { | 351 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // cleared during DidFailProvisionalLoad). | 403 // cleared during DidFailProvisionalLoad). |
403 int page_id = entry ? entry->GetPageID() : -1; | 404 int page_id = entry ? entry->GetPageID() : -1; |
404 if (page_id == -1) { | 405 if (page_id == -1) { |
405 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 406 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
406 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 407 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
407 } | 408 } |
408 return page_id; | 409 return page_id; |
409 } | 410 } |
410 | 411 |
411 } // namespace content | 412 } // namespace content |
OLD | NEW |