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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 TestRenderFrameHost* TestWebContents::GetPendingMainFrame() const { | 57 TestRenderFrameHost* TestWebContents::GetPendingMainFrame() const { |
58 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 58 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
59 switches::kEnableBrowserSideNavigation)) { | 59 switches::kEnableBrowserSideNavigation)) { |
60 return static_cast<TestRenderFrameHost*>( | 60 return static_cast<TestRenderFrameHost*>( |
61 GetRenderManager()->speculative_render_frame_host_.get()); | 61 GetRenderManager()->speculative_render_frame_host_.get()); |
62 } | 62 } |
63 return static_cast<TestRenderFrameHost*>( | 63 return static_cast<TestRenderFrameHost*>( |
64 GetRenderManager()->pending_frame_host()); | 64 GetRenderManager()->pending_frame_host()); |
65 } | 65 } |
66 | 66 |
| 67 int TestWebContents::DownloadImage(const GURL& url, |
| 68 bool is_favicon, |
| 69 uint32_t max_bitmap_size, |
| 70 bool bypass_cache, |
| 71 const ImageDownloadCallback& callback) { |
| 72 static int g_next_image_download_id = 0; |
| 73 return ++g_next_image_download_id; |
| 74 } |
| 75 |
67 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host, | 76 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host, |
68 int page_id, | 77 int page_id, |
69 int nav_entry_id, | 78 int nav_entry_id, |
70 bool did_create_new_entry, | 79 bool did_create_new_entry, |
71 const GURL& url, | 80 const GURL& url, |
72 ui::PageTransition transition) { | 81 ui::PageTransition transition) { |
73 TestDidNavigateWithReferrer(render_frame_host, | 82 TestDidNavigateWithReferrer(render_frame_host, |
74 page_id, | 83 page_id, |
75 nav_entry_id, | 84 nav_entry_id, |
76 did_create_new_entry, | 85 did_create_new_entry, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 298 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
290 } | 299 } |
291 | 300 |
292 void TestWebContents::SaveFrameWithHeaders(const GURL& url, | 301 void TestWebContents::SaveFrameWithHeaders(const GURL& url, |
293 const Referrer& referrer, | 302 const Referrer& referrer, |
294 const std::string& headers) { | 303 const std::string& headers) { |
295 save_frame_headers_ = headers; | 304 save_frame_headers_ = headers; |
296 } | 305 } |
297 | 306 |
298 } // namespace content | 307 } // namespace content |
OLD | NEW |