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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 2635693002: [WebView] initial webview-side implementation of safebrowsing (Closed)
Patch Set: rename lock, add crbug comment Created 3 years, 11 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
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/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "android_webview/browser/aw_content_browser_client.h" 9 #include "android_webview/browser/aw_content_browser_client.h"
10 #include "android_webview/browser/browser_view_renderer.h" 10 #include "android_webview/browser/browser_view_renderer.h"
(...skipping 13 matching lines...) Expand all
24 #include "android_webview/renderer/aw_content_renderer_client.h" 24 #include "android_webview/renderer/aw_content_renderer_client.h"
25 #include "base/android/apk_assets.h" 25 #include "base/android/apk_assets.h"
26 #include "base/command_line.h" 26 #include "base/command_line.h"
27 #include "base/cpu.h" 27 #include "base/cpu.h"
28 #include "base/i18n/icu_util.h" 28 #include "base/i18n/icu_util.h"
29 #include "base/lazy_instance.h" 29 #include "base/lazy_instance.h"
30 #include "base/logging.h" 30 #include "base/logging.h"
31 #include "base/threading/thread_restrictions.h" 31 #include "base/threading/thread_restrictions.h"
32 #include "cc/base/switches.h" 32 #include "cc/base/switches.h"
33 #include "components/crash/content/app/breakpad_linux.h" 33 #include "components/crash/content/app/breakpad_linux.h"
34 #include "components/safe_browsing_db/android/safe_browsing_api_handler_bridge.h "
34 #include "components/spellcheck/common/spellcheck_features.h" 35 #include "components/spellcheck/common/spellcheck_features.h"
35 #include "content/public/browser/android/browser_media_player_manager_register.h " 36 #include "content/public/browser/android/browser_media_player_manager_register.h "
36 #include "content/public/browser/browser_main_runner.h" 37 #include "content/public/browser/browser_main_runner.h"
37 #include "content/public/browser/browser_thread.h" 38 #include "content/public/browser/browser_thread.h"
38 #include "content/public/common/content_descriptors.h" 39 #include "content/public/common/content_descriptors.h"
39 #include "content/public/common/content_features.h" 40 #include "content/public/common/content_features.h"
40 #include "content/public/common/content_switches.h" 41 #include "content/public/common/content_switches.h"
41 #include "gin/public/isolate_holder.h" 42 #include "gin/public/isolate_holder.h"
42 #include "gin/v8_initializer.h" 43 #include "gin/v8_initializer.h"
43 #include "gpu/command_buffer/service/gpu_switches.h" 44 #include "gpu/command_buffer/service/gpu_switches.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 cl->AppendSwitch(switches::kDisableRendererBackgrounding); 149 cl->AppendSwitch(switches::kDisableRendererBackgrounding);
149 } 150 }
150 151
151 CommandLineHelper::AddEnabledFeature( 152 CommandLineHelper::AddEnabledFeature(
152 *cl, spellcheck::kAndroidSpellCheckerNonLowEnd.name); 153 *cl, spellcheck::kAndroidSpellCheckerNonLowEnd.name);
153 154
154 CommandLineHelper::AddDisabledFeature(*cl, features::kWebPayments.name); 155 CommandLineHelper::AddDisabledFeature(*cl, features::kWebPayments.name);
155 156
156 android_webview::RegisterPathProvider(); 157 android_webview::RegisterPathProvider();
157 158
159 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
160 switches::kWebViewEnableSafeBrowsingSupport)) {
161 safe_browsing_api_handler_.reset(
162 new safe_browsing::SafeBrowsingApiHandlerBridge());
163 safe_browsing::SafeBrowsingApiHandler::SetInstance(
164 safe_browsing_api_handler_.get());
165 }
166
158 return false; 167 return false;
159 } 168 }
160 169
161 void AwMainDelegate::PreSandboxStartup() { 170 void AwMainDelegate::PreSandboxStartup() {
162 #if defined(ARCH_CPU_ARM_FAMILY) 171 #if defined(ARCH_CPU_ARM_FAMILY)
163 // Create an instance of the CPU class to parse /proc/cpuinfo and cache 172 // Create an instance of the CPU class to parse /proc/cpuinfo and cache
164 // cpu_brand info. 173 // cpu_brand info.
165 base::CPU cpu_info; 174 base::CPU cpu_info;
166 #endif 175 #endif
167 176
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 280
272 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { 281 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() {
273 return new AwWebPreferencesPopulaterImpl(); 282 return new AwWebPreferencesPopulaterImpl();
274 } 283 }
275 284
276 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { 285 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() {
277 return new AwLocaleManagerImpl(); 286 return new AwLocaleManagerImpl();
278 } 287 }
279 288
280 } // namespace android_webview 289 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698