Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 2264633002: [Android] Add spellchecking support in android_webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « android_webview/browser/DEPS ('k') | android_webview/native/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "content/public/common/web_preferences.h" 48 #include "content/public/common/web_preferences.h"
49 #include "device/geolocation/access_token_store.h" 49 #include "device/geolocation/access_token_store.h"
50 #include "device/geolocation/geolocation_delegate.h" 50 #include "device/geolocation/geolocation_delegate.h"
51 #include "net/android/network_library.h" 51 #include "net/android/network_library.h"
52 #include "net/ssl/ssl_cert_request_info.h" 52 #include "net/ssl/ssl_cert_request_info.h"
53 #include "net/ssl/ssl_info.h" 53 #include "net/ssl/ssl_info.h"
54 #include "ui/base/resource/resource_bundle.h" 54 #include "ui/base/resource/resource_bundle.h"
55 #include "ui/base/resource/resource_bundle_android.h" 55 #include "ui/base/resource/resource_bundle_android.h"
56 #include "ui/resources/grit/ui_resources.h" 56 #include "ui/resources/grit/ui_resources.h"
57 57
58 #if defined(ENABLE_SPELLCHECK)
59 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
60 #include "components/spellcheck/common/spellcheck_switches.h"
61 #endif
62
58 using content::BrowserThread; 63 using content::BrowserThread;
59 using content::ResourceType; 64 using content::ResourceType;
60 65
61 namespace android_webview { 66 namespace android_webview {
62 namespace { 67 namespace {
63 68
64 // TODO(sgurun) move this to its own file. 69 // TODO(sgurun) move this to its own file.
65 // This class filters out incoming aw_contents related IPC messages for the 70 // This class filters out incoming aw_contents related IPC messages for the
66 // renderer process on the IPC thread. 71 // renderer process on the IPC thread.
67 class AwContentsMessageFilter : public content::BrowserMessageFilter { 72 class AwContentsMessageFilter : public content::BrowserMessageFilter {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 content::RenderProcessHost* host) { 216 content::RenderProcessHost* host) {
212 // Grant content: scheme access to the whole renderer process, since we impose 217 // Grant content: scheme access to the whole renderer process, since we impose
213 // per-view access checks, and access is granted by default (see 218 // per-view access checks, and access is granted by default (see
214 // AwSettings.mAllowContentUrlAccess). 219 // AwSettings.mAllowContentUrlAccess).
215 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 220 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
216 host->GetID(), url::kContentScheme); 221 host->GetID(), url::kContentScheme);
217 222
218 host->AddFilter(new AwContentsMessageFilter(host->GetID())); 223 host->AddFilter(new AwContentsMessageFilter(host->GetID()));
219 host->AddFilter(new cdm::CdmMessageFilterAndroid()); 224 host->AddFilter(new cdm::CdmMessageFilterAndroid());
220 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); 225 host->AddFilter(new AwPrintingMessageFilter(host->GetID()));
226
227 #if defined(ENABLE_SPELLCHECK)
228 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
229 spellcheck::switches::kEnableAndroidSpellChecker)) {
230 host->AddFilter(new SpellCheckMessageFilterPlatform(host->GetID()));
231 }
232 #endif
221 } 233 }
222 234
223 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { 235 bool AwContentBrowserClient::IsHandledURL(const GURL& url) {
224 if (!url.is_valid()) { 236 if (!url.is_valid()) {
225 // We handle error cases. 237 // We handle error cases.
226 return true; 238 return true;
227 } 239 }
228 240
229 const std::string scheme = url.scheme(); 241 const std::string scheme = url.scheme();
230 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); 242 DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 521
510 #if defined(VIDEO_HOLE) 522 #if defined(VIDEO_HOLE)
511 content::ExternalVideoSurfaceContainer* 523 content::ExternalVideoSurfaceContainer*
512 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 524 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
513 content::WebContents* web_contents) { 525 content::WebContents* web_contents) {
514 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 526 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
515 } 527 }
516 #endif 528 #endif
517 529
518 } // namespace android_webview 530 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/DEPS ('k') | android_webview/native/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698