| 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 "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
| 9 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 9 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| 10 #include "android_webview/browser/aw_cookie_access_policy.h" | 10 #include "android_webview/browser/aw_cookie_access_policy.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // per-view access checks. | 111 // per-view access checks. |
| 112 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 112 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 113 host->GetID(), android_webview::kContentScheme); | 113 host->GetID(), android_webview::kContentScheme); |
| 114 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 114 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 115 host->GetID(), chrome::kFileScheme); | 115 host->GetID(), chrome::kFileScheme); |
| 116 } | 116 } |
| 117 | 117 |
| 118 net::URLRequestContextGetter* | 118 net::URLRequestContextGetter* |
| 119 AwContentBrowserClient::CreateRequestContext( | 119 AwContentBrowserClient::CreateRequestContext( |
| 120 content::BrowserContext* browser_context, | 120 content::BrowserContext* browser_context, |
| 121 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 121 content::ProtocolHandlerMap* protocol_handlers) { |
| 122 blob_protocol_handler, | |
| 123 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 124 file_system_protocol_handler, | |
| 125 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 126 developer_protocol_handler, | |
| 127 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 128 chrome_protocol_handler, | |
| 129 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 130 chrome_devtools_protocol_handler) { | |
| 131 DCHECK(browser_context_.get() == browser_context); | 122 DCHECK(browser_context_.get() == browser_context); |
| 132 return browser_context_->CreateRequestContext( | 123 return browser_context_->CreateRequestContext(protocol_handlers); |
| 133 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | |
| 134 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 135 chrome_devtools_protocol_handler.Pass()); | |
| 136 } | 124 } |
| 137 | 125 |
| 138 net::URLRequestContextGetter* | 126 net::URLRequestContextGetter* |
| 139 AwContentBrowserClient::CreateRequestContextForStoragePartition( | 127 AwContentBrowserClient::CreateRequestContextForStoragePartition( |
| 140 content::BrowserContext* browser_context, | 128 content::BrowserContext* browser_context, |
| 141 const base::FilePath& partition_path, | 129 const base::FilePath& partition_path, |
| 142 bool in_memory, | 130 bool in_memory, |
| 143 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 131 content::ProtocolHandlerMap* protocol_handlers) { |
| 144 blob_protocol_handler, | |
| 145 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 146 file_system_protocol_handler, | |
| 147 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 148 developer_protocol_handler, | |
| 149 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 150 chrome_protocol_handler, | |
| 151 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 152 chrome_devtools_protocol_handler) { | |
| 153 DCHECK(browser_context_.get() == browser_context); | 132 DCHECK(browser_context_.get() == browser_context); |
| 154 return browser_context_->CreateRequestContextForStoragePartition( | 133 return browser_context_->CreateRequestContextForStoragePartition( |
| 155 partition_path, in_memory, blob_protocol_handler.Pass(), | 134 partition_path, in_memory, protocol_handlers); |
| 156 file_system_protocol_handler.Pass(), | |
| 157 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | |
| 158 chrome_devtools_protocol_handler.Pass()); | |
| 159 } | 135 } |
| 160 | 136 |
| 161 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 137 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 162 const std::string& alias_name) { | 138 const std::string& alias_name) { |
| 163 return alias_name; | 139 return alias_name; |
| 164 } | 140 } |
| 165 | 141 |
| 166 void AwContentBrowserClient::AppendExtraCommandLineSwitches( | 142 void AwContentBrowserClient::AppendExtraCommandLineSwitches( |
| 167 CommandLine* command_line, | 143 CommandLine* command_line, |
| 168 int child_process_id) { | 144 int child_process_id) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 377 |
| 402 bool AwContentBrowserClient::AllowPepperSocketAPI( | 378 bool AwContentBrowserClient::AllowPepperSocketAPI( |
| 403 content::BrowserContext* browser_context, | 379 content::BrowserContext* browser_context, |
| 404 const GURL& url, | 380 const GURL& url, |
| 405 const content::SocketPermissionRequest& params) { | 381 const content::SocketPermissionRequest& params) { |
| 406 NOTREACHED() << "Android WebView does not support plugins"; | 382 NOTREACHED() << "Android WebView does not support plugins"; |
| 407 return false; | 383 return false; |
| 408 } | 384 } |
| 409 | 385 |
| 410 } // namespace android_webview | 386 } // namespace android_webview |
| OLD | NEW |