| 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 15 matching lines...) Expand all Loading... |
| 26 #include "android_webview/common/url_constants.h" | 26 #include "android_webview/common/url_constants.h" |
| 27 #include "base/android/locale_utils.h" | 27 #include "base/android/locale_utils.h" |
| 28 #include "base/base_paths_android.h" | 28 #include "base/base_paths_android.h" |
| 29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
| 30 #include "base/files/scoped_file.h" | 30 #include "base/files/scoped_file.h" |
| 31 #include "base/memory/ptr_util.h" | 31 #include "base/memory/ptr_util.h" |
| 32 #include "base/path_service.h" | 32 #include "base/path_service.h" |
| 33 #include "components/cdm/browser/cdm_message_filter_android.h" | 33 #include "components/cdm/browser/cdm_message_filter_android.h" |
| 34 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" | 34 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" |
| 35 #include "components/navigation_interception/intercept_navigation_delegate.h" | 35 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 36 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h" |
| 37 #include "components/spellcheck/common/spellcheck_switches.h" |
| 36 #include "content/public/browser/browser_message_filter.h" | 38 #include "content/public/browser/browser_message_filter.h" |
| 37 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/child_process_security_policy.h" | 40 #include "content/public/browser/child_process_security_policy.h" |
| 39 #include "content/public/browser/client_certificate_delegate.h" | 41 #include "content/public/browser/client_certificate_delegate.h" |
| 40 #include "content/public/browser/navigation_handle.h" | 42 #include "content/public/browser/navigation_handle.h" |
| 41 #include "content/public/browser/navigation_throttle.h" | 43 #include "content/public/browser/navigation_throttle.h" |
| 42 #include "content/public/browser/render_frame_host.h" | 44 #include "content/public/browser/render_frame_host.h" |
| 43 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
| 44 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
| 45 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 content::RenderProcessHost* host) { | 213 content::RenderProcessHost* host) { |
| 212 // Grant content: scheme access to the whole renderer process, since we impose | 214 // Grant content: scheme access to the whole renderer process, since we impose |
| 213 // per-view access checks, and access is granted by default (see | 215 // per-view access checks, and access is granted by default (see |
| 214 // AwSettings.mAllowContentUrlAccess). | 216 // AwSettings.mAllowContentUrlAccess). |
| 215 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 217 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 216 host->GetID(), url::kContentScheme); | 218 host->GetID(), url::kContentScheme); |
| 217 | 219 |
| 218 host->AddFilter(new AwContentsMessageFilter(host->GetID())); | 220 host->AddFilter(new AwContentsMessageFilter(host->GetID())); |
| 219 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 221 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
| 220 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); | 222 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); |
| 223 |
| 224 #if defined(ENABLE_SPELLCHECK) |
| 225 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 226 spellcheck::switches::kEnableAndroidSpellChecker)) { |
| 227 host->AddFilter(new SpellCheckMessageFilterPlatform(host->GetID())); |
| 228 } |
| 229 #endif |
| 221 } | 230 } |
| 222 | 231 |
| 223 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { | 232 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { |
| 224 if (!url.is_valid()) { | 233 if (!url.is_valid()) { |
| 225 // We handle error cases. | 234 // We handle error cases. |
| 226 return true; | 235 return true; |
| 227 } | 236 } |
| 228 | 237 |
| 229 const std::string scheme = url.scheme(); | 238 const std::string scheme = url.scheme(); |
| 230 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 239 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 523 |
| 515 #if defined(VIDEO_HOLE) | 524 #if defined(VIDEO_HOLE) |
| 516 content::ExternalVideoSurfaceContainer* | 525 content::ExternalVideoSurfaceContainer* |
| 517 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 526 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
| 518 content::WebContents* web_contents) { | 527 content::WebContents* web_contents) { |
| 519 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 528 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
| 520 } | 529 } |
| 521 #endif | 530 #endif |
| 522 | 531 |
| 523 } // namespace android_webview | 532 } // namespace android_webview |
| OLD | NEW |