OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
10 import android.os.Handler; | 10 import android.os.Handler; |
(...skipping 16 matching lines...) Expand all Loading... |
27 * Stores Android WebView specific settings that does not need to be synced to W
ebKit. | 27 * Stores Android WebView specific settings that does not need to be synced to W
ebKit. |
28 * | 28 * |
29 * Methods in this class can be called from any thread, including threads create
d by | 29 * Methods in this class can be called from any thread, including threads create
d by |
30 * the client of WebView. | 30 * the client of WebView. |
31 */ | 31 */ |
32 @JNINamespace("android_webview") | 32 @JNINamespace("android_webview") |
33 public class AwSettings { | 33 public class AwSettings { |
34 private static final String LOGTAG = AwSettings.class.getSimpleName(); | 34 private static final String LOGTAG = AwSettings.class.getSimpleName(); |
35 private static final boolean TRACE = false; | 35 private static final boolean TRACE = false; |
36 | 36 |
37 // TODO(hush): Use android.webkit.WebSettings.MENU_ITEM_*. crbug.com/546762. | |
38 private static final int MENU_ITEM_NONE = 0; | |
39 | |
40 private static final String TAG = "AwSettings"; | 37 private static final String TAG = "AwSettings"; |
41 | 38 |
42 // This class must be created on the UI thread. Afterwards, it can be | 39 // This class must be created on the UI thread. Afterwards, it can be |
43 // used from any thread. Internally, the class uses a message queue | 40 // used from any thread. Internally, the class uses a message queue |
44 // to call native code on the UI thread only. | 41 // to call native code on the UI thread only. |
45 | 42 |
46 // Values passed in on construction. | 43 // Values passed in on construction. |
47 private final boolean mHasInternetPermission; | 44 private final boolean mHasInternetPermission; |
48 | 45 |
49 private ZoomSupportChangeListener mZoomChangeListener; | 46 private ZoomSupportChangeListener mZoomChangeListener; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 private boolean mForceZeroLayoutHeight; | 79 private boolean mForceZeroLayoutHeight; |
83 private boolean mLoadWithOverviewMode; | 80 private boolean mLoadWithOverviewMode; |
84 private boolean mMediaPlaybackRequiresUserGesture = true; | 81 private boolean mMediaPlaybackRequiresUserGesture = true; |
85 private String mDefaultVideoPosterURL; | 82 private String mDefaultVideoPosterURL; |
86 private float mInitialPageScalePercent; | 83 private float mInitialPageScalePercent; |
87 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. | 84 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. |
88 private boolean mEnableSupportedHardwareAcceleratedFeatures; | 85 private boolean mEnableSupportedHardwareAcceleratedFeatures; |
89 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; | 86 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; |
90 | 87 |
91 private boolean mOffscreenPreRaster; | 88 private boolean mOffscreenPreRaster; |
92 private int mDisabledMenuItems = MENU_ITEM_NONE; | 89 private int mDisabledMenuItems = WebSettings.MENU_ITEM_NONE; |
93 | 90 |
94 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. | 91 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. |
95 private boolean mAcceptThirdPartyCookies; | 92 private boolean mAcceptThirdPartyCookies; |
96 | 93 |
97 private final boolean mSupportLegacyQuirks; | 94 private final boolean mSupportLegacyQuirks; |
98 private final boolean mAllowEmptyDocumentPersistence; | 95 private final boolean mAllowEmptyDocumentPersistence; |
99 private final boolean mAllowGeolocationOnInsecureOrigins; | 96 private final boolean mAllowGeolocationOnInsecureOrigins; |
100 | 97 |
101 private final boolean mPasswordEchoEnabled; | 98 private final boolean mPasswordEchoEnabled; |
102 | 99 |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); | 1783 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); |
1787 | 1784 |
1788 private static native String nativeGetDefaultUserAgent(); | 1785 private static native String nativeGetDefaultUserAgent(); |
1789 | 1786 |
1790 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); | 1787 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); |
1791 | 1788 |
1792 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); | 1789 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); |
1793 | 1790 |
1794 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); | 1791 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); |
1795 } | 1792 } |
OLD | NEW |