Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "content/test/test_render_frame.h" |
| 6 | 6 |
| 7 #include "content/common/navigation_params.h" | 7 #include "content/common/navigation_params.h" |
| 8 #include "content/common/resource_request_body_impl.h" | 8 #include "content/common/resource_request_body_impl.h" |
| 9 #include "content/public/common/browser_side_navigation_policy.h" | 9 #include "content/public/common/browser_side_navigation_policy.h" |
| 10 #include "content/public/common/resource_response.h" | 10 #include "content/public/common/resource_response.h" |
| 11 #include "third_party/WebKit/public/web/WebLocalFrame.h" | |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame( | 16 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame( |
| 16 const RenderFrameImpl::CreateParams& params) { | 17 const RenderFrameImpl::CreateParams& params) { |
| 17 return new TestRenderFrame(params); | 18 return new TestRenderFrame(params); |
| 18 } | 19 } |
| 19 | 20 |
| 20 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params) | 21 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 OnSetAccessibilityMode(new_mode); | 64 OnSetAccessibilityMode(new_mode); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void TestRenderFrame::SetCompositionFromExistingText( | 67 void TestRenderFrame::SetCompositionFromExistingText( |
| 67 int start, | 68 int start, |
| 68 int end, | 69 int end, |
| 69 const std::vector<blink::WebCompositionUnderline>& underlines) { | 70 const std::vector<blink::WebCompositionUnderline>& underlines) { |
| 70 OnSetCompositionFromExistingText(start, end, underlines); | 71 OnSetCompositionFromExistingText(start, end, underlines); |
| 71 } | 72 } |
| 72 | 73 |
| 74 blink::WebNavigationPolicy TestRenderFrame::decidePolicyForNavigation( | |
| 75 const blink::WebFrameClient::NavigationPolicyInfo& info) { | |
| 76 if (IsBrowserSideNavigationEnabled() && | |
| 77 info.urlRequest.checkForBrowserSideNavigation() && | |
| 78 GetWebFrame()->parent() && | |
| 79 info.form.isNull()) { | |
| 80 // RenderViewTest::LoadHTML already disables PlzNavigate for the main frame | |
| 81 // requests. However if the loaded html has a subframe, the WebURLRequest | |
| 82 // will be created inside Blink and it wono't have this flag set. | |
|
jam39
2016/12/08 16:19:01
won't *
| |
| 83 info.urlRequest.setCheckForBrowserSideNavigation(false); | |
| 84 } | |
| 85 return RenderFrameImpl::decidePolicyForNavigation(info); | |
| 86 } | |
| 87 | |
| 73 } // namespace content | 88 } // namespace content |
| OLD | NEW |