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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( | 325 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( |
326 const GURL& url, | 326 const GURL& url, |
327 bool has_user_gesture) { | 327 bool has_user_gesture) { |
328 // Since this is renderer-initiated navigation, the RenderFrame must be | 328 // Since this is renderer-initiated navigation, the RenderFrame must be |
329 // initialized. Do it if it hasn't happened yet. | 329 // initialized. Do it if it hasn't happened yet. |
330 InitializeRenderFrameIfNeeded(); | 330 InitializeRenderFrameIfNeeded(); |
331 | 331 |
332 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 332 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
333 switches::kEnableBrowserSideNavigation)) { | 333 switches::kEnableBrowserSideNavigation)) { |
334 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, | 334 BeginNavigationParams begin_params( |
335 has_user_gesture); | 335 "GET", std::string(), net::LOAD_NORMAL, has_user_gesture, false, |
| 336 REQUEST_CONTEXT_TYPE_HYPERLINK); |
336 CommonNavigationParams common_params; | 337 CommonNavigationParams common_params; |
337 common_params.url = url; | 338 common_params.url = url; |
338 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 339 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
339 common_params.transition = ui::PAGE_TRANSITION_LINK; | 340 common_params.transition = ui::PAGE_TRANSITION_LINK; |
340 OnBeginNavigation(common_params, begin_params, | 341 OnBeginNavigation(common_params, begin_params, |
341 scoped_refptr<ResourceRequestBody>()); | 342 scoped_refptr<ResourceRequestBody>()); |
342 } | 343 } |
343 } | 344 } |
344 | 345 |
345 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { | 346 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // cleared during DidFailProvisionalLoad). | 396 // cleared during DidFailProvisionalLoad). |
396 int page_id = entry ? entry->GetPageID() : -1; | 397 int page_id = entry ? entry->GetPageID() : -1; |
397 if (page_id == -1) { | 398 if (page_id == -1) { |
398 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 399 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
399 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 400 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
400 } | 401 } |
401 return page_id; | 402 return page_id; |
402 } | 403 } |
403 | 404 |
404 } // namespace content | 405 } // namespace content |
OLD | NEW |