| 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/shell/shell_content_browser_client.h" | 5 #include "content/shell/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 BrowserContext::GetDefaultStoragePartition(browser_context()) | 83 BrowserContext::GetDefaultStoragePartition(browser_context()) |
| 84 ->GetDatabaseTracker(), | 84 ->GetDatabaseTracker(), |
| 85 BrowserContext::GetDefaultStoragePartition(browser_context()) | 85 BrowserContext::GetDefaultStoragePartition(browser_context()) |
| 86 ->GetQuotaManager())); | 86 ->GetQuotaManager())); |
| 87 host->Send(new ShellViewMsg_SetWebKitSourceDir(webkit_source_dir_)); | 87 host->Send(new ShellViewMsg_SetWebKitSourceDir(webkit_source_dir_)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext( | 90 net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext( |
| 91 BrowserContext* content_browser_context, | 91 BrowserContext* content_browser_context, |
| 92 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 92 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 93 blob_protocol_handler, | |
| 94 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 95 file_system_protocol_handler, | |
| 96 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 97 developer_protocol_handler, | 93 developer_protocol_handler, |
| 98 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 94 ProtocolHandlerMap* protocol_handlers) { |
| 99 chrome_protocol_handler, | |
| 100 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 101 chrome_devtools_protocol_handler) { | |
| 102 ShellBrowserContext* shell_browser_context = | 95 ShellBrowserContext* shell_browser_context = |
| 103 ShellBrowserContextForBrowserContext(content_browser_context); | 96 ShellBrowserContextForBrowserContext(content_browser_context); |
| 104 return shell_browser_context->CreateRequestContext( | 97 return shell_browser_context->CreateRequestContext( |
| 105 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | 98 developer_protocol_handler.Pass(), protocol_handlers); |
| 106 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 107 chrome_devtools_protocol_handler.Pass()); | |
| 108 } | 99 } |
| 109 | 100 |
| 110 net::URLRequestContextGetter* | 101 net::URLRequestContextGetter* |
| 111 ShellContentBrowserClient::CreateRequestContextForStoragePartition( | 102 ShellContentBrowserClient::CreateRequestContextForStoragePartition( |
| 112 BrowserContext* content_browser_context, | 103 BrowserContext* content_browser_context, |
| 113 const base::FilePath& partition_path, | 104 const base::FilePath& partition_path, |
| 114 bool in_memory, | 105 bool in_memory, |
| 115 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 106 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 116 blob_protocol_handler, | |
| 117 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 118 file_system_protocol_handler, | |
| 119 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 120 developer_protocol_handler, | 107 developer_protocol_handler, |
| 121 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 108 ProtocolHandlerMap* protocol_handlers) { |
| 122 chrome_protocol_handler, | |
| 123 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 124 chrome_devtools_protocol_handler) { | |
| 125 ShellBrowserContext* shell_browser_context = | 109 ShellBrowserContext* shell_browser_context = |
| 126 ShellBrowserContextForBrowserContext(content_browser_context); | 110 ShellBrowserContextForBrowserContext(content_browser_context); |
| 127 return shell_browser_context->CreateRequestContextForStoragePartition( | 111 return shell_browser_context->CreateRequestContextForStoragePartition( |
| 128 partition_path, in_memory, blob_protocol_handler.Pass(), | 112 partition_path, in_memory, developer_protocol_handler.Pass(), |
| 129 file_system_protocol_handler.Pass(), | 113 protocol_handlers); |
| 130 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 131 chrome_devtools_protocol_handler.Pass()); | |
| 132 } | 114 } |
| 133 | 115 |
| 134 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( | 116 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
| 135 CommandLine* command_line, int child_process_id) { | 117 CommandLine* command_line, int child_process_id) { |
| 136 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 118 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 137 command_line->AppendSwitch(switches::kDumpRenderTree); | 119 command_line->AppendSwitch(switches::kDumpRenderTree); |
| 138 } | 120 } |
| 139 | 121 |
| 140 void ShellContentBrowserClient::OverrideWebkitPrefs( | 122 void ShellContentBrowserClient::OverrideWebkitPrefs( |
| 141 RenderViewHost* render_view_host, | 123 RenderViewHost* render_view_host, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ShellBrowserContext* | 188 ShellBrowserContext* |
| 207 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 189 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 208 BrowserContext* content_browser_context) { | 190 BrowserContext* content_browser_context) { |
| 209 if (content_browser_context == browser_context()) | 191 if (content_browser_context == browser_context()) |
| 210 return browser_context(); | 192 return browser_context(); |
| 211 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 193 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 212 return off_the_record_browser_context(); | 194 return off_the_record_browser_context(); |
| 213 } | 195 } |
| 214 | 196 |
| 215 } // namespace content | 197 } // namespace content |
| OLD | NEW |