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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java

Issue 2814593002: WebView: add {set,get}SafeBrowsingEnabled per WebView (Closed)
Patch Set: Add comment about getSafeBrowsingEnabled() Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 package org.chromium.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.SharedPreferences; 8 import android.content.SharedPreferences;
9 9
10 import org.chromium.components.safe_browsing.SafeBrowsingApiBridge; 10 import org.chromium.components.safe_browsing.SafeBrowsingApiBridge;
(...skipping 14 matching lines...) Expand all
25 25
26 private AwGeolocationPermissions mGeolocationPermissions; 26 private AwGeolocationPermissions mGeolocationPermissions;
27 private AwFormDatabase mFormDatabase; 27 private AwFormDatabase mFormDatabase;
28 private AwServiceWorkerController mServiceWorkerController; 28 private AwServiceWorkerController mServiceWorkerController;
29 private Context mApplicationContext; 29 private Context mApplicationContext;
30 30
31 public AwBrowserContext(SharedPreferences sharedPreferences, Context applica tionContext) { 31 public AwBrowserContext(SharedPreferences sharedPreferences, Context applica tionContext) {
32 mSharedPreferences = sharedPreferences; 32 mSharedPreferences = sharedPreferences;
33 mApplicationContext = applicationContext; 33 mApplicationContext = applicationContext;
34 34
35 if (AwContentsStatics.getSafeBrowsingEnabled()) { 35 initSafeBrowsingApiHandler();
36 initSafeBrowsingApiHandler();
37 }
38 } 36 }
39 37
40 public AwGeolocationPermissions getGeolocationPermissions() { 38 public AwGeolocationPermissions getGeolocationPermissions() {
41 if (mGeolocationPermissions == null) { 39 if (mGeolocationPermissions == null) {
42 mGeolocationPermissions = new AwGeolocationPermissions(mSharedPrefer ences); 40 mGeolocationPermissions = new AwGeolocationPermissions(mSharedPrefer ences);
43 } 41 }
44 return mGeolocationPermissions; 42 return mGeolocationPermissions;
45 } 43 }
46 44
47 public AwFormDatabase getFormDatabase() { 45 public AwFormDatabase getFormDatabase() {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Try to get a specialized service bridge. 78 // Try to get a specialized service bridge.
81 try { 79 try {
82 Class<? extends SafeBrowsingApiHandler> cls = 80 Class<? extends SafeBrowsingApiHandler> cls =
83 (Class<? extends SafeBrowsingApiHandler>) Class.forName(safe BrowsingApiHandler); 81 (Class<? extends SafeBrowsingApiHandler>) Class.forName(safe BrowsingApiHandler);
84 SafeBrowsingApiBridge.setSafeBrowsingHandlerType(cls); 82 SafeBrowsingApiBridge.setSafeBrowsingHandlerType(cls);
85 } catch (ClassNotFoundException e) { 83 } catch (ClassNotFoundException e) {
86 // This is not an error; it just means this device doesn't have spec ialized services. 84 // This is not an error; it just means this device doesn't have spec ialized services.
87 } 85 }
88 } 86 }
89 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698