| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | 93 blob_protocol_handler, |
| 94 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 94 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 95 file_system_protocol_handler, | 95 file_system_protocol_handler, |
| 96 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 96 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 97 developer_protocol_handler, | |
| 98 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 99 chrome_protocol_handler, | 97 chrome_protocol_handler, |
| 100 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 98 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 101 chrome_devtools_protocol_handler) { | 99 chrome_devtools_protocol_handler) { |
| 102 ShellBrowserContext* shell_browser_context = | 100 ShellBrowserContext* shell_browser_context = |
| 103 ShellBrowserContextForBrowserContext(content_browser_context); | 101 ShellBrowserContextForBrowserContext(content_browser_context); |
| 104 return shell_browser_context->CreateRequestContext( | 102 return shell_browser_context->CreateRequestContext( |
| 105 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | 103 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
| 106 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | 104 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); |
| 107 chrome_devtools_protocol_handler.Pass()); | |
| 108 } | 105 } |
| 109 | 106 |
| 110 net::URLRequestContextGetter* | 107 net::URLRequestContextGetter* |
| 111 ShellContentBrowserClient::CreateRequestContextForStoragePartition( | 108 ShellContentBrowserClient::CreateRequestContextForStoragePartition( |
| 112 BrowserContext* content_browser_context, | 109 BrowserContext* content_browser_context, |
| 113 const base::FilePath& partition_path, | 110 const base::FilePath& partition_path, |
| 114 bool in_memory, | 111 bool in_memory, |
| 115 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 112 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 116 blob_protocol_handler, | 113 blob_protocol_handler, |
| 117 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 114 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 118 file_system_protocol_handler, | 115 file_system_protocol_handler, |
| 119 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 116 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 120 developer_protocol_handler, | |
| 121 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 122 chrome_protocol_handler, | 117 chrome_protocol_handler, |
| 123 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 118 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 124 chrome_devtools_protocol_handler) { | 119 chrome_devtools_protocol_handler) { |
| 125 ShellBrowserContext* shell_browser_context = | 120 ShellBrowserContext* shell_browser_context = |
| 126 ShellBrowserContextForBrowserContext(content_browser_context); | 121 ShellBrowserContextForBrowserContext(content_browser_context); |
| 127 return shell_browser_context->CreateRequestContextForStoragePartition( | 122 return shell_browser_context->CreateRequestContextForStoragePartition( |
| 128 partition_path, in_memory, blob_protocol_handler.Pass(), | 123 partition_path, in_memory, blob_protocol_handler.Pass(), |
| 129 file_system_protocol_handler.Pass(), | 124 file_system_protocol_handler.Pass(), chrome_protocol_handler.Pass(), |
| 130 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 131 chrome_devtools_protocol_handler.Pass()); | 125 chrome_devtools_protocol_handler.Pass()); |
| 132 } | 126 } |
| 133 | 127 |
| 134 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( | 128 void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
| 135 CommandLine* command_line, int child_process_id) { | 129 CommandLine* command_line, int child_process_id) { |
| 136 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 130 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 137 command_line->AppendSwitch(switches::kDumpRenderTree); | 131 command_line->AppendSwitch(switches::kDumpRenderTree); |
| 138 } | 132 } |
| 139 | 133 |
| 140 void ShellContentBrowserClient::OverrideWebkitPrefs( | 134 void ShellContentBrowserClient::OverrideWebkitPrefs( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ShellBrowserContext* | 200 ShellBrowserContext* |
| 207 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 201 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 208 BrowserContext* content_browser_context) { | 202 BrowserContext* content_browser_context) { |
| 209 if (content_browser_context == browser_context()) | 203 if (content_browser_context == browser_context()) |
| 210 return browser_context(); | 204 return browser_context(); |
| 211 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 205 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 212 return off_the_record_browser_context(); | 206 return off_the_record_browser_context(); |
| 213 } | 207 } |
| 214 | 208 |
| 215 } // namespace content | 209 } // namespace content |
| OLD | NEW |