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 |
37 private static final String TAG = "AwSettings"; | 40 private static final String TAG = "AwSettings"; |
38 | 41 |
39 // This class must be created on the UI thread. Afterwards, it can be | 42 // This class must be created on the UI thread. Afterwards, it can be |
40 // used from any thread. Internally, the class uses a message queue | 43 // used from any thread. Internally, the class uses a message queue |
41 // to call native code on the UI thread only. | 44 // to call native code on the UI thread only. |
42 | 45 |
43 // Values passed in on construction. | 46 // Values passed in on construction. |
44 private final boolean mHasInternetPermission; | 47 private final boolean mHasInternetPermission; |
45 | 48 |
46 private ZoomSupportChangeListener mZoomChangeListener; | 49 private ZoomSupportChangeListener mZoomChangeListener; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 private boolean mForceZeroLayoutHeight; | 82 private boolean mForceZeroLayoutHeight; |
80 private boolean mLoadWithOverviewMode; | 83 private boolean mLoadWithOverviewMode; |
81 private boolean mMediaPlaybackRequiresUserGesture = true; | 84 private boolean mMediaPlaybackRequiresUserGesture = true; |
82 private String mDefaultVideoPosterURL; | 85 private String mDefaultVideoPosterURL; |
83 private float mInitialPageScalePercent; | 86 private float mInitialPageScalePercent; |
84 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. | 87 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. |
85 private boolean mEnableSupportedHardwareAcceleratedFeatures; | 88 private boolean mEnableSupportedHardwareAcceleratedFeatures; |
86 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; | 89 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; |
87 | 90 |
88 private boolean mOffscreenPreRaster; | 91 private boolean mOffscreenPreRaster; |
89 private int mDisabledMenuItems = WebSettings.MENU_ITEM_NONE; | 92 private int mDisabledMenuItems = MENU_ITEM_NONE; |
90 | 93 |
91 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. | 94 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. |
92 private boolean mAcceptThirdPartyCookies; | 95 private boolean mAcceptThirdPartyCookies; |
93 | 96 |
94 private final boolean mSupportLegacyQuirks; | 97 private final boolean mSupportLegacyQuirks; |
95 private final boolean mAllowEmptyDocumentPersistence; | 98 private final boolean mAllowEmptyDocumentPersistence; |
96 private final boolean mAllowGeolocationOnInsecureOrigins; | 99 private final boolean mAllowGeolocationOnInsecureOrigins; |
97 | 100 |
98 private final boolean mPasswordEchoEnabled; | 101 private final boolean mPasswordEchoEnabled; |
99 | 102 |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); | 1786 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); |
1784 | 1787 |
1785 private static native String nativeGetDefaultUserAgent(); | 1788 private static native String nativeGetDefaultUserAgent(); |
1786 | 1789 |
1787 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); | 1790 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); |
1788 | 1791 |
1789 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); | 1792 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); |
1790 | 1793 |
1791 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); | 1794 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); |
1792 } | 1795 } |
OLD | NEW |