| 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 "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 11 #include "content/browser/frame_host/navigation_request.h" | 11 #include "content/browser/frame_host/navigation_request.h" |
| 12 #include "content/browser/frame_host/navigator.h" | 12 #include "content/browser/frame_host/navigator.h" |
| 13 #include "content/browser/frame_host/navigator_impl.h" | 13 #include "content/browser/frame_host/navigator_impl.h" |
| 14 #include "content/browser/frame_host/render_frame_host_delegate.h" | 14 #include "content/browser/frame_host/render_frame_host_delegate.h" |
| 15 #include "content/browser/web_contents/web_contents_impl.h" | 15 #include "content/browser/web_contents/web_contents_impl.h" |
| 16 #include "content/common/frame_messages.h" | 16 #include "content/common/frame_messages.h" |
| 17 #include "content/common/frame_owner_properties.h" | 17 #include "content/common/frame_owner_properties.h" |
| 18 #include "content/public/browser/navigation_throttle.h" | 18 #include "content/public/browser/navigation_throttle.h" |
| 19 #include "content/public/browser/stream_handle.h" | 19 #include "content/public/browser/stream_handle.h" |
| 20 #include "content/public/common/browser_side_navigation_policy.h" | 20 #include "content/public/common/browser_side_navigation_policy.h" |
| 21 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 22 #include "content/public/test/browser_side_navigation_test_utils.h" | 22 #include "content/public/test/browser_side_navigation_test_utils.h" |
| 23 #include "content/test/test_navigation_url_loader.h" | 23 #include "content/test/test_navigation_url_loader.h" |
| 24 #include "content/test/test_render_view_host.h" | 24 #include "content/test/test_render_view_host.h" |
| 25 #include "mojo/public/cpp/bindings/interface_request.h" | 25 #include "mojo/public/cpp/bindings/interface_request.h" |
| 26 #include "net/base/load_flags.h" | 26 #include "net/base/load_flags.h" |
| 27 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
| 27 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 28 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 28 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" | 29 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" |
| 29 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 30 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| 30 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 31 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
| 31 #include "ui/base/page_transition_types.h" | 32 #include "ui/base/page_transition_types.h" |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 34 | 35 |
| 35 TestRenderFrameHostCreationObserver::TestRenderFrameHostCreationObserver( | 36 TestRenderFrameHostCreationObserver::TestRenderFrameHostCreationObserver( |
| 36 WebContents* web_contents) | 37 WebContents* web_contents) |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 const GURL& url, | 406 const GURL& url, |
| 406 bool has_user_gesture) { | 407 bool has_user_gesture) { |
| 407 // Since this is renderer-initiated navigation, the RenderFrame must be | 408 // Since this is renderer-initiated navigation, the RenderFrame must be |
| 408 // initialized. Do it if it hasn't happened yet. | 409 // initialized. Do it if it hasn't happened yet. |
| 409 InitializeRenderFrameIfNeeded(); | 410 InitializeRenderFrameIfNeeded(); |
| 410 | 411 |
| 411 if (IsBrowserSideNavigationEnabled()) { | 412 if (IsBrowserSideNavigationEnabled()) { |
| 412 // TODO(mkwst): The initiator origin here is incorrect. | 413 // TODO(mkwst): The initiator origin here is incorrect. |
| 413 BeginNavigationParams begin_params( | 414 BeginNavigationParams begin_params( |
| 414 std::string(), net::LOAD_NORMAL, has_user_gesture, false, | 415 std::string(), net::LOAD_NORMAL, has_user_gesture, false, |
| 415 REQUEST_CONTEXT_TYPE_HYPERLINK, url::Origin()); | 416 REQUEST_CONTEXT_TYPE_HYPERLINK, |
| 417 blink::WebMixedContentContextType::Blockable, url::Origin()); |
| 416 CommonNavigationParams common_params; | 418 CommonNavigationParams common_params; |
| 417 common_params.url = url; | 419 common_params.url = url; |
| 418 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 420 common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
| 419 common_params.transition = ui::PAGE_TRANSITION_LINK; | 421 common_params.transition = ui::PAGE_TRANSITION_LINK; |
| 420 OnBeginNavigation(common_params, begin_params); | 422 OnBeginNavigation(common_params, begin_params); |
| 421 } | 423 } |
| 422 } | 424 } |
| 423 | 425 |
| 424 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { | 426 void TestRenderFrameHost::DidChangeOpener(int opener_routing_id) { |
| 425 OnDidChangeOpener(opener_routing_id); | 427 OnDidChangeOpener(opener_routing_id); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at | 505 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at |
| 504 // this point. | 506 // this point. |
| 505 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) | 507 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) |
| 506 return; | 508 return; |
| 507 navigation_handle()->CallWillStartRequestForTesting( | 509 navigation_handle()->CallWillStartRequestForTesting( |
| 508 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), | 510 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), |
| 509 true /* user_gesture */, transition, false /* is_external_protocol */); | 511 true /* user_gesture */, transition, false /* is_external_protocol */); |
| 510 } | 512 } |
| 511 | 513 |
| 512 } // namespace content | 514 } // namespace content |
| OLD | NEW |