Chromium Code Reviews| 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/browser/browser_url_handler.h" | 5 #include "content/browser/browser_url_handler.h" |
| 6 #include "content/browser/renderer_host/test_backing_store.h" | 6 #include "content/browser/renderer_host/test_backing_store.h" |
| 7 #include "content/browser/renderer_host/test_render_view_host.h" | 7 #include "content/browser/renderer_host/test_render_view_host.h" |
| 8 #include "content/browser/site_instance_impl.h" | 8 #include "content/browser/site_instance_impl.h" |
| 9 #include "content/browser/tab_contents/navigation_controller_impl.h" | 9 #include "content/browser/tab_contents/navigation_controller_impl.h" |
| 10 #include "content/browser/tab_contents/navigation_entry_impl.h" | 10 #include "content/browser/tab_contents/navigation_entry_impl.h" |
| 11 #include "content/browser/tab_contents/test_tab_contents.h" | 11 #include "content/browser/tab_contents/test_tab_contents.h" |
| 12 #include "content/common/dom_storage_common.h" | 12 #include "content/common/dom_storage_common.h" |
| 13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
| 14 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
| 15 #include "content/public/common/content_client.h" | 15 #include "content/public/common/content_client.h" |
| 16 #include "content/test/test_browser_context.h" | 16 #include "content/test/test_browser_context.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 #include "webkit/forms/password_form.h" | 18 #include "webkit/forms/password_form.h" |
| 19 #include "webkit/glue/webkit_glue.h" | 19 #include "webkit/glue/webkit_glue.h" |
| 20 #include "webkit/glue/webpreferences.h" | 20 #include "webkit/glue/webpreferences.h" |
| 21 | 21 |
| 22 #if defined(USE_AURA) | 22 #if defined(USE_AURA) |
| 23 #include "ui/aura/root_window.h" | 23 #include "ui/aura/root_window.h" |
| 24 #include "ui/aura/test/test_stacking_client.h" | 24 #include "ui/aura/test/test_stacking_client.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 using content::NavigationController; | 27 using content::NavigationController; |
| 28 using content::NavigationEntry; | 28 using content::NavigationEntry; |
| 29 using content::RenderViewHostDelegate; | 29 using content::RenderViewHostDelegate; |
| 30 using content::RenderWidgetHost; | |
| 30 using content::SessionStorageNamespace; | 31 using content::SessionStorageNamespace; |
| 31 using content::SiteInstance; | 32 using content::SiteInstance; |
| 33 using content::TestRenderViewHost; | |
| 32 using webkit::forms::PasswordForm; | 34 using webkit::forms::PasswordForm; |
| 33 | 35 |
| 36 namespace content { | |
| 37 | |
| 34 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, | 38 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
| 35 int page_id, | 39 int page_id, |
| 36 const GURL& url, | 40 const GURL& url, |
| 37 content::PageTransition transition) { | 41 content::PageTransition transition) { |
|
jam
2012/03/05 23:59:28
ditto
Jói
2012/03/06 16:38:55
Done.
| |
| 38 params->page_id = page_id; | 42 params->page_id = page_id; |
| 39 params->url = url; | 43 params->url = url; |
| 40 params->referrer = content::Referrer(); | 44 params->referrer = content::Referrer(); |
| 41 params->transition = transition; | 45 params->transition = transition; |
| 42 params->redirects = std::vector<GURL>(); | 46 params->redirects = std::vector<GURL>(); |
| 43 params->should_update_history = false; | 47 params->should_update_history = false; |
| 44 params->searchable_form_url = GURL(); | 48 params->searchable_form_url = GURL(); |
| 45 params->searchable_form_encoding = std::string(); | 49 params->searchable_form_encoding = std::string(); |
| 46 params->password_form = PasswordForm(); | 50 params->password_form = PasswordForm(); |
| 47 params->security_info = std::string(); | 51 params->security_info = std::string(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 } | 157 } |
| 154 | 158 |
| 155 void TestRenderViewHost::set_simulate_fetch_via_proxy(bool proxy) { | 159 void TestRenderViewHost::set_simulate_fetch_via_proxy(bool proxy) { |
| 156 simulate_fetch_via_proxy_ = proxy; | 160 simulate_fetch_via_proxy_ = proxy; |
| 157 } | 161 } |
| 158 | 162 |
| 159 void TestRenderViewHost::set_contents_mime_type(const std::string& mime_type) { | 163 void TestRenderViewHost::set_contents_mime_type(const std::string& mime_type) { |
| 160 contents_mime_type_ = mime_type; | 164 contents_mime_type_ = mime_type; |
| 161 } | 165 } |
| 162 | 166 |
| 163 namespace content { | |
| 164 | |
| 165 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) | 167 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) |
| 166 : rwh_(RenderWidgetHostImpl::From(rwh)), | 168 : rwh_(RenderWidgetHostImpl::From(rwh)), |
| 167 is_showing_(false) { | 169 is_showing_(false) { |
| 168 } | 170 } |
| 169 | 171 |
| 170 TestRenderWidgetHostView::~TestRenderWidgetHostView() { | 172 TestRenderWidgetHostView::~TestRenderWidgetHostView() { |
| 171 } | 173 } |
| 172 | 174 |
| 173 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { | 175 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { |
| 174 return NULL; | 176 return NULL; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 | 326 |
| 325 TestRenderViewHostFactory::~TestRenderViewHostFactory() { | 327 TestRenderViewHostFactory::~TestRenderViewHostFactory() { |
| 326 RenderViewHostFactory::UnregisterFactory(); | 328 RenderViewHostFactory::UnregisterFactory(); |
| 327 } | 329 } |
| 328 | 330 |
| 329 void TestRenderViewHostFactory::set_render_process_host_factory( | 331 void TestRenderViewHostFactory::set_render_process_host_factory( |
| 330 content::RenderProcessHostFactory* rph_factory) { | 332 content::RenderProcessHostFactory* rph_factory) { |
| 331 render_process_host_factory_ = rph_factory; | 333 render_process_host_factory_ = rph_factory; |
| 332 } | 334 } |
| 333 | 335 |
| 334 RenderViewHost* TestRenderViewHostFactory::CreateRenderViewHost( | 336 content::RenderViewHost* TestRenderViewHostFactory::CreateRenderViewHost( |
| 335 SiteInstance* instance, | 337 SiteInstance* instance, |
| 336 RenderViewHostDelegate* delegate, | 338 RenderViewHostDelegate* delegate, |
| 337 int routing_id, | 339 int routing_id, |
| 338 SessionStorageNamespace* session_storage) { | 340 SessionStorageNamespace* session_storage) { |
| 339 // See declaration of render_process_host_factory_ below. | 341 // See declaration of render_process_host_factory_ below. |
| 340 static_cast<SiteInstanceImpl*>(instance)-> | 342 static_cast<SiteInstanceImpl*>(instance)-> |
| 341 set_render_process_host_factory(render_process_host_factory_); | 343 set_render_process_host_factory(render_process_host_factory_); |
| 342 return new TestRenderViewHost(instance, delegate, routing_id); | 344 return new TestRenderViewHost(instance, delegate, routing_id); |
| 343 } | 345 } |
| 344 | 346 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 #endif | 431 #endif |
| 430 | 432 |
| 431 // Make sure that we flush any messages related to TabContents destruction | 433 // Make sure that we flush any messages related to TabContents destruction |
| 432 // before we destroy the browser context. | 434 // before we destroy the browser context. |
| 433 MessageLoop::current()->RunAllPending(); | 435 MessageLoop::current()->RunAllPending(); |
| 434 | 436 |
| 435 // Release the browser context on the UI thread. | 437 // Release the browser context on the UI thread. |
| 436 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 438 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
| 437 message_loop_.RunAllPending(); | 439 message_loop_.RunAllPending(); |
| 438 } | 440 } |
| OLD | NEW |