| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell/browser/layout_test/layout_test_content_browser_client.h
" | 5 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_context.h" | 7 #include "content/public/browser/browser_context.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/navigator_connect_context.h" | 9 #include "content/public/browser/navigator_connect_context.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 11 #include "content/public/browser/resource_dispatcher_host.h" | 11 #include "content/public/browser/resource_dispatcher_host.h" |
| 12 #include "content/public/browser/storage_partition.h" | 12 #include "content/public/browser/storage_partition.h" |
| 13 #include "content/public/common/service_registry.h" |
| 13 #include "content/shell/browser/layout_test/blink_test_controller.h" | 14 #include "content/shell/browser/layout_test/blink_test_controller.h" |
| 15 #include "content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_s
etter_impl.h" |
| 14 #include "content/shell/browser/layout_test/layout_test_browser_context.h" | 16 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| 15 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" | 17 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" |
| 16 #include "content/shell/browser/layout_test/layout_test_message_filter.h" | 18 #include "content/shell/browser/layout_test/layout_test_message_filter.h" |
| 17 #include "content/shell/browser/layout_test/layout_test_navigator_connect_servic
e_factory.h" | 19 #include "content/shell/browser/layout_test/layout_test_navigator_connect_servic
e_factory.h" |
| 18 #include "content/shell/browser/layout_test/layout_test_notification_manager.h" | 20 #include "content/shell/browser/layout_test/layout_test_notification_manager.h" |
| 19 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" | 21 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" |
| 20 #include "content/shell/browser/shell_browser_context.h" | 22 #include "content/shell/browser/shell_browser_context.h" |
| 21 #include "content/shell/common/layout_test/layout_test_switches.h" | 23 #include "content/shell/common/layout_test/layout_test_switches.h" |
| 22 #include "content/shell/common/shell_messages.h" | 24 #include "content/shell/common/shell_messages.h" |
| 23 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 25 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ShellContentBrowserClient::RenderProcessWillLaunch(host); | 62 ShellContentBrowserClient::RenderProcessWillLaunch(host); |
| 61 | 63 |
| 62 StoragePartition* partition = | 64 StoragePartition* partition = |
| 63 BrowserContext::GetDefaultStoragePartition(browser_context()); | 65 BrowserContext::GetDefaultStoragePartition(browser_context()); |
| 64 host->AddFilter(new LayoutTestMessageFilter( | 66 host->AddFilter(new LayoutTestMessageFilter( |
| 65 host->GetID(), | 67 host->GetID(), |
| 66 partition->GetDatabaseTracker(), | 68 partition->GetDatabaseTracker(), |
| 67 partition->GetQuotaManager(), | 69 partition->GetQuotaManager(), |
| 68 partition->GetURLRequestContext())); | 70 partition->GetURLRequestContext())); |
| 69 | 71 |
| 72 host->GetServiceRegistry()->AddService(base::Bind( |
| 73 &LayoutTestBluetoothFakeAdapterSetterImpl::Create, host->GetID())); |
| 74 |
| 70 host->Send(new ShellViewMsg_SetWebKitSourceDir(GetWebKitRootDirFilePath())); | 75 host->Send(new ShellViewMsg_SetWebKitSourceDir(GetWebKitRootDirFilePath())); |
| 71 } | 76 } |
| 72 | 77 |
| 73 void LayoutTestContentBrowserClient::OverrideWebkitPrefs( | 78 void LayoutTestContentBrowserClient::OverrideWebkitPrefs( |
| 74 RenderViewHost* render_view_host, | 79 RenderViewHost* render_view_host, |
| 75 WebPreferences* prefs) { | 80 WebPreferences* prefs) { |
| 76 BlinkTestController::Get()->OverrideWebkitPrefs(prefs); | 81 BlinkTestController::Get()->OverrideWebkitPrefs(prefs); |
| 77 } | 82 } |
| 78 | 83 |
| 79 void LayoutTestContentBrowserClient::ResourceDispatcherHostCreated() { | 84 void LayoutTestContentBrowserClient::ResourceDispatcherHostCreated() { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return layout_test_notification_manager_.get(); | 126 return layout_test_notification_manager_.get(); |
| 122 } | 127 } |
| 123 | 128 |
| 124 void LayoutTestContentBrowserClient::GetAdditionalNavigatorConnectServices( | 129 void LayoutTestContentBrowserClient::GetAdditionalNavigatorConnectServices( |
| 125 const scoped_refptr<NavigatorConnectContext>& context) { | 130 const scoped_refptr<NavigatorConnectContext>& context) { |
| 126 context->AddFactory( | 131 context->AddFactory( |
| 127 make_scoped_ptr(new LayoutTestNavigatorConnectServiceFactory)); | 132 make_scoped_ptr(new LayoutTestNavigatorConnectServiceFactory)); |
| 128 } | 133 } |
| 129 | 134 |
| 130 } // namespace content | 135 } // namespace content |
| OLD | NEW |