| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "content/public/browser/client_certificate_delegate.h" | 13 #include "content/public/browser/client_certificate_delegate.h" |
| 14 #include "content/public/browser/page_navigator.h" | 14 #include "content/public/browser/page_navigator.h" |
| 15 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 16 #include "content/public/browser/resource_dispatcher_host.h" | 16 #include "content/public/browser/resource_dispatcher_host.h" |
| 17 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
| 18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 19 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 20 #include "content/public/common/web_preferences.h" | 20 #include "content/public/common/web_preferences.h" |
| 21 #include "content/shell/browser/blink_test_controller.h" |
| 21 #include "content/shell/browser/ipc_echo_message_filter.h" | 22 #include "content/shell/browser/ipc_echo_message_filter.h" |
| 22 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" | 23 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" |
| 23 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" | 24 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" |
| 24 #include "content/shell/browser/shell.h" | 25 #include "content/shell/browser/shell.h" |
| 25 #include "content/shell/browser/shell_access_token_store.h" | 26 #include "content/shell/browser/shell_access_token_store.h" |
| 26 #include "content/shell/browser/shell_browser_context.h" | 27 #include "content/shell/browser/shell_browser_context.h" |
| 27 #include "content/shell/browser/shell_browser_main_parts.h" | 28 #include "content/shell/browser/shell_browser_main_parts.h" |
| 28 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 29 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
| 29 #include "content/shell/browser/shell_net_log.h" | 30 #include "content/shell/browser/shell_net_log.h" |
| 30 #include "content/shell/browser/shell_quota_permission_context.h" | 31 #include "content/shell/browser/shell_quota_permission_context.h" |
| 31 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" | 32 #include "content/shell/browser/shell_resource_dispatcher_host_delegate.h" |
| 32 #include "content/shell/browser/shell_web_contents_view_delegate_creator.h" | 33 #include "content/shell/browser/shell_web_contents_view_delegate_creator.h" |
| 33 #include "content/shell/browser/webkit_test_controller.h" | |
| 34 #include "content/shell/common/shell_messages.h" | 34 #include "content/shell/common/shell_messages.h" |
| 35 #include "content/shell/common/shell_switches.h" | 35 #include "content/shell/common/shell_switches.h" |
| 36 #include "content/shell/common/webkit_test_helpers.h" | 36 #include "content/shell/common/webkit_test_helpers.h" |
| 37 #include "gin/v8_initializer.h" | 37 #include "gin/v8_initializer.h" |
| 38 #include "net/url_request/url_request_context_getter.h" | 38 #include "net/url_request/url_request_context_getter.h" |
| 39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
| 40 | 40 |
| 41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
| 42 #include "base/android/path_utils.h" | 42 #include "base/android/path_utils.h" |
| 43 #include "components/crash/browser/crash_dump_manager_android.h" | 43 #include "components/crash/browser/crash_dump_manager_android.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 switches::kRegisterFontFiles)); | 261 switches::kRegisterFontFiles)); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 void ShellContentBrowserClient::OverrideWebkitPrefs( | 265 void ShellContentBrowserClient::OverrideWebkitPrefs( |
| 266 RenderViewHost* render_view_host, | 266 RenderViewHost* render_view_host, |
| 267 WebPreferences* prefs) { | 267 WebPreferences* prefs) { |
| 268 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 268 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 269 switches::kRunLayoutTest)) | 269 switches::kRunLayoutTest)) |
| 270 return; | 270 return; |
| 271 WebKitTestController::Get()->OverrideWebkitPrefs(prefs); | 271 BlinkTestController::Get()->OverrideWebkitPrefs(prefs); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void ShellContentBrowserClient::ResourceDispatcherHostCreated() { | 274 void ShellContentBrowserClient::ResourceDispatcherHostCreated() { |
| 275 resource_dispatcher_host_delegate_.reset( | 275 resource_dispatcher_host_delegate_.reset( |
| 276 base::CommandLine::ForCurrentProcess()->HasSwitch( | 276 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 277 switches::kRunLayoutTest) | 277 switches::kRunLayoutTest) |
| 278 ? new LayoutTestResourceDispatcherHostDelegate | 278 ? new LayoutTestResourceDispatcherHostDelegate |
| 279 : new ShellResourceDispatcherHostDelegate); | 279 : new ShellResourceDispatcherHostDelegate); |
| 280 ResourceDispatcherHost::Get()->SetDelegate( | 280 ResourceDispatcherHost::Get()->SetDelegate( |
| 281 resource_dispatcher_host_delegate_.get()); | 281 resource_dispatcher_host_delegate_.get()); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 ShellBrowserContext* | 453 ShellBrowserContext* |
| 454 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 454 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 455 BrowserContext* content_browser_context) { | 455 BrowserContext* content_browser_context) { |
| 456 if (content_browser_context == browser_context()) | 456 if (content_browser_context == browser_context()) |
| 457 return browser_context(); | 457 return browser_context(); |
| 458 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 458 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 459 return off_the_record_browser_context(); | 459 return off_the_record_browser_context(); |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace content | 462 } // namespace content |
| OLD | NEW |