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

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

Issue 2495193003: Convert spellcheck to a buildflag header. (Closed)
Patch Set: Comment Created 4 years, 1 month 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/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 18 matching lines...) Expand all
29 #include "base/android/locale_utils.h" 29 #include "base/android/locale_utils.h"
30 #include "base/base_paths_android.h" 30 #include "base/base_paths_android.h"
31 #include "base/command_line.h" 31 #include "base/command_line.h"
32 #include "base/files/scoped_file.h" 32 #include "base/files/scoped_file.h"
33 #include "base/json/json_reader.h" 33 #include "base/json/json_reader.h"
34 #include "base/memory/ptr_util.h" 34 #include "base/memory/ptr_util.h"
35 #include "base/path_service.h" 35 #include "base/path_service.h"
36 #include "components/cdm/browser/cdm_message_filter_android.h" 36 #include "components/cdm/browser/cdm_message_filter_android.h"
37 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" 37 #include "components/crash/content/browser/crash_micro_dump_manager_android.h"
38 #include "components/navigation_interception/intercept_navigation_delegate.h" 38 #include "components/navigation_interception/intercept_navigation_delegate.h"
39 #include "components/spellcheck/spellcheck_build_features.h"
39 #include "content/public/browser/browser_message_filter.h" 40 #include "content/public/browser/browser_message_filter.h"
40 #include "content/public/browser/browser_thread.h" 41 #include "content/public/browser/browser_thread.h"
41 #include "content/public/browser/child_process_security_policy.h" 42 #include "content/public/browser/child_process_security_policy.h"
42 #include "content/public/browser/client_certificate_delegate.h" 43 #include "content/public/browser/client_certificate_delegate.h"
43 #include "content/public/browser/navigation_handle.h" 44 #include "content/public/browser/navigation_handle.h"
44 #include "content/public/browser/navigation_throttle.h" 45 #include "content/public/browser/navigation_throttle.h"
45 #include "content/public/browser/render_frame_host.h" 46 #include "content/public/browser/render_frame_host.h"
46 #include "content/public/browser/render_process_host.h" 47 #include "content/public/browser/render_process_host.h"
47 #include "content/public/browser/render_view_host.h" 48 #include "content/public/browser/render_view_host.h"
48 #include "content/public/browser/web_contents.h" 49 #include "content/public/browser/web_contents.h"
49 #include "content/public/common/content_switches.h" 50 #include "content/public/common/content_switches.h"
50 #include "content/public/common/service_names.h" 51 #include "content/public/common/service_names.h"
51 #include "content/public/common/url_constants.h" 52 #include "content/public/common/url_constants.h"
52 #include "content/public/common/web_preferences.h" 53 #include "content/public/common/web_preferences.h"
53 #include "device/geolocation/access_token_store.h" 54 #include "device/geolocation/access_token_store.h"
54 #include "device/geolocation/geolocation_delegate.h" 55 #include "device/geolocation/geolocation_delegate.h"
55 #include "net/android/network_library.h" 56 #include "net/android/network_library.h"
56 #include "net/ssl/ssl_cert_request_info.h" 57 #include "net/ssl/ssl_cert_request_info.h"
57 #include "net/ssl/ssl_info.h" 58 #include "net/ssl/ssl_info.h"
58 #include "ui/base/resource/resource_bundle.h" 59 #include "ui/base/resource/resource_bundle.h"
59 #include "ui/base/resource/resource_bundle_android.h" 60 #include "ui/base/resource/resource_bundle_android.h"
60 #include "ui/resources/grit/ui_resources.h" 61 #include "ui/resources/grit/ui_resources.h"
61 62
62 #if defined(ENABLE_SPELLCHECK) 63 #if BUILDFLAG(ENABLE_SPELLCHECK)
63 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h" 64 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
64 #include "components/spellcheck/common/spellcheck_switches.h" 65 #include "components/spellcheck/common/spellcheck_switches.h"
65 #endif 66 #endif
66 67
67 using content::BrowserThread; 68 using content::BrowserThread;
68 using content::ResourceType; 69 using content::ResourceType;
69 70
70 namespace android_webview { 71 namespace android_webview {
71 namespace { 72 namespace {
72 73
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // Grant content: scheme access to the whole renderer process, since we impose 213 // Grant content: scheme access to the whole renderer process, since we impose
213 // per-view access checks, and access is granted by default (see 214 // per-view access checks, and access is granted by default (see
214 // AwSettings.mAllowContentUrlAccess). 215 // AwSettings.mAllowContentUrlAccess).
215 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 216 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
216 host->GetID(), url::kContentScheme); 217 host->GetID(), url::kContentScheme);
217 218
218 host->AddFilter(new AwContentsMessageFilter(host->GetID())); 219 host->AddFilter(new AwContentsMessageFilter(host->GetID()));
219 host->AddFilter(new cdm::CdmMessageFilterAndroid()); 220 host->AddFilter(new cdm::CdmMessageFilterAndroid());
220 host->AddFilter(new AwPrintingMessageFilter(host->GetID())); 221 host->AddFilter(new AwPrintingMessageFilter(host->GetID()));
221 222
222 #if defined(ENABLE_SPELLCHECK) 223 #if BUILDFLAG(ENABLE_SPELLCHECK)
223 host->AddFilter(new SpellCheckMessageFilterPlatform(host->GetID())); 224 host->AddFilter(new SpellCheckMessageFilterPlatform(host->GetID()));
224 #endif 225 #endif
225 } 226 }
226 227
227 bool AwContentBrowserClient::IsHandledURL(const GURL& url) { 228 bool AwContentBrowserClient::IsHandledURL(const GURL& url) {
228 if (!url.is_valid()) { 229 if (!url.is_valid()) {
229 // We handle error cases. 230 // We handle error cases.
230 return true; 231 return true;
231 } 232 }
232 233
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 if (id == -1) 534 if (id == -1)
534 return nullptr; 535 return nullptr;
535 536
536 base::StringPiece manifest_contents = 537 base::StringPiece manifest_contents =
537 ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( 538 ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
538 id, ui::ScaleFactor::SCALE_FACTOR_NONE); 539 id, ui::ScaleFactor::SCALE_FACTOR_NONE);
539 return base::JSONReader::Read(manifest_contents); 540 return base::JSONReader::Read(manifest_contents);
540 } 541 }
541 542
542 } // namespace android_webview 543 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/DEPS ('k') | android_webview/native/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698