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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 TestRenderFrameHost* TestWebContents::GetMainFrame() { | 48 TestRenderFrameHost* TestWebContents::GetMainFrame() { |
49 return static_cast<TestRenderFrameHost*>(WebContentsImpl::GetMainFrame()); | 49 return static_cast<TestRenderFrameHost*>(WebContentsImpl::GetMainFrame()); |
50 } | 50 } |
51 | 51 |
52 TestRenderViewHost* TestWebContents::GetRenderViewHost() const { | 52 TestRenderViewHost* TestWebContents::GetRenderViewHost() const { |
53 return static_cast<TestRenderViewHost*>( | 53 return static_cast<TestRenderViewHost*>( |
54 WebContentsImpl::GetRenderViewHost()); | 54 WebContentsImpl::GetRenderViewHost()); |
55 } | 55 } |
56 | 56 |
57 TestRenderFrameHost* TestWebContents::GetPendingMainFrame() const { | 57 TestRenderFrameHost* TestWebContents::GetPendingMainFrame() const { |
| 58 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 59 switches::kEnableBrowserSideNavigation)) { |
| 60 return static_cast<TestRenderFrameHost*>( |
| 61 GetRenderManager()->speculative_render_frame_host_.get()); |
| 62 } |
58 return static_cast<TestRenderFrameHost*>( | 63 return static_cast<TestRenderFrameHost*>( |
59 GetRenderManager()->pending_frame_host()); | 64 GetRenderManager()->pending_frame_host()); |
60 } | 65 } |
61 | 66 |
62 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host, | 67 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host, |
63 int page_id, | 68 int page_id, |
64 const GURL& url, | 69 const GURL& url, |
65 ui::PageTransition transition) { | 70 ui::PageTransition transition) { |
66 TestDidNavigateWithReferrer(render_frame_host, | 71 TestDidNavigateWithReferrer(render_frame_host, |
67 page_id, | 72 page_id, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 256 } |
252 | 257 |
253 void TestWebContents::ShowCreatedWidget(int route_id, | 258 void TestWebContents::ShowCreatedWidget(int route_id, |
254 const gfx::Rect& initial_pos) { | 259 const gfx::Rect& initial_pos) { |
255 } | 260 } |
256 | 261 |
257 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 262 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
258 } | 263 } |
259 | 264 |
260 } // namespace content | 265 } // namespace content |
OLD | NEW |