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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 private boolean mZeroLayoutHeightDisablesViewportQuirk = false; | 81 private boolean mZeroLayoutHeightDisablesViewportQuirk = false; |
82 private boolean mForceZeroLayoutHeight = false; | 82 private boolean mForceZeroLayoutHeight = false; |
83 private boolean mLoadWithOverviewMode = false; | 83 private boolean mLoadWithOverviewMode = false; |
84 private boolean mMediaPlaybackRequiresUserGesture = true; | 84 private boolean mMediaPlaybackRequiresUserGesture = true; |
85 private String mDefaultVideoPosterURL; | 85 private String mDefaultVideoPosterURL; |
86 private float mInitialPageScalePercent = 0; | 86 private float mInitialPageScalePercent = 0; |
87 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. | 87 private boolean mSpatialNavigationEnabled; // Default depends on device fea
tures. |
88 private boolean mEnableSupportedHardwareAcceleratedFeatures = false; | 88 private boolean mEnableSupportedHardwareAcceleratedFeatures = false; |
89 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; | 89 private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; |
90 | 90 |
91 private boolean mForceVideoOverlayForTests = false; | |
92 private boolean mOffscreenPreRaster = false; | 91 private boolean mOffscreenPreRaster = false; |
93 private int mDisabledMenuItems = MENU_ITEM_NONE; | 92 private int mDisabledMenuItems = MENU_ITEM_NONE; |
94 | 93 |
95 // 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. |
96 private boolean mAcceptThirdPartyCookies = false; | 95 private boolean mAcceptThirdPartyCookies = false; |
97 | 96 |
98 private final boolean mSupportLegacyQuirks; | 97 private final boolean mSupportLegacyQuirks; |
99 private final boolean mAllowEmptyDocumentPersistence; | 98 private final boolean mAllowEmptyDocumentPersistence; |
100 private final boolean mAllowGeolocationOnInsecureOrigins; | 99 private final boolean mAllowGeolocationOnInsecureOrigins; |
101 | 100 |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 } | 1688 } |
1690 | 1689 |
1691 public void setDisabledActionModeMenuItems(int menuItems) { | 1690 public void setDisabledActionModeMenuItems(int menuItems) { |
1692 synchronized (mAwSettingsLock) { | 1691 synchronized (mAwSettingsLock) { |
1693 if (menuItems != mDisabledMenuItems) { | 1692 if (menuItems != mDisabledMenuItems) { |
1694 mDisabledMenuItems = menuItems; | 1693 mDisabledMenuItems = menuItems; |
1695 } | 1694 } |
1696 } | 1695 } |
1697 } | 1696 } |
1698 | 1697 |
1699 /** | |
1700 * Sets whether to use the video overlay for the embedded video. | |
1701 * @param flag whether to enable the video overlay for the embedded video. | |
1702 */ | |
1703 public void setVideoOverlayForEmbeddedVideoEnabled(final boolean enabled) { | |
1704 // No-op, see http://crbug.com/616583 | |
1705 } | |
1706 | |
1707 /** | |
1708 * Gets whether to use the video overlay for the embedded video. | |
1709 * @return true if the WebView enables the video overlay for the embedded vi
deo. | |
1710 */ | |
1711 public boolean getVideoOverlayForEmbeddedVideoEnabled() { | |
1712 // Always false, see http://crbug.com/616583 | |
1713 return false; | |
1714 } | |
1715 | |
1716 @CalledByNative | |
1717 private boolean getVideoOverlayForEmbeddedVideoEnabledLocked() { | |
1718 // Always false, see http://crbug.com/616583 | |
1719 return false; | |
1720 } | |
1721 | |
1722 @VisibleForTesting | |
1723 public void setForceVideoOverlayForTests(final boolean enabled) { | |
1724 synchronized (mAwSettingsLock) { | |
1725 if (mForceVideoOverlayForTests != enabled) { | |
1726 mForceVideoOverlayForTests = enabled; | |
1727 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { | |
1728 @Override | |
1729 public void run() { | |
1730 if (mNativeAwSettings != 0) { | |
1731 nativeUpdateRendererPreferencesLocked(mNativeAwSetti
ngs); | |
1732 } | |
1733 } | |
1734 }); | |
1735 } | |
1736 } | |
1737 } | |
1738 | |
1739 @VisibleForTesting | 1698 @VisibleForTesting |
1740 public void updateAcceptLanguages() { | 1699 public void updateAcceptLanguages() { |
1741 synchronized (mAwSettingsLock) { | 1700 synchronized (mAwSettingsLock) { |
1742 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { | 1701 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { |
1743 @Override | 1702 @Override |
1744 public void run() { | 1703 public void run() { |
1745 if (mNativeAwSettings != 0) { | 1704 if (mNativeAwSettings != 0) { |
1746 nativeUpdateRendererPreferencesLocked(mNativeAwSettings)
; | 1705 nativeUpdateRendererPreferencesLocked(mNativeAwSettings)
; |
1747 } | 1706 } |
1748 } | 1707 } |
1749 }); | 1708 }); |
1750 } | 1709 } |
1751 } | 1710 } |
1752 | 1711 |
1753 @CalledByNative | 1712 @CalledByNative |
1754 private boolean getForceVideoOverlayForTests() { | |
1755 assert Thread.holdsLock(mAwSettingsLock); | |
1756 return mForceVideoOverlayForTests; | |
1757 } | |
1758 | |
1759 @CalledByNative | |
1760 private boolean supportsDoubleTapZoomLocked() { | 1713 private boolean supportsDoubleTapZoomLocked() { |
1761 assert Thread.holdsLock(mAwSettingsLock); | 1714 assert Thread.holdsLock(mAwSettingsLock); |
1762 return mSupportZoom && mBuiltInZoomControls && mUseWideViewport; | 1715 return mSupportZoom && mBuiltInZoomControls && mUseWideViewport; |
1763 } | 1716 } |
1764 | 1717 |
1765 private boolean supportsMultiTouchZoomLocked() { | 1718 private boolean supportsMultiTouchZoomLocked() { |
1766 assert Thread.holdsLock(mAwSettingsLock); | 1719 assert Thread.holdsLock(mAwSettingsLock); |
1767 return mSupportZoom && mBuiltInZoomControls; | 1720 return mSupportZoom && mBuiltInZoomControls; |
1768 } | 1721 } |
1769 | 1722 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); | 1787 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); |
1835 | 1788 |
1836 private static native String nativeGetDefaultUserAgent(); | 1789 private static native String nativeGetDefaultUserAgent(); |
1837 | 1790 |
1838 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); | 1791 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); |
1839 | 1792 |
1840 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); | 1793 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); |
1841 | 1794 |
1842 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); | 1795 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); |
1843 } | 1796 } |
OLD | NEW |