diff options
author | Ben Murdoch <benm@google.com> | 2013-10-03 16:04:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2013-10-04 16:49:44 +0100 |
commit | 54bae732019ac13327c0a68a6f8a82548d73ea9e (patch) | |
tree | 060415f4bbc1c7c0db989fc03b1651d52c9889d5 /chromium/java/com/android/webview | |
parent | 30c0a035f7c865ee300a3d8a9a3e515a66c6a818 (diff) | |
download | webview-54bae732019ac13327c0a68a6f8a82548d73ea9e.tar.gz |
Enable favicon downloading.
If an app is targetting >= K, always download favicons (as the legacy
method for enabling the behavior is deprecated). Also enable favicon
downloading for legacy apps that use the deprecated method.
Bug: 10825362
Change-Id: Ia0037365fc7211cdf01714d8385907f017225386
Diffstat (limited to 'chromium/java/com/android/webview')
-rw-r--r-- | chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java | 5 | ||||
-rw-r--r-- | chromium/java/com/android/webview/chromium/WebViewChromium.java | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java b/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java index 50bb771..c8af220 100644 --- a/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java +++ b/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java @@ -20,14 +20,15 @@ import android.content.ContentResolver; import android.webkit.WebIconDatabase; import android.webkit.WebIconDatabase.IconListener; +import org.chromium.android_webview.AwContents; + /** * Chromium implementation of WebIconDatabase -- big old no-op (base class is deprecated). */ final class WebIconDatabaseAdapter extends WebIconDatabase { @Override public void open(String path) { - // Intentional no-op: historically main effect of calling this method was to enable - // favicon download, but chromium webview always downloads favicons. + AwContents.setShouldDownloadFavicons(); } @Override diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java index 24d1895..4a8ffdb 100644 --- a/chromium/java/com/android/webview/chromium/WebViewChromium.java +++ b/chromium/java/com/android/webview/chromium/WebViewChromium.java @@ -222,6 +222,7 @@ class WebViewChromium implements WebViewProvider, mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN; final boolean areLegacyQuirksEnabled = mAppTargetSdkVersion < Build.VERSION_CODES.KITKAT; + mContentsClientAdapter = new WebViewContentsClientAdapter(mWebView); mWebSettings = new ContentSettingsAdapter(new AwSettings( mWebView.getContext(), isAccessFromFileURLsGrantedByDefault, @@ -246,6 +247,12 @@ class WebViewChromium implements WebViewProvider, mAwContents = new AwContents(mFactory.getBrowserContext(), mWebView, new InternalAccessAdapter(), mContentsClientAdapter, new AwLayoutSizer(), mWebSettings.getAwSettings()); + + if (mAppTargetSdkVersion >= Build.VERSION_CODES.KITKAT) { + // On KK and above, favicons are automatically downloaded as the method + // old apps use to enable that behavior is deprecated. + AwContents.setShouldDownloadFavicons(); + } } void startYourEngine() { |