OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_web_contents.h" | 5 #include "content/test/test_web_contents.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "content/browser/browser_url_handler_impl.h" | 10 #include "content/browser/browser_url_handler_impl.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 params.gesture = NavigationGestureUser; | 104 params.gesture = NavigationGestureUser; |
105 params.was_within_same_page = false; | 105 params.was_within_same_page = false; |
106 params.is_post = false; | 106 params.is_post = false; |
107 params.page_state = PageState::CreateFromURL(url); | 107 params.page_state = PageState::CreateFromURL(url); |
108 | 108 |
109 RenderFrameHostImpl* rfhi = | 109 RenderFrameHostImpl* rfhi = |
110 static_cast<RenderFrameHostImpl*>(render_frame_host); | 110 static_cast<RenderFrameHostImpl*>(render_frame_host); |
111 rfhi->frame_tree_node()->navigator()->DidNavigate(rfhi, params); | 111 rfhi->frame_tree_node()->navigator()->DidNavigate(rfhi, params); |
112 } | 112 } |
113 | 113 |
| 114 const std::string& TestWebContents::GetSaveFrameHeaders() { |
| 115 return save_frame_headers_; |
| 116 } |
| 117 |
114 bool TestWebContents::CrossProcessNavigationPending() { | 118 bool TestWebContents::CrossProcessNavigationPending() { |
115 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 119 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
116 switches::kEnableBrowserSideNavigation)) { | 120 switches::kEnableBrowserSideNavigation)) { |
117 return GetRenderManager()->speculative_render_frame_host_ && | 121 return GetRenderManager()->speculative_render_frame_host_ && |
118 static_cast<TestRenderFrameHost*>( | 122 static_cast<TestRenderFrameHost*>( |
119 GetRenderManager()->speculative_render_frame_host_.get()) | 123 GetRenderManager()->speculative_render_frame_host_.get()) |
120 ->pending_commit(); | 124 ->pending_commit(); |
121 } | 125 } |
122 return GetRenderManager()->pending_frame_host() != nullptr; | 126 return GetRenderManager()->pending_frame_host() != nullptr; |
123 } | 127 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 bool user_gesture) { | 282 bool user_gesture) { |
279 } | 283 } |
280 | 284 |
281 void TestWebContents::ShowCreatedWidget(int route_id, | 285 void TestWebContents::ShowCreatedWidget(int route_id, |
282 const gfx::Rect& initial_rect) { | 286 const gfx::Rect& initial_rect) { |
283 } | 287 } |
284 | 288 |
285 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 289 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
286 } | 290 } |
287 | 291 |
| 292 void TestWebContents::SaveFrameWithHeaders(const GURL& url, |
| 293 const Referrer& referrer, |
| 294 const std::string& headers) { |
| 295 save_frame_headers_ = headers; |
| 296 } |
| 297 |
288 } // namespace content | 298 } // namespace content |
OLD | NEW |