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_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
9 #include "android_webview/browser/aw_quota_permission_context.h" | 9 #include "android_webview/browser/aw_quota_permission_context.h" |
10 #include "android_webview/browser/net_disk_cache_remover.h" | 10 #include "android_webview/browser/net_disk_cache_remover.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 CHECK(content::RenderProcessHost::run_renderer_in_process()); | 83 CHECK(content::RenderProcessHost::run_renderer_in_process()); |
84 | 84 |
85 // Grant content: and file: scheme to the whole process, since we impose | 85 // Grant content: and file: scheme to the whole process, since we impose |
86 // per-view access checks. | 86 // per-view access checks. |
87 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 87 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
88 host->GetID(), android_webview::kContentScheme); | 88 host->GetID(), android_webview::kContentScheme); |
89 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 89 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
90 host->GetID(), chrome::kFileScheme); | 90 host->GetID(), chrome::kFileScheme); |
91 } | 91 } |
92 | 92 |
| 93 net::URLRequestContextGetter* |
| 94 AwContentBrowserClient::CreateRequestContext( |
| 95 content::BrowserContext* browser_context, |
| 96 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 97 blob_protocol_handler, |
| 98 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 99 file_system_protocol_handler, |
| 100 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 101 developer_protocol_handler, |
| 102 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 103 chrome_protocol_handler, |
| 104 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 105 chrome_devtools_protocol_handler) { |
| 106 return browser_context_->CreateRequestContext( |
| 107 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
| 108 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), |
| 109 chrome_devtools_protocol_handler.Pass()); |
| 110 } |
| 111 |
| 112 net::URLRequestContextGetter* |
| 113 AwContentBrowserClient::CreateRequestContextForStoragePartition( |
| 114 content::BrowserContext* browser_context, |
| 115 const FilePath& partition_path, |
| 116 bool in_memory, |
| 117 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 118 blob_protocol_handler, |
| 119 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 120 file_system_protocol_handler, |
| 121 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 122 developer_protocol_handler, |
| 123 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 124 chrome_protocol_handler, |
| 125 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 126 chrome_devtools_protocol_handler) { |
| 127 return browser_context_->CreateRequestContextForStoragePartition( |
| 128 partition_path, in_memory, blob_protocol_handler.Pass(), |
| 129 file_system_protocol_handler.Pass(), |
| 130 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), |
| 131 chrome_devtools_protocol_handler.Pass()); |
| 132 } |
| 133 |
93 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 134 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
94 const std::string& alias_name) { | 135 const std::string& alias_name) { |
95 return alias_name; | 136 return alias_name; |
96 } | 137 } |
97 | 138 |
98 void AwContentBrowserClient::AppendExtraCommandLineSwitches( | 139 void AwContentBrowserClient::AppendExtraCommandLineSwitches( |
99 CommandLine* command_line, | 140 CommandLine* command_line, |
100 int child_process_id) { | 141 int child_process_id) { |
101 NOTREACHED() << "Android WebView does not support multi-process yet"; | 142 NOTREACHED() << "Android WebView does not support multi-process yet"; |
102 } | 143 } |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 368 |
328 bool AwContentBrowserClient::AllowPepperSocketAPI( | 369 bool AwContentBrowserClient::AllowPepperSocketAPI( |
329 content::BrowserContext* browser_context, | 370 content::BrowserContext* browser_context, |
330 const GURL& url, | 371 const GURL& url, |
331 const content::SocketPermissionRequest& params) { | 372 const content::SocketPermissionRequest& params) { |
332 NOTREACHED() << "Android WebView does not support plugins"; | 373 NOTREACHED() << "Android WebView does not support plugins"; |
333 return false; | 374 return false; |
334 } | 375 } |
335 | 376 |
336 } // namespace android_webview | 377 } // namespace android_webview |
OLD | NEW |