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_contents_io_thread_client.h" | 10 #include "android_webview/browser/aw_contents_io_thread_client.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Grant content: and file: scheme to the whole process, since we impose | 202 // Grant content: and file: scheme to the whole process, since we impose |
203 // per-view access checks. | 203 // per-view access checks. |
204 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 204 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
205 host->GetID(), android_webview::kContentScheme); | 205 host->GetID(), android_webview::kContentScheme); |
206 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 206 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
207 host->GetID(), content::kFileScheme); | 207 host->GetID(), content::kFileScheme); |
208 | 208 |
209 host->AddFilter(new AwContentsMessageFilter(host->GetID())); | 209 host->AddFilter(new AwContentsMessageFilter(host->GetID())); |
210 } | 210 } |
211 | 211 |
212 net::URLRequestContextGetter* | 212 net::URLRequestContextGetter* AwContentBrowserClient::CreateRequestContext( |
213 AwContentBrowserClient::CreateRequestContext( | |
214 content::BrowserContext* browser_context, | 213 content::BrowserContext* browser_context, |
215 content::ProtocolHandlerMap* protocol_handlers) { | 214 content::ProtocolHandlerMap* protocol_handlers, |
| 215 content::ProtocolHandlerScopedVector protocol_interceptors) { |
216 DCHECK(browser_context_.get() == browser_context); | 216 DCHECK(browser_context_.get() == browser_context); |
| 217 // TODO(mkosiba,kinuko): protocol_interceptors should be hooked up in the |
| 218 // downstream. (crbug.com/350286) |
217 return browser_context_->CreateRequestContext(protocol_handlers); | 219 return browser_context_->CreateRequestContext(protocol_handlers); |
218 } | 220 } |
219 | 221 |
220 net::URLRequestContextGetter* | 222 net::URLRequestContextGetter* |
221 AwContentBrowserClient::CreateRequestContextForStoragePartition( | 223 AwContentBrowserClient::CreateRequestContextForStoragePartition( |
222 content::BrowserContext* browser_context, | 224 content::BrowserContext* browser_context, |
223 const base::FilePath& partition_path, | 225 const base::FilePath& partition_path, |
224 bool in_memory, | 226 bool in_memory, |
225 content::ProtocolHandlerMap* protocol_handlers) { | 227 content::ProtocolHandlerMap* protocol_handlers, |
| 228 content::ProtocolHandlerScopedVector protocol_interceptors) { |
226 DCHECK(browser_context_.get() == browser_context); | 229 DCHECK(browser_context_.get() == browser_context); |
227 return browser_context_->CreateRequestContextForStoragePartition( | 230 return browser_context_->CreateRequestContextForStoragePartition( |
228 partition_path, in_memory, protocol_handlers); | 231 partition_path, in_memory, protocol_handlers); |
229 } | 232 } |
230 | 233 |
231 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 234 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
232 const std::string& alias_name) { | 235 const std::string& alias_name) { |
233 return alias_name; | 236 return alias_name; |
234 } | 237 } |
235 | 238 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 WebPreferences* web_prefs) { | 495 WebPreferences* web_prefs) { |
493 if (!preferences_populater_.get()) { | 496 if (!preferences_populater_.get()) { |
494 preferences_populater_ = make_scoped_ptr(native_factory_-> | 497 preferences_populater_ = make_scoped_ptr(native_factory_-> |
495 CreateWebPreferencesPopulater()); | 498 CreateWebPreferencesPopulater()); |
496 } | 499 } |
497 preferences_populater_->PopulateFor( | 500 preferences_populater_->PopulateFor( |
498 content::WebContents::FromRenderViewHost(rvh), web_prefs); | 501 content::WebContents::FromRenderViewHost(rvh), web_prefs); |
499 } | 502 } |
500 | 503 |
501 } // namespace android_webview | 504 } // namespace android_webview |
OLD | NEW |