Chromium Code Reviews| 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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1693 if (menuItems != mDisabledMenuItems) { | 1692 if (menuItems != mDisabledMenuItems) { |
| 1694 mDisabledMenuItems = menuItems; | 1693 mDisabledMenuItems = menuItems; |
| 1695 } | 1694 } |
| 1696 } | 1695 } |
| 1697 } | 1696 } |
| 1698 | 1697 |
| 1699 /** | 1698 /** |
| 1700 * Sets whether to use the video overlay for the embedded video. | 1699 * Sets whether to use the video overlay for the embedded video. |
| 1701 * @param flag whether to enable the video overlay for the embedded video. | 1700 * @param flag whether to enable the video overlay for the embedded video. |
| 1702 */ | 1701 */ |
| 1703 public void setVideoOverlayForEmbeddedVideoEnabled(final boolean enabled) { | 1702 public void setVideoOverlayForEmbeddedVideoEnabled(final boolean enabled) { |
|
Tima Vaisburd
2016/09/02 22:18:45
Is it possible to remove this too together with th
boliu
2016/09/02 23:18:56
You can remove this one by making glue no-op, but
Tima Vaisburd
2016/09/03 02:02:58
Not done, I think I need to make the glue no-op on
Tima Vaisburd
2016/09/06 15:48:57
Done in PS4
| |
| 1704 // No-op, see http://crbug.com/616583 | 1703 // No-op, see http://crbug.com/616583 |
| 1705 } | 1704 } |
| 1706 | 1705 |
| 1707 /** | 1706 /** |
| 1708 * Gets whether to use the video overlay for the embedded video. | 1707 * 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. | 1708 * @return true if the WebView enables the video overlay for the embedded vi deo. |
| 1710 */ | 1709 */ |
| 1711 public boolean getVideoOverlayForEmbeddedVideoEnabled() { | 1710 public boolean getVideoOverlayForEmbeddedVideoEnabled() { |
| 1712 // Always false, see http://crbug.com/616583 | 1711 // Always false, see http://crbug.com/616583 |
| 1713 return false; | 1712 return false; |
| 1714 } | 1713 } |
| 1715 | 1714 |
| 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 | 1715 @VisibleForTesting |
| 1740 public void updateAcceptLanguages() { | 1716 public void updateAcceptLanguages() { |
| 1741 synchronized (mAwSettingsLock) { | 1717 synchronized (mAwSettingsLock) { |
| 1742 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { | 1718 mEventHandler.runOnUiThreadBlockingAndLocked(new Runnable() { |
| 1743 @Override | 1719 @Override |
| 1744 public void run() { | 1720 public void run() { |
| 1745 if (mNativeAwSettings != 0) { | 1721 if (mNativeAwSettings != 0) { |
| 1746 nativeUpdateRendererPreferencesLocked(mNativeAwSettings) ; | 1722 nativeUpdateRendererPreferencesLocked(mNativeAwSettings) ; |
| 1747 } | 1723 } |
| 1748 } | 1724 } |
| 1749 }); | 1725 }); |
| 1750 } | 1726 } |
| 1751 } | 1727 } |
| 1752 | 1728 |
| 1753 @CalledByNative | 1729 @CalledByNative |
| 1754 private boolean getForceVideoOverlayForTests() { | |
| 1755 assert Thread.holdsLock(mAwSettingsLock); | |
| 1756 return mForceVideoOverlayForTests; | |
| 1757 } | |
| 1758 | |
| 1759 @CalledByNative | |
| 1760 private boolean supportsDoubleTapZoomLocked() { | 1730 private boolean supportsDoubleTapZoomLocked() { |
| 1761 assert Thread.holdsLock(mAwSettingsLock); | 1731 assert Thread.holdsLock(mAwSettingsLock); |
| 1762 return mSupportZoom && mBuiltInZoomControls && mUseWideViewport; | 1732 return mSupportZoom && mBuiltInZoomControls && mUseWideViewport; |
| 1763 } | 1733 } |
| 1764 | 1734 |
| 1765 private boolean supportsMultiTouchZoomLocked() { | 1735 private boolean supportsMultiTouchZoomLocked() { |
| 1766 assert Thread.holdsLock(mAwSettingsLock); | 1736 assert Thread.holdsLock(mAwSettingsLock); |
| 1767 return mSupportZoom && mBuiltInZoomControls; | 1737 return mSupportZoom && mBuiltInZoomControls; |
| 1768 } | 1738 } |
| 1769 | 1739 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1834 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting s); | 1804 private native void nativeUpdateWebkitPreferencesLocked(long nativeAwSetting s); |
| 1835 | 1805 |
| 1836 private static native String nativeGetDefaultUserAgent(); | 1806 private static native String nativeGetDefaultUserAgent(); |
| 1837 | 1807 |
| 1838 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti ngs); | 1808 private native void nativeUpdateFormDataPreferencesLocked(long nativeAwSetti ngs); |
| 1839 | 1809 |
| 1840 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti ngs); | 1810 private native void nativeUpdateRendererPreferencesLocked(long nativeAwSetti ngs); |
| 1841 | 1811 |
| 1842 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin gs); | 1812 private native void nativeUpdateOffscreenPreRasterLocked(long nativeAwSettin gs); |
| 1843 } | 1813 } |
| OLD | NEW |