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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // per-view access checks, and access is granted by default (see | 225 // per-view access checks, and access is granted by default (see |
226 // AwSettings.mAllowContentUrlAccess). | 226 // AwSettings.mAllowContentUrlAccess). |
227 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 227 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
228 host->GetID(), url::kContentScheme); | 228 host->GetID(), url::kContentScheme); |
229 | 229 |
230 host->AddFilter(new AwContentsMessageFilter(host->GetID())); | 230 host->AddFilter(new AwContentsMessageFilter(host->GetID())); |
231 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 231 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
232 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); | 232 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); |
233 } | 233 } |
234 | 234 |
235 net::URLRequestContextGetter* AwContentBrowserClient::CreateRequestContext( | |
236 content::BrowserContext* browser_context, | |
237 content::ProtocolHandlerMap* protocol_handlers, | |
238 content::URLRequestInterceptorScopedVector request_interceptors) { | |
239 DCHECK_EQ(browser_context_.get(), browser_context); | |
240 return browser_context_->CreateRequestContext( | |
241 protocol_handlers, std::move(request_interceptors)); | |
242 } | |
243 | |
244 net::URLRequestContextGetter* | |
245 AwContentBrowserClient::CreateRequestContextForStoragePartition( | |
246 content::BrowserContext* browser_context, | |
247 const base::FilePath& partition_path, | |
248 bool in_memory, | |
249 content::ProtocolHandlerMap* protocol_handlers, | |
250 content::URLRequestInterceptorScopedVector request_interceptors) { | |
251 DCHECK_EQ(browser_context_.get(), browser_context); | |
252 // TODO(mkosiba,kinuko): request_interceptors should be hooked up in the | |
253 // downstream. (crbug.com/350286) | |
254 return browser_context_->CreateRequestContextForStoragePartition( | |
255 partition_path, in_memory, protocol_handlers, | |
256 std::move(request_interceptors)); | |
257 } | |
258 | |
259 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { | 235 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { |
260 if (!url.is_valid()) { | 236 if (!url.is_valid()) { |
261 // We handle error cases. | 237 // We handle error cases. |
262 return true; | 238 return true; |
263 } | 239 } |
264 | 240 |
265 const std::string scheme = url.scheme(); | 241 const std::string scheme = url.scheme(); |
266 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 242 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
267 // See CreateJobFactory in aw_url_request_context_getter.cc for the | 243 // See CreateJobFactory in aw_url_request_context_getter.cc for the |
268 // list of protocols that are handled. | 244 // list of protocols that are handled. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 538 |
563 #if defined(VIDEO_HOLE) | 539 #if defined(VIDEO_HOLE) |
564 content::ExternalVideoSurfaceContainer* | 540 content::ExternalVideoSurfaceContainer* |
565 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 541 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
566 content::WebContents* web_contents) { | 542 content::WebContents* web_contents) { |
567 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 543 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
568 } | 544 } |
569 #endif | 545 #endif |
570 | 546 |
571 } // namespace android_webview | 547 } // namespace android_webview |
OLD | NEW |