| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 private boolean mUseWideViewport = false; | 80 private boolean mUseWideViewport = false; |
| 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 private boolean mVideoOverlayForEmbeddedVideoEnabled = false; | 90 |
| 91 private boolean mForceVideoOverlayForTests = false; | 91 private boolean mForceVideoOverlayForTests = false; |
| 92 private boolean mOffscreenPreRaster = false; | 92 private boolean mOffscreenPreRaster = false; |
| 93 private int mDisabledMenuItems = MENU_ITEM_NONE; | 93 private int mDisabledMenuItems = MENU_ITEM_NONE; |
| 94 | 94 |
| 95 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. | 95 // Although this bit is stored on AwSettings it is actually controlled via t
he CookieManager. |
| 96 private boolean mAcceptThirdPartyCookies = false; | 96 private boolean mAcceptThirdPartyCookies = false; |
| 97 | 97 |
| 98 private final boolean mSupportLegacyQuirks; | 98 private final boolean mSupportLegacyQuirks; |
| 99 private final boolean mAllowEmptyDocumentPersistence; | 99 private final boolean mAllowEmptyDocumentPersistence; |
| 100 private final boolean mAllowGeolocationOnInsecureOrigins; | 100 private final boolean mAllowGeolocationOnInsecureOrigins; |
| (...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 mDisabledMenuItems = menuItems; | 1694 mDisabledMenuItems = menuItems; |
| 1695 } | 1695 } |
| 1696 } | 1696 } |
| 1697 } | 1697 } |
| 1698 | 1698 |
| 1699 /** | 1699 /** |
| 1700 * Sets whether to use the video overlay for the embedded video. | 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. | 1701 * @param flag whether to enable the video overlay for the embedded video. |
| 1702 */ | 1702 */ |
| 1703 public void setVideoOverlayForEmbeddedVideoEnabled(final boolean enabled) { | 1703 public void setVideoOverlayForEmbeddedVideoEnabled(final boolean enabled) { |
| 1704 synchronized (mAwSettingsLock) { | 1704 // No-op, see http://crbug.com/616583 |
| 1705 if (mVideoOverlayForEmbeddedVideoEnabled != enabled) { | |
| 1706 mVideoOverlayForEmbeddedVideoEnabled = enabled; | |
| 1707 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { | |
| 1708 @Override | |
| 1709 public void run() { | |
| 1710 if (mNativeAwSettings != 0) { | |
| 1711 nativeUpdateRendererPreferencesLocked(mNativeAwSetti
ngs); | |
| 1712 } | |
| 1713 } | |
| 1714 }); | |
| 1715 } | |
| 1716 } | |
| 1717 } | 1705 } |
| 1718 | 1706 |
| 1719 /** | 1707 /** |
| 1720 * Gets whether to use the video overlay for the embedded video. | 1708 * Gets whether to use the video overlay for the embedded video. |
| 1721 * @return true if the WebView enables the video overlay for the embedded vi
deo. | 1709 * @return true if the WebView enables the video overlay for the embedded vi
deo. |
| 1722 */ | 1710 */ |
| 1723 public boolean getVideoOverlayForEmbeddedVideoEnabled() { | 1711 public boolean getVideoOverlayForEmbeddedVideoEnabled() { |
| 1724 synchronized (mAwSettingsLock) { | 1712 // Always false, see http://crbug.com/616583 |
| 1725 return getVideoOverlayForEmbeddedVideoEnabledLocked(); | 1713 return false; |
| 1726 } | |
| 1727 } | 1714 } |
| 1728 | 1715 |
| 1729 @CalledByNative | 1716 @CalledByNative |
| 1730 private boolean getVideoOverlayForEmbeddedVideoEnabledLocked() { | 1717 private boolean getVideoOverlayForEmbeddedVideoEnabledLocked() { |
| 1731 assert Thread.holdsLock(mAwSettingsLock); | 1718 // Always false, see http://crbug.com/616583 |
| 1732 return mVideoOverlayForEmbeddedVideoEnabled; | 1719 return false; |
| 1733 } | 1720 } |
| 1734 | 1721 |
| 1735 @VisibleForTesting | 1722 @VisibleForTesting |
| 1736 public void setForceVideoOverlayForTests(final boolean enabled) { | 1723 public void setForceVideoOverlayForTests(final boolean enabled) { |
| 1737 synchronized (mAwSettingsLock) { | 1724 synchronized (mAwSettingsLock) { |
| 1738 if (mForceVideoOverlayForTests != enabled) { | 1725 if (mForceVideoOverlayForTests != enabled) { |
| 1739 mForceVideoOverlayForTests = enabled; | 1726 mForceVideoOverlayForTests = enabled; |
| 1740 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { | 1727 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { |
| 1741 @Override | 1728 @Override |
| 1742 public void run() { | 1729 public void run() { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); | 1834 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting
s); |
| 1848 | 1835 |
| 1849 private static native String nativeGetDefaultUserAgent(); | 1836 private static native String nativeGetDefaultUserAgent(); |
| 1850 | 1837 |
| 1851 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); | 1838 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti
ngs); |
| 1852 | 1839 |
| 1853 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); | 1840 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti
ngs); |
| 1854 | 1841 |
| 1855 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); | 1842 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin
gs); |
| 1856 } | 1843 } |
| OLD | NEW |