Chromium Code Reviews| 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/guid.h" | 7 #include "base/guid.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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 } | 356 } |
| 357 | 357 |
| 358 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( | 358 void TestRenderFrameHost::SendRendererInitiatedNavigationRequest( |
| 359 const GURL& url, | 359 const GURL& url, |
| 360 bool has_user_gesture) { | 360 bool has_user_gesture) { |
| 361 // Since this is renderer-initiated navigation, the RenderFrame must be | 361 // Since this is renderer-initiated navigation, the RenderFrame must be |
| 362 // initialized. Do it if it hasn't happened yet. | 362 // initialized. Do it if it hasn't happened yet. |
| 363 InitializeRenderFrameIfNeeded(); | 363 InitializeRenderFrameIfNeeded(); |
| 364 | 364 |
| 365 if (IsBrowserSideNavigationEnabled()) { | 365 if (IsBrowserSideNavigationEnabled()) { |
| 366 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, | 366 BeginNavigationParams begin_params( |
| 367 has_user_gesture, false, | 367 std::string(), net::LOAD_NORMAL, has_user_gesture, false, |
| 368 REQUEST_CONTEXT_TYPE_HYPERLINK); | 368 REQUEST_CONTEXT_TYPE_HYPERLINK, url::Origin(url)); |
|
Mike West
2016/06/27 12:10:08
Can you change this to a unique origin (`url::Orig
clamy
2016/06/27 13:36:15
Done.
| |
| 369 CommonNavigationParams common_params; | 369 CommonNavigationParams common_params; |
| 370 common_params.url = url; | 370 common_params.url = url; |
| 371 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 371 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
| 372 common_params.transition = ui::PAGE_TRANSITION_LINK; | 372 common_params.transition = ui::PAGE_TRANSITION_LINK; |
| 373 OnBeginNavigation(common_params, begin_params); | 373 OnBeginNavigation(common_params, begin_params); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { | 377 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { |
| 378 OnDidChangeOpener(opener_routing_id); | 378 OnDidChangeOpener(opener_routing_id); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 // cleared during DidFailProvisionalLoad). | 433 // cleared during DidFailProvisionalLoad). |
| 434 int page_id = entry ? entry->GetPageID() : -1; | 434 int page_id = entry ? entry->GetPageID() : -1; |
| 435 if (page_id == -1) { | 435 if (page_id == -1) { |
| 436 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 436 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
| 437 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 437 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
| 438 } | 438 } |
| 439 return page_id; | 439 return page_id; |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace content | 442 } // namespace content |
| OLD | NEW |