summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kosiba <mkosiba@android.com>2015-01-19 11:33:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-19 11:33:04 +0000
commita66eee2fb2290adf1240d6f900876451948e019e (patch)
tree356f71e90b2264aff71de4abd60a430a03fa7145
parentf989a7846d5fe4116de1a0635a8aade09d2be7b2 (diff)
parent78ab2ceb49cbb6cb10e425009d16283937073a93 (diff)
downloadwebview-chromium-dev.tar.gz
Merge "Use Java code from external/chromium_org" into chromium-devchromium-dev
-rw-r--r--chromium/java/com/android/webview/chromium/ContentSettingsAdapter.java618
-rw-r--r--chromium/java/com/android/webview/chromium/CookieManagerAdapter.java160
-rw-r--r--chromium/java/com/android/webview/chromium/DataReductionProxyManager.java201
-rw-r--r--chromium/java/com/android/webview/chromium/DrawGLFunctor.java124
-rw-r--r--chromium/java/com/android/webview/chromium/FileChooserParamsAdapter.java89
-rw-r--r--chromium/java/com/android/webview/chromium/GeolocationPermissionsAdapter.java62
-rw-r--r--chromium/java/com/android/webview/chromium/GraphicsUtils.java31
-rw-r--r--chromium/java/com/android/webview/chromium/ResourceRewriter.java40
-rw-r--r--chromium/java/com/android/webview/chromium/UnimplementedWebViewApi.java54
-rw-r--r--chromium/java/com/android/webview/chromium/WebBackForwardListChromium.java103
-rw-r--r--chromium/java/com/android/webview/chromium/WebHistoryItemChromium.java98
-rw-r--r--chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java64
-rw-r--r--chromium/java/com/android/webview/chromium/WebStorageAdapter.java80
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewChromium.java2275
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java481
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java1231
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewDatabaseAdapter.java69
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewDelegateFactory.java343
-rw-r--r--chromium/package.mk4
-rw-r--r--chromium/res/drawable-hdpi/ic_media_video_poster.pngbin7060 -> 0 bytes
-rw-r--r--chromium/res/drawable-hdpi/icon_webview.pngbin13975 -> 0 bytes
-rw-r--r--chromium/res/drawable-ldpi/ic_media_video_poster.pngbin3523 -> 0 bytes
-rw-r--r--chromium/res/drawable-mdpi/ic_media_video_poster.pngbin3499 -> 0 bytes
-rw-r--r--chromium/res/drawable-mdpi/icon_webview.pngbin7151 -> 0 bytes
-rw-r--r--chromium/res/drawable-xhdpi/ic_media_video_poster.pngbin9589 -> 0 bytes
-rw-r--r--chromium/res/drawable-xhdpi/icon_webview.pngbin21981 -> 0 bytes
-rw-r--r--chromium/res/drawable-xxhdpi/icon_webview.pngbin37607 -> 0 bytes
-rw-r--r--chromium/res/values-af/strings.xml11
-rw-r--r--chromium/res/values-am/strings.xml11
-rw-r--r--chromium/res/values-ar/strings.xml11
-rw-r--r--chromium/res/values-az-rAZ/strings.xml11
-rw-r--r--chromium/res/values-az/strings.xml11
-rw-r--r--chromium/res/values-bg/strings.xml11
-rw-r--r--chromium/res/values-bn-rBD/strings.xml11
-rw-r--r--chromium/res/values-ca/strings.xml11
-rw-r--r--chromium/res/values-cs/strings.xml11
-rw-r--r--chromium/res/values-da/strings.xml11
-rw-r--r--chromium/res/values-de/strings.xml11
-rw-r--r--chromium/res/values-el/strings.xml11
-rw-r--r--chromium/res/values-en-rGB/strings.xml11
-rw-r--r--chromium/res/values-en-rIN/strings.xml11
-rw-r--r--chromium/res/values-es-rUS/strings.xml11
-rw-r--r--chromium/res/values-es/strings.xml11
-rw-r--r--chromium/res/values-et-rEE/strings.xml11
-rw-r--r--chromium/res/values-eu-rES/strings.xml11
-rw-r--r--chromium/res/values-fa/strings.xml11
-rw-r--r--chromium/res/values-fi/strings.xml11
-rw-r--r--chromium/res/values-fr-rCA/strings.xml11
-rw-r--r--chromium/res/values-fr/strings.xml11
-rw-r--r--chromium/res/values-gl-rES/strings.xml11
-rw-r--r--chromium/res/values-hi/strings.xml11
-rw-r--r--chromium/res/values-hr/strings.xml11
-rw-r--r--chromium/res/values-hu/strings.xml11
-rw-r--r--chromium/res/values-hy-rAM/strings.xml11
-rw-r--r--chromium/res/values-in/strings.xml11
-rw-r--r--chromium/res/values-is-rIS/strings.xml11
-rw-r--r--chromium/res/values-it/strings.xml11
-rw-r--r--chromium/res/values-iw/strings.xml11
-rw-r--r--chromium/res/values-ja/strings.xml11
-rw-r--r--chromium/res/values-ka-rGE/strings.xml11
-rw-r--r--chromium/res/values-kk-rKZ/strings.xml11
-rw-r--r--chromium/res/values-km-rKH/strings.xml11
-rw-r--r--chromium/res/values-kn-rIN/strings.xml11
-rw-r--r--chromium/res/values-ko/strings.xml11
-rw-r--r--chromium/res/values-ky-rKG/strings.xml11
-rw-r--r--chromium/res/values-lo-rLA/strings.xml11
-rw-r--r--chromium/res/values-lt/strings.xml11
-rw-r--r--chromium/res/values-lv/strings.xml11
-rw-r--r--chromium/res/values-mk-rMK/strings.xml11
-rw-r--r--chromium/res/values-ml-rIN/strings.xml11
-rw-r--r--chromium/res/values-mn-rMN/strings.xml11
-rw-r--r--chromium/res/values-mr-rIN/strings.xml11
-rw-r--r--chromium/res/values-ms-rMY/strings.xml11
-rw-r--r--chromium/res/values-my-rMM/strings.xml11
-rw-r--r--chromium/res/values-nb/strings.xml11
-rw-r--r--chromium/res/values-ne-rNP/strings.xml11
-rw-r--r--chromium/res/values-ne/strings.xml10
-rw-r--r--chromium/res/values-nl/strings.xml11
-rw-r--r--chromium/res/values-pl/strings.xml11
-rw-r--r--chromium/res/values-pt-rPT/strings.xml11
-rw-r--r--chromium/res/values-pt/strings.xml11
-rw-r--r--chromium/res/values-ro/strings.xml11
-rw-r--r--chromium/res/values-ru/strings.xml11
-rw-r--r--chromium/res/values-si-rLK/strings.xml11
-rw-r--r--chromium/res/values-si/strings.xml10
-rw-r--r--chromium/res/values-sk/strings.xml11
-rw-r--r--chromium/res/values-sl/strings.xml11
-rw-r--r--chromium/res/values-sr/strings.xml11
-rw-r--r--chromium/res/values-sv/strings.xml11
-rw-r--r--chromium/res/values-sw/strings.xml11
-rw-r--r--chromium/res/values-ta-rIN/strings.xml11
-rw-r--r--chromium/res/values-te-rIN/strings.xml11
-rw-r--r--chromium/res/values-th/strings.xml11
-rw-r--r--chromium/res/values-tl/strings.xml11
-rw-r--r--chromium/res/values-tr/strings.xml11
-rw-r--r--chromium/res/values-uk/strings.xml11
-rw-r--r--chromium/res/values-ur-rPK/strings.xml11
-rw-r--r--chromium/res/values-uz-rUZ/strings.xml11
-rw-r--r--chromium/res/values-vi/strings.xml11
-rw-r--r--chromium/res/values-zh-rCN/strings.xml11
-rw-r--r--chromium/res/values-zh-rHK/strings.xml11
-rw-r--r--chromium/res/values-zh-rTW/strings.xml11
-rw-r--r--chromium/res/values-zu/strings.xml11
-rw-r--r--chromium/res/values/strings.xml12
104 files changed, 2 insertions, 6971 deletions
diff --git a/chromium/java/com/android/webview/chromium/ContentSettingsAdapter.java b/chromium/java/com/android/webview/chromium/ContentSettingsAdapter.java
deleted file mode 100644
index 5f623e4..0000000
--- a/chromium/java/com/android/webview/chromium/ContentSettingsAdapter.java
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.util.Log;
-import android.webkit.WebSettings.LayoutAlgorithm;
-import android.webkit.WebSettings.PluginState;
-import android.webkit.WebSettings.RenderPriority;
-import android.webkit.WebSettings.TextSize;
-import android.webkit.WebSettings.ZoomDensity;
-
-import org.chromium.android_webview.AwSettings;
-
-public class ContentSettingsAdapter extends android.webkit.WebSettings {
-
- private static final String LOGTAG = ContentSettingsAdapter.class.getSimpleName();
- private static final boolean TRACE = false;
-
- private AwSettings mAwSettings;
-
- public ContentSettingsAdapter(AwSettings awSettings) {
- mAwSettings = awSettings;
- }
-
- AwSettings getAwSettings() {
- return mAwSettings;
- }
-
- @Override
- @Deprecated
- public void setNavDump(boolean enabled) {
- // Intentional no-op.
- }
-
- @Override
- @Deprecated
- public boolean getNavDump() {
- // Intentional no-op.
- return false;
- }
-
- @Override
- public void setSupportZoom(boolean support) {
- if (TRACE) Log.d(LOGTAG, "setSupportZoom=" + support);
- mAwSettings.setSupportZoom(support);
- }
-
- @Override
- public boolean supportZoom() {
- return mAwSettings.supportZoom();
- }
-
- @Override
- public void setBuiltInZoomControls(boolean enabled) {
- if (TRACE) Log.d(LOGTAG, "setBuiltInZoomControls=" + enabled);
- mAwSettings.setBuiltInZoomControls(enabled);
- }
-
- @Override
- public boolean getBuiltInZoomControls() {
- return mAwSettings.getBuiltInZoomControls();
- }
-
- @Override
- public void setDisplayZoomControls(boolean enabled) {
- if (TRACE) Log.d(LOGTAG, "setDisplayZoomControls=" + enabled);
- mAwSettings.setDisplayZoomControls(enabled);
- }
-
- @Override
- public boolean getDisplayZoomControls() {
- return mAwSettings.getDisplayZoomControls();
- }
-
- @Override
- public void setAllowFileAccess(boolean allow) {
- if (TRACE) Log.d(LOGTAG, "setAllowFileAccess=" + allow);
- mAwSettings.setAllowFileAccess(allow);
- }
-
- @Override
- public boolean getAllowFileAccess() {
- return mAwSettings.getAllowFileAccess();
- }
-
- @Override
- public void setAllowContentAccess(boolean allow) {
- if (TRACE) Log.d(LOGTAG, "setAllowContentAccess=" + allow);
- mAwSettings.setAllowContentAccess(allow);
- }
-
- @Override
- public boolean getAllowContentAccess() {
- return mAwSettings.getAllowContentAccess();
- }
-
- @Override
- public void setLoadWithOverviewMode(boolean overview) {
- if (TRACE) Log.d(LOGTAG, "setLoadWithOverviewMode=" + overview);
- mAwSettings.setLoadWithOverviewMode(overview);
- }
-
- @Override
- public boolean getLoadWithOverviewMode() {
- return mAwSettings.getLoadWithOverviewMode();
- }
-
- @Override
- public void setAcceptThirdPartyCookies(boolean accept) {
- if (TRACE) Log.d(LOGTAG, "setAcceptThirdPartyCookies=" + accept);
- mAwSettings.setAcceptThirdPartyCookies(accept);
- }
-
- @Override
- public boolean getAcceptThirdPartyCookies() {
- return mAwSettings.getAcceptThirdPartyCookies();
- }
-
- @Override
- public void setEnableSmoothTransition(boolean enable) {
- // Intentional no-op.
- }
-
- @Override
- public boolean enableSmoothTransition() {
- // Intentional no-op.
- return false;
- }
-
- @Override
- public void setUseWebViewBackgroundForOverscrollBackground(boolean view) {
- // Intentional no-op.
- }
-
- @Override
- public boolean getUseWebViewBackgroundForOverscrollBackground() {
- // Intentional no-op.
- return false;
- }
-
- @Override
- public void setSaveFormData(boolean save) {
- if (TRACE) Log.d(LOGTAG, "setSaveFormData=" + save);
- mAwSettings.setSaveFormData(save);
- }
-
- @Override
- public boolean getSaveFormData() {
- return mAwSettings.getSaveFormData();
- }
-
- @Override
- public void setSavePassword(boolean save) {
- // Intentional no-op.
- }
-
- @Override
- public boolean getSavePassword() {
- // Intentional no-op.
- return false;
- }
-
- @Override
- public synchronized void setTextZoom(int textZoom) {
- if (TRACE) Log.d(LOGTAG, "setTextZoom=" + textZoom);
- mAwSettings.setTextZoom(textZoom);
- }
-
- @Override
- public synchronized int getTextZoom() {
- return mAwSettings.getTextZoom();
- }
-
- @Override
- public void setDefaultZoom(ZoomDensity zoom) {
- if (zoom != ZoomDensity.MEDIUM) {
- Log.w(LOGTAG, "setDefaultZoom not supported, zoom=" + zoom);
- }
- }
-
- @Override
- public ZoomDensity getDefaultZoom() {
- // Intentional no-op.
- return ZoomDensity.MEDIUM;
- }
-
- @Override
- public void setLightTouchEnabled(boolean enabled) {
- // Intentional no-op.
- }
-
- @Override
- public boolean getLightTouchEnabled() {
- // Intentional no-op.
- return false;
- }
-
- @Override
- public synchronized void setUserAgent(int ua) {
- // Minimal implementation for backwards compatibility: just supports resetting to default.
- if (ua == 0) {
- setUserAgentString(null);
- } else {
- Log.w(LOGTAG, "setUserAgent not supported, ua=" + ua);
- }
- }
-
- @Override
- public synchronized int getUserAgent() {
- // Minimal implementation for backwards compatibility: just identifies default vs custom.
- return AwSettings.getDefaultUserAgent().equals(getUserAgentString()) ? 0 : -1;
- }
-
- @Override
- public synchronized void setUseWideViewPort(boolean use) {
- if (TRACE) Log.d(LOGTAG, "setUseWideViewPort=" + use);
- mAwSettings.setUseWideViewPort(use);
- }
-
- @Override
- public synchronized boolean getUseWideViewPort() {
- return mAwSettings.getUseWideViewPort();
- }
-
- @Override
- public synchronized void setSupportMultipleWindows(boolean support) {
- if (TRACE) Log.d(LOGTAG, "setSupportMultipleWindows=" + support);
- mAwSettings.setSupportMultipleWindows(support);
- }
-
- @Override
- public synchronized boolean supportMultipleWindows() {
- return mAwSettings.supportMultipleWindows();
- }
-
- @Override
- public synchronized void setLayoutAlgorithm(LayoutAlgorithm l) {
- // TODO: Remove the upstream enum and mapping once the new value is in the public API.
- final AwSettings.LayoutAlgorithm[] chromiumValues = {
- AwSettings.LayoutAlgorithm.NORMAL,
- AwSettings.LayoutAlgorithm.SINGLE_COLUMN,
- AwSettings.LayoutAlgorithm.NARROW_COLUMNS,
- AwSettings.LayoutAlgorithm.TEXT_AUTOSIZING
- };
- mAwSettings.setLayoutAlgorithm(chromiumValues[l.ordinal()]);
- }
-
- @Override
- public synchronized LayoutAlgorithm getLayoutAlgorithm() {
- // TODO: Remove the upstream enum and mapping once the new value is in the public API.
- final LayoutAlgorithm[] webViewValues = {
- LayoutAlgorithm.NORMAL,
- LayoutAlgorithm.SINGLE_COLUMN,
- LayoutAlgorithm.NARROW_COLUMNS,
- LayoutAlgorithm.TEXT_AUTOSIZING
- };
- return webViewValues[mAwSettings.getLayoutAlgorithm().ordinal()];
- }
-
- @Override
- public synchronized void setStandardFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setStandardFontFamily=" + font);
- mAwSettings.setStandardFontFamily(font);
- }
-
- @Override
- public synchronized String getStandardFontFamily() {
- return mAwSettings.getStandardFontFamily();
- }
-
- @Override
- public synchronized void setFixedFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setFixedFontFamily=" + font);
- mAwSettings.setFixedFontFamily(font);
- }
-
- @Override
- public synchronized String getFixedFontFamily() {
- return mAwSettings.getFixedFontFamily();
- }
-
- @Override
- public synchronized void setSansSerifFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setSansSerifFontFamily=" + font);
- mAwSettings.setSansSerifFontFamily(font);
- }
-
- @Override
- public synchronized String getSansSerifFontFamily() {
- return mAwSettings.getSansSerifFontFamily();
- }
-
- @Override
- public synchronized void setSerifFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setSerifFontFamily=" + font);
- mAwSettings.setSerifFontFamily(font);
- }
-
- @Override
- public synchronized String getSerifFontFamily() {
- return mAwSettings.getSerifFontFamily();
- }
-
- @Override
- public synchronized void setCursiveFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setCursiveFontFamily=" + font);
- mAwSettings.setCursiveFontFamily(font);
- }
-
- @Override
- public synchronized String getCursiveFontFamily() {
- return mAwSettings.getCursiveFontFamily();
- }
-
- @Override
- public synchronized void setFantasyFontFamily(String font) {
- if (TRACE) Log.d(LOGTAG, "setFantasyFontFamily=" + font);
- mAwSettings.setFantasyFontFamily(font);
- }
-
- @Override
- public synchronized String getFantasyFontFamily() {
- return mAwSettings.getFantasyFontFamily();
- }
-
- @Override
- public synchronized void setMinimumFontSize(int size) {
- if (TRACE) Log.d(LOGTAG, "setMinimumFontSize=" + size);
- mAwSettings.setMinimumFontSize(size);
- }
-
- @Override
- public synchronized int getMinimumFontSize() {
- return mAwSettings.getMinimumFontSize();
- }
-
- @Override
- public synchronized void setMinimumLogicalFontSize(int size) {
- if (TRACE) Log.d(LOGTAG, "setMinimumLogicalFontSize=" + size);
- mAwSettings.setMinimumLogicalFontSize(size);
- }
-
- @Override
- public synchronized int getMinimumLogicalFontSize() {
- return mAwSettings.getMinimumLogicalFontSize();
- }
-
- @Override
- public synchronized void setDefaultFontSize(int size) {
- if (TRACE) Log.d(LOGTAG, "setDefaultFontSize=" + size);
- mAwSettings.setDefaultFontSize(size);
- }
-
- @Override
- public synchronized int getDefaultFontSize() {
- return mAwSettings.getDefaultFontSize();
- }
-
- @Override
- public synchronized void setDefaultFixedFontSize(int size) {
- if (TRACE) Log.d(LOGTAG, "setDefaultFixedFontSize=" + size);
- mAwSettings.setDefaultFixedFontSize(size);
- }
-
- @Override
- public synchronized int getDefaultFixedFontSize() {
- return mAwSettings.getDefaultFixedFontSize();
- }
-
- @Override
- public synchronized void setLoadsImagesAutomatically(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setLoadsImagesAutomatically=" + flag);
- mAwSettings.setLoadsImagesAutomatically(flag);
- }
-
- @Override
- public synchronized boolean getLoadsImagesAutomatically() {
- return mAwSettings.getLoadsImagesAutomatically();
- }
-
- @Override
- public synchronized void setBlockNetworkImage(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setBlockNetworkImage=" + flag);
- mAwSettings.setImagesEnabled(!flag);
- }
-
- @Override
- public synchronized boolean getBlockNetworkImage() {
- return !mAwSettings.getImagesEnabled();
- }
-
- @Override
- public synchronized void setBlockNetworkLoads(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setBlockNetworkLoads=" + flag);
- mAwSettings.setBlockNetworkLoads(flag);
- }
-
- @Override
- public synchronized boolean getBlockNetworkLoads() {
- return mAwSettings.getBlockNetworkLoads();
- }
-
- @Override
- public synchronized void setJavaScriptEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setJavaScriptEnabled=" + flag);
- mAwSettings.setJavaScriptEnabled(flag);
- }
-
- @Override
- public void setAllowUniversalAccessFromFileURLs(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setAllowUniversalAccessFromFileURLs=" + flag);
- mAwSettings.setAllowUniversalAccessFromFileURLs(flag);
- }
-
- @Override
- public void setAllowFileAccessFromFileURLs(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setAllowFileAccessFromFileURLs=" + flag);
- mAwSettings.setAllowFileAccessFromFileURLs(flag);
- }
-
- @Override
- public synchronized void setPluginsEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setPluginsEnabled=" + flag);
- mAwSettings.setPluginsEnabled(flag);
- }
-
- @Override
- public synchronized void setPluginState(PluginState state) {
- if (TRACE) Log.d(LOGTAG, "setPluginState=" + state);
- mAwSettings.setPluginState(state);
- }
-
- @Override
- public synchronized void setDatabasePath(String databasePath) {
- // Intentional no-op.
- }
-
- @Override
- public synchronized void setGeolocationDatabasePath(String databasePath) {
- // Intentional no-op.
- }
-
- @Override
- public synchronized void setAppCacheEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setAppCacheEnabled=" + flag);
- mAwSettings.setAppCacheEnabled(flag);
- }
-
- @Override
- public synchronized void setAppCachePath(String appCachePath) {
- if (TRACE) Log.d(LOGTAG, "setAppCachePath=" + appCachePath);
- mAwSettings.setAppCachePath(appCachePath);
- }
-
- @Override
- public synchronized void setAppCacheMaxSize(long appCacheMaxSize) {
- // Intentional no-op.
- }
-
- @Override
- public synchronized void setDatabaseEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setDatabaseEnabled=" + flag);
- mAwSettings.setDatabaseEnabled(flag);
- }
-
- @Override
- public synchronized void setDomStorageEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setDomStorageEnabled=" + flag);
- mAwSettings.setDomStorageEnabled(flag);
- }
-
- @Override
- public synchronized boolean getDomStorageEnabled() {
- return mAwSettings.getDomStorageEnabled();
- }
-
- @Override
- public synchronized String getDatabasePath() {
- // Intentional no-op.
- return "";
- }
-
- @Override
- public synchronized boolean getDatabaseEnabled() {
- return mAwSettings.getDatabaseEnabled();
- }
-
- @Override
- public synchronized void setGeolocationEnabled(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setGeolocationEnabled=" + flag);
- mAwSettings.setGeolocationEnabled(flag);
- }
-
- @Override
- public synchronized boolean getJavaScriptEnabled() {
- return mAwSettings.getJavaScriptEnabled();
- }
-
- @Override
- public boolean getAllowUniversalAccessFromFileURLs() {
- return mAwSettings.getAllowUniversalAccessFromFileURLs();
- }
-
- @Override
- public boolean getAllowFileAccessFromFileURLs() {
- return mAwSettings.getAllowFileAccessFromFileURLs();
- }
-
- @Override
- public synchronized boolean getPluginsEnabled() {
- return mAwSettings.getPluginsEnabled();
- }
-
- @Override
- public synchronized PluginState getPluginState() {
- return mAwSettings.getPluginState();
- }
-
- @Override
- public synchronized void setJavaScriptCanOpenWindowsAutomatically(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setJavaScriptCanOpenWindowsAutomatically=" + flag);
- mAwSettings.setJavaScriptCanOpenWindowsAutomatically(flag);
- }
-
- @Override
- public synchronized boolean getJavaScriptCanOpenWindowsAutomatically() {
- return mAwSettings.getJavaScriptCanOpenWindowsAutomatically();
- }
-
- @Override
- public synchronized void setDefaultTextEncodingName(String encoding) {
- if (TRACE) Log.d(LOGTAG, "setDefaultTextEncodingName=" + encoding);
- mAwSettings.setDefaultTextEncodingName(encoding);
- }
-
- @Override
- public synchronized String getDefaultTextEncodingName() {
- return mAwSettings.getDefaultTextEncodingName();
- }
-
- @Override
- public synchronized void setUserAgentString(String ua) {
- if (TRACE) Log.d(LOGTAG, "setUserAgentString=" + ua);
- mAwSettings.setUserAgentString(ua);
- }
-
- @Override
- public synchronized String getUserAgentString() {
- return mAwSettings.getUserAgentString();
- }
-
- @Override
- public void setNeedInitialFocus(boolean flag) {
- if (TRACE) Log.d(LOGTAG, "setNeedInitialFocus=" + flag);
- mAwSettings.setShouldFocusFirstNode(flag);
- }
-
- @Override
- public synchronized void setRenderPriority(RenderPriority priority) {
- // Intentional no-op.
- }
-
- @Override
- public void setCacheMode(int mode) {
- if (TRACE) Log.d(LOGTAG, "setCacheMode=" + mode);
- mAwSettings.setCacheMode(mode);
- }
-
- @Override
- public int getCacheMode() {
- return mAwSettings.getCacheMode();
- }
-
- @Override
- public void setMediaPlaybackRequiresUserGesture(boolean require) {
- if (TRACE) Log.d(LOGTAG, "setMediaPlaybackRequiresUserGesture=" + require);
- mAwSettings.setMediaPlaybackRequiresUserGesture(require);
- }
-
- @Override
- public boolean getMediaPlaybackRequiresUserGesture() {
- return mAwSettings.getMediaPlaybackRequiresUserGesture();
- }
-
-// @Override
- public void setMixedContentMode(int mode) {
- mAwSettings.setMixedContentMode(mode);
- }
-
-// @Override
- public int getMixedContentMode() {
- return mAwSettings.getMixedContentMode();
- }
-
-// @Override
- public void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean flag) {
- mAwSettings.setVideoOverlayForEmbeddedVideoEnabled(flag);
- }
-
-// @Override
- public boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled() {
- return mAwSettings.getVideoOverlayForEmbeddedVideoEnabled();
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/CookieManagerAdapter.java b/chromium/java/com/android/webview/chromium/CookieManagerAdapter.java
deleted file mode 100644
index 2dd34a3..0000000
--- a/chromium/java/com/android/webview/chromium/CookieManagerAdapter.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.net.ParseException;
-import android.net.WebAddress;
-import android.util.Log;
-import android.webkit.CookieManager;
-import android.webkit.ValueCallback;
-import android.webkit.WebView;
-
-import org.chromium.android_webview.AwCookieManager;
-
-public class CookieManagerAdapter extends CookieManager {
-
- private static final String LOGTAG = "CookieManager";
-
- AwCookieManager mChromeCookieManager;
-
- public CookieManagerAdapter(AwCookieManager chromeCookieManager) {
- mChromeCookieManager = chromeCookieManager;
- }
-
- @Override
- public synchronized void setAcceptCookie(boolean accept) {
- mChromeCookieManager.setAcceptCookie(accept);
- }
-
- @Override
- public synchronized boolean acceptCookie() {
- return mChromeCookieManager.acceptCookie();
- }
-
- @Override
- public synchronized void setAcceptThirdPartyCookies(WebView webView, boolean accept) {
- webView.getSettings().setAcceptThirdPartyCookies(accept);
- }
-
- @Override
- public synchronized boolean acceptThirdPartyCookies(WebView webView) {
- return webView.getSettings().getAcceptThirdPartyCookies();
- }
-
- @Override
- public void setCookie(String url, String value) {
- try {
- mChromeCookieManager.setCookie(fixupUrl(url), value);
- } catch (ParseException e) {
- Log.e(LOGTAG, "Not setting cookie due to error parsing URL: " + url, e);
- }
- }
-
- @Override
- public void setCookie(String url, String value, ValueCallback<Boolean> callback) {
- try {
- mChromeCookieManager.setCookie(fixupUrl(url), value, callback);
- } catch (ParseException e) {
- Log.e(LOGTAG, "Not setting cookie due to error parsing URL: " + url, e);
- }
- }
-
- @Override
- public String getCookie(String url) {
- try {
- return mChromeCookieManager.getCookie(fixupUrl(url));
- } catch (ParseException e) {
- Log.e(LOGTAG, "Unable to get cookies due to error parsing URL: " + url, e);
- return null;
- }
- }
-
- @Override
- public String getCookie(String url, boolean privateBrowsing) {
- return getCookie(url);
- }
-
- // TODO(igsolla): remove this override once the WebView apk does not longer need
- // to be binary compatibility with the API 21 version of the framework
- /**
- * IMPORTANT: This override is required for compatibility with the API 21 version of
- * {@link CookieManager}.
- */
- @Override
- public synchronized String getCookie(WebAddress uri) {
- return mChromeCookieManager.getCookie(uri.toString());
- }
-
- @Override
- public void removeSessionCookie() {
- mChromeCookieManager.removeSessionCookies();
- }
-
- @Override
- public void removeSessionCookies(ValueCallback<Boolean> callback) {
- mChromeCookieManager.removeSessionCookies(callback);
- }
-
- @Override
- public void removeAllCookie() {
- mChromeCookieManager.removeAllCookies();
- }
-
- @Override
- public void removeAllCookies(ValueCallback<Boolean> callback) {
- mChromeCookieManager.removeAllCookies(callback);
- }
-
- @Override
- public synchronized boolean hasCookies() {
- return mChromeCookieManager.hasCookies();
- }
-
- @Override
- public synchronized boolean hasCookies(boolean privateBrowsing) {
- return mChromeCookieManager.hasCookies();
- }
-
- @Override
- public void removeExpiredCookie() {
- mChromeCookieManager.removeExpiredCookie();
- }
-
- @Override
- public void flush() {
- mChromeCookieManager.flushCookieStore();
- }
-
- @Override
- protected boolean allowFileSchemeCookiesImpl() {
- return mChromeCookieManager.allowFileSchemeCookies();
- }
-
- @Override
- protected void setAcceptFileSchemeCookiesImpl(boolean accept) {
- mChromeCookieManager.setAcceptFileSchemeCookies(accept);
- }
-
- private static String fixupUrl(String url) throws ParseException {
- // WebAddress is a private API in the android framework and a "quirk"
- // of the Classic WebView implementation that allowed embedders to
- // be relaxed about what URLs they passed into the CookieManager, so we
- // do the same normalisation before entering the chromium stack.
- return new WebAddress(url).toString();
- }
-
-}
diff --git a/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java b/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java
deleted file mode 100644
index aafd41e..0000000
--- a/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.BroadcastReceiver;
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.database.ContentObserver;
-import android.database.Cursor;
-import android.database.SQLException;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.os.Handler;
-import android.provider.Settings;
-import android.util.Log;
-import android.webkit.WebView;
-
-import org.chromium.android_webview.AwContentsStatics;
-import org.chromium.base.CommandLine;
-
-import java.lang.reflect.Field;
-
-/**
- * Controls data reduction proxy. This logic will be moved to upstream fully.
- */
-public final class DataReductionProxyManager {
-
- // The setting Uri. Used when querying GoogleSettings.
- private static final Uri CONTENT_URI = Uri.parse("content://com.google.settings/partner");
-
- // Setting name for allowing data reduction proxy. Used when querying GoogleSettings.
- // Setting type: int ( 0 = disallow, 1 = allow )
- private static final String WEBVIEW_DATA_REDUCTION_PROXY = "use_webview_data_reduction_proxy";
-
- private static final String DRP_CLASS = "com.android.webview.chromium.Drp";
- private static final String TAG = "DataReductionProxySettingListener";
-
- // This is the same as Chromium data_reduction_proxy::switches::kEnableDataReductionProxy.
- private static final String ENABLE_DATA_REDUCTION_PROXY = "enable-spdy-proxy-auth";
- // This is the same as Chromium data_reduction_proxy::switches::kDataReductionProxyKey.
- private static final String DATA_REDUCTION_PROXY_KEY = "spdy-proxy-auth-value";
-
- /*
- * Listen for DataReductionProxySetting changes and take action.
- * TODO: This is the old mechanism. Will be obsolete after L release.
- * remove before release.
- */
- private static final class ProxySettingListener extends BroadcastReceiver {
-
- final String mKey;
-
- ProxySettingListener(final String key) {
- mKey = key;
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- applyDataReductionProxySettingsAsync(context, mKey);
- }
- }
-
- private ProxySettingListener mProxySettingListener;
-
- private ContentObserver mProxySettingObserver;
-
- public DataReductionProxyManager() { }
-
- public void start(final Context context) {
- // This is the DRP key embedded in WebView apk.
- final String embeddedKey = readKey();
-
- // Developers could test DRP by passing ENABLE_DATA_REDUCTION_PROXY and (optionally)
- // DATA_REDUCTION_PROXY_KEY to the commandline switches. In this case, we will try to
- // initialize DRP from commandline. And ignore user's preference. If
- // DATA_REDUCTION_PROXY_KEY is specified in commandline, use it. Otherwise, use the key
- // embedded in WebView apk.
- CommandLine cl = CommandLine.getInstance();
- if (cl.hasSwitch(ENABLE_DATA_REDUCTION_PROXY)) {
- String key = cl.getSwitchValue(DATA_REDUCTION_PROXY_KEY, embeddedKey);
- if (key == null || key.isEmpty()) {
- return;
- }
-
- // Now we will enable DRP because we've got a commandline switch to enable it.
- // We won't listen to Google Settings preference change because commandline switches
- // trump that.
- AwContentsStatics.setDataReductionProxyKey(key);
- AwContentsStatics.setDataReductionProxyEnabled(true);
- return;
- }
-
- // Now, there is no commandline switches to enable DRP, and reading the
- // DRP key from WebView apk failed. Just return and leave DRP disabled.
- if (embeddedKey == null || embeddedKey.isEmpty()) {
- return;
- }
-
- applyDataReductionProxySettingsAsync(context, embeddedKey);
- IntentFilter filter = new IntentFilter();
- filter.addAction(WebView.DATA_REDUCTION_PROXY_SETTING_CHANGED);
- mProxySettingListener = new ProxySettingListener(embeddedKey);
- context.registerReceiver(mProxySettingListener, filter);
- ContentResolver resolver = context.getContentResolver();
- mProxySettingObserver = new ContentObserver(new Handler()) {
- @Override
- public void onChange(boolean selfChange, Uri uri) {
- applyDataReductionProxySettingsAsync(context, embeddedKey);
- }
- };
- resolver.registerContentObserver(
- Uri.withAppendedPath(CONTENT_URI, WEBVIEW_DATA_REDUCTION_PROXY),
- false, mProxySettingObserver);
- }
-
- private String readKey() {
- try {
- Class<?> cls = Class.forName(DRP_CLASS);
- Field f = cls.getField("KEY");
- return (String) f.get(null);
- } catch (ClassNotFoundException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- } catch (NoSuchFieldException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- } catch (SecurityException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- } catch (IllegalArgumentException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- } catch (IllegalAccessException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- } catch (NullPointerException ex) {
- Log.e(TAG, "No DRP key due to exception:" + ex);
- }
- return null;
- }
-
- private static void applyDataReductionProxySettingsAsync(final Context context,
- final String key) {
- AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>() {
- @Override
- protected Boolean doInBackground(Void... params) {
- return isDataReductionProxyEnabled(context);
- }
- @Override
- protected void onPostExecute(Boolean enabled) {
- if (enabled) {
- // Set the data reduction proxy key.
- AwContentsStatics.setDataReductionProxyKey(key);
- }
- AwContentsStatics.setDataReductionProxyEnabled(enabled);
- }
- };
- task.execute();
- }
-
- private static boolean isDataReductionProxyEnabled(Context context) {
- return getProxySetting(context.getContentResolver(),
- WEBVIEW_DATA_REDUCTION_PROXY) != 0;
- }
-
- // Read query setting from GoogleSettings.
- private static int getProxySetting(ContentResolver resolver, String name) {
- String value = null;
- Cursor c = null;
- try {
- c = resolver.query(CONTENT_URI, new String[] { "value" },
- "name=?", new String[]{ name }, null);
- if (c != null && c.moveToNext()) value = c.getString(0);
- } catch (SQLException e) {
- // SQL error: return null, but don't cache it.
- Log.e(TAG, "Can't get key " + name + " from " + CONTENT_URI, e);
- } finally {
- if (c != null) c.close();
- }
- int enabled = 0;
- try {
- if (value != null) {
- enabled = Integer.parseInt(value);
- }
- } catch (NumberFormatException e) {
- Log.e(TAG, "cannot parse" + value, e);
- }
- return enabled;
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java b/chromium/java/com/android/webview/chromium/DrawGLFunctor.java
deleted file mode 100644
index 7805077..0000000
--- a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.view.View;
-import android.graphics.Canvas;
-import android.util.Log;
-
-import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate;
-
-import org.chromium.content.common.CleanupReference;
-
-// Simple Java abstraction and wrapper for the native DrawGLFunctor flow.
-// An instance of this class can be constructed, bound to a single view context (i.e. AwContennts)
-// and then drawn and detached from the view tree any number of times (using requestDrawGL and
-// detach respectively). Then when finished with, it can be explicitly released by calling
-// destroy() or will clean itself up as required via finalizer / CleanupReference.
-class DrawGLFunctor {
-
- private static final String TAG = DrawGLFunctor.class.getSimpleName();
-
- // Pointer to native side instance
- private CleanupReference mCleanupReference;
- private DestroyRunnable mDestroyRunnable;
- private WebViewDelegate mWebViewDelegate;
-
- public DrawGLFunctor(long viewContext, WebViewDelegate webViewDelegate) {
- mDestroyRunnable = new DestroyRunnable(nativeCreateGLFunctor(viewContext), webViewDelegate);
- mCleanupReference = new CleanupReference(this, mDestroyRunnable);
- mWebViewDelegate = webViewDelegate;
- }
-
- public void destroy() {
- detach();
- if (mCleanupReference != null) {
- mCleanupReference.cleanupNow();
- mCleanupReference = null;
- mDestroyRunnable = null;
- mWebViewDelegate = null;
- }
- }
-
- public void detach() {
- mDestroyRunnable.detachNativeFunctor();
- }
-
- public boolean requestDrawGL(Canvas canvas, View containerView,
- boolean waitForCompletion) {
- if (mDestroyRunnable.mNativeDrawGLFunctor == 0) {
- throw new RuntimeException("requested DrawGL on already destroyed DrawGLFunctor");
- }
-
- if (canvas != null && waitForCompletion) {
- throw new IllegalArgumentException("requested a blocking DrawGL with a not null canvas.");
- }
-
- if (!mWebViewDelegate.canInvokeDrawGlFunctor(containerView)) {
- return false;
- }
-
- mDestroyRunnable.mContainerView = containerView;
-
- if (canvas == null) {
- mWebViewDelegate.invokeDrawGlFunctor(containerView,
- mDestroyRunnable.mNativeDrawGLFunctor, waitForCompletion);
- return true;
- }
-
- mWebViewDelegate.callDrawGlFunction(canvas, mDestroyRunnable.mNativeDrawGLFunctor);
- return true;
- }
-
- public static void setChromiumAwDrawGLFunction(long functionPointer) {
- nativeSetChromiumAwDrawGLFunction(functionPointer);
- }
-
- // Holds the core resources of the class, everything required to correctly cleanup.
- // IMPORTANT: this class must not hold any reference back to the outer DrawGLFunctor
- // instance, as that will defeat GC of that object.
- private static final class DestroyRunnable implements Runnable {
- private WebViewDelegate mWebViewDelegate;
- View mContainerView;
- long mNativeDrawGLFunctor;
- DestroyRunnable(long nativeDrawGLFunctor, WebViewDelegate webViewDelegate) {
- mNativeDrawGLFunctor = nativeDrawGLFunctor;
- mWebViewDelegate = webViewDelegate;
- }
-
- // Called when the outer DrawGLFunctor instance has been GC'ed, i.e this is its finalizer.
- @Override
- public void run() {
- detachNativeFunctor();
- nativeDestroyGLFunctor(mNativeDrawGLFunctor);
- mNativeDrawGLFunctor = 0;
- }
-
- void detachNativeFunctor() {
- if (mNativeDrawGLFunctor != 0 && mContainerView != null
- && mWebViewDelegate != null) {
- mWebViewDelegate.detachDrawGlFunctor(mContainerView, mNativeDrawGLFunctor);
- }
- mContainerView = null;
- mWebViewDelegate = null;
- }
- }
-
- private static native long nativeCreateGLFunctor(long viewContext);
- private static native void nativeDestroyGLFunctor(long functor);
- private static native void nativeSetChromiumAwDrawGLFunction(long functionPointer);
-}
diff --git a/chromium/java/com/android/webview/chromium/FileChooserParamsAdapter.java b/chromium/java/com/android/webview/chromium/FileChooserParamsAdapter.java
deleted file mode 100644
index 07222f2..0000000
--- a/chromium/java/com/android/webview/chromium/FileChooserParamsAdapter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.webkit.WebChromeClient.FileChooserParams;
-
-import org.chromium.android_webview.AwContentsClient;
-
-public class FileChooserParamsAdapter extends FileChooserParams {
- private AwContentsClient.FileChooserParams mParams;
-
- public static Uri[] parseFileChooserResult(int resultCode, Intent intent) {
- if (resultCode == Activity.RESULT_CANCELED) {
- return null;
- }
- Uri result = intent == null || resultCode != Activity.RESULT_OK ? null
- : intent.getData();
-
- Uri[] uris = null;
- if (result != null) {
- uris = new Uri[1];
- uris[0] = result;
- }
- return uris;
- }
-
- FileChooserParamsAdapter(AwContentsClient.FileChooserParams params, Context context) {
- mParams = params;
- }
-
- @Override
- public int getMode() {
- return mParams.mode;
- }
-
- @Override
- public String[] getAcceptTypes() {
- if (mParams.acceptTypes == null)
- return new String[0];
- return mParams.acceptTypes.split(";");
- }
-
- @Override
- public boolean isCaptureEnabled() {
- return mParams.capture;
- }
-
- @Override
- public CharSequence getTitle() {
- return mParams.title;
- }
-
- @Override
- public String getFilenameHint() {
- return mParams.defaultFilename;
- }
-
- @Override
- public Intent createIntent() {
- // TODO: Move this code to Aw. Once code is moved
- // and merged to M37 get rid of this.
- String mimeType = "*/*";
- if (mParams.acceptTypes != null && !mParams.acceptTypes.trim().isEmpty())
- mimeType = mParams.acceptTypes.split(";")[0];
-
- Intent i = new Intent(Intent.ACTION_GET_CONTENT);
- i.addCategory(Intent.CATEGORY_OPENABLE);
- i.setType(mimeType);
- return i;
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/GeolocationPermissionsAdapter.java b/chromium/java/com/android/webview/chromium/GeolocationPermissionsAdapter.java
deleted file mode 100644
index 7c0499b..0000000
--- a/chromium/java/com/android/webview/chromium/GeolocationPermissionsAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.webkit.GeolocationPermissions;
-import android.webkit.ValueCallback;
-
-import org.chromium.android_webview.AwGeolocationPermissions;
-
-import java.util.Set;
-
-/**
- * Chromium implementation of GeolocationPermissions -- forwards calls to the
- * chromium internal implementation.
- */
-final class GeolocationPermissionsAdapter extends GeolocationPermissions {
-
- private AwGeolocationPermissions mChromeGeolocationPermissions;
-
- public GeolocationPermissionsAdapter(AwGeolocationPermissions chromeGeolocationPermissions) {
- mChromeGeolocationPermissions = chromeGeolocationPermissions;
- }
-
- @Override
- public void allow(String origin) {
- mChromeGeolocationPermissions.allow(origin);
- }
-
- @Override
- public void clear(String origin) {
- mChromeGeolocationPermissions.clear(origin);
- }
-
- @Override
- public void clearAll() {
- mChromeGeolocationPermissions.clearAll();
- }
-
- @Override
- public void getAllowed(String origin, ValueCallback<Boolean> callback) {
- mChromeGeolocationPermissions.getAllowed(origin, callback);
- }
-
- @Override
- public void getOrigins(ValueCallback<Set<String>> callback) {
- mChromeGeolocationPermissions.getOrigins(callback);
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/GraphicsUtils.java b/chromium/java/com/android/webview/chromium/GraphicsUtils.java
deleted file mode 100644
index 66c3f75..0000000
--- a/chromium/java/com/android/webview/chromium/GraphicsUtils.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-abstract class GraphicsUtils {
- public static long getDrawSWFunctionTable() {
- return nativeGetDrawSWFunctionTable();
- }
-
- public static long getDrawGLFunctionTable() {
- return nativeGetDrawGLFunctionTable();
- }
-
- private static native long nativeGetDrawSWFunctionTable();
- private static native long nativeGetDrawGLFunctionTable();
-
-}
diff --git a/chromium/java/com/android/webview/chromium/ResourceRewriter.java b/chromium/java/com/android/webview/chromium/ResourceRewriter.java
deleted file mode 100644
index 7d035b7..0000000
--- a/chromium/java/com/android/webview/chromium/ResourceRewriter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.Context;
-
-/**
- * Helper class used to fix up resource ids.
- * This is mostly a copy of the code in frameworks/base/core/java/android/app/LoadedApk.java.
- * TODO: Remove if a cleaner mechanism is provided (either public API or AAPT is changed to generate
- * this code).
- */
-class ResourceRewriter {
-
- /**
- * Rewrite the R 'constants' for the WebView library apk.
- */
- public static void rewriteRValues(final int packageId) {
- // TODO: We should use jarjar to remove the redundant R classes here, but due
- // to a bug in jarjar it's not possible to rename classes with '$' in their name.
- // See b/15684775.
- com.android.webview.chromium.R.onResourcesLoaded(packageId);
- org.chromium.ui.R.onResourcesLoaded(packageId);
- org.chromium.content.R.onResourcesLoaded(packageId);
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/UnimplementedWebViewApi.java b/chromium/java/com/android/webview/chromium/UnimplementedWebViewApi.java
deleted file mode 100644
index e3ad83c..0000000
--- a/chromium/java/com/android/webview/chromium/UnimplementedWebViewApi.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.util.Log;
-
-// TODO: remove this when all WebView APIs have been implemented.
-public class UnimplementedWebViewApi {
- private static String TAG = "UnimplementedWebViewApi";
-
- private static class UnimplementedWebViewApiException extends UnsupportedOperationException {
- public UnimplementedWebViewApiException() {
- super();
- }
- }
-
- private static boolean THROW = false;
- // By default we keep the traces down to one frame to reduce noise, but for debugging it might
- // be useful to set this to true.
- private static boolean FULL_TRACE = false;
-
- public static void invoke() throws UnimplementedWebViewApiException {
- if (THROW) {
- throw new UnimplementedWebViewApiException();
- } else {
- if (FULL_TRACE) {
- Log.w(TAG, "Unimplemented WebView method called in: " +
- Log.getStackTraceString(new Throwable()));
- } else {
- StackTraceElement[] trace = new Throwable().getStackTrace();
- // The stack trace [0] index is this method (invoke()).
- StackTraceElement unimplementedMethod = trace[1];
- StackTraceElement caller = trace[2];
- Log.w(TAG, "Unimplemented WebView method " + unimplementedMethod.getMethodName() +
- " called from: " + caller.toString());
- }
- }
- }
-
-}
diff --git a/chromium/java/com/android/webview/chromium/WebBackForwardListChromium.java b/chromium/java/com/android/webview/chromium/WebBackForwardListChromium.java
deleted file mode 100644
index b584ee9..0000000
--- a/chromium/java/com/android/webview/chromium/WebBackForwardListChromium.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import org.chromium.content_public.browser.NavigationHistory;
-
-import android.webkit.WebBackForwardList;
-import android.webkit.WebHistoryItem;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * WebView Chromium implementation of WebBackForwardList. Simple immutable
- * wrapper around NavigationHistory.
- */
-public class WebBackForwardListChromium extends WebBackForwardList {
- private final List<WebHistoryItemChromium> mHistroryItemList;
- private final int mCurrentIndex;
-
- /* package */ WebBackForwardListChromium(NavigationHistory nav_history) {
- mCurrentIndex = nav_history.getCurrentEntryIndex();
- mHistroryItemList = new ArrayList<WebHistoryItemChromium>(nav_history.getEntryCount());
- for (int i = 0; i < nav_history.getEntryCount(); ++i) {
- mHistroryItemList.add(
- new WebHistoryItemChromium(nav_history.getEntryAtIndex(i)));
- }
- }
-
- /**
- * See {@link android.webkit.WebBackForwardList#getCurrentItem}.
- */
- @Override
- public synchronized WebHistoryItem getCurrentItem() {
- if (getSize() == 0) {
- return null;
- } else {
- return getItemAtIndex(getCurrentIndex());
- }
- }
-
- /**
- * See {@link android.webkit.WebBackForwardList#getCurrentIndex}.
- */
- @Override
- public synchronized int getCurrentIndex() {
- return mCurrentIndex;
- }
-
- /**
- * See {@link android.webkit.WebBackForwardList#getItemAtIndex}.
- */
- @Override
- public synchronized WebHistoryItem getItemAtIndex(int index) {
- if (index < 0 || index >= getSize()) {
- return null;
- } else {
- return mHistroryItemList.get(index);
- }
- }
-
- /**
- * See {@link android.webkit.WebBackForwardList#getSize}.
- */
- @Override
- public synchronized int getSize() {
- return mHistroryItemList.size();
- }
-
- // Clone constructor.
- private WebBackForwardListChromium(List<WebHistoryItemChromium> list,
- int currentIndex) {
- mHistroryItemList = list;
- mCurrentIndex = currentIndex;
- }
-
- /**
- * See {@link android.webkit.WebBackForwardList#clone}.
- */
- @Override
- protected synchronized WebBackForwardListChromium clone() {
- List<WebHistoryItemChromium> list =
- new ArrayList<WebHistoryItemChromium>(getSize());
- for (int i = 0; i < getSize(); ++i) {
- list.add(mHistroryItemList.get(i).clone());
- }
- return new WebBackForwardListChromium(list, mCurrentIndex);
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebHistoryItemChromium.java b/chromium/java/com/android/webview/chromium/WebHistoryItemChromium.java
deleted file mode 100644
index e36384b..0000000
--- a/chromium/java/com/android/webview/chromium/WebHistoryItemChromium.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import org.chromium.content_public.browser.NavigationEntry;
-
-import android.graphics.Bitmap;
-import android.webkit.WebHistoryItem;
-
-/**
- * WebView Chromium implementation of WebHistoryItem. Simple immutable wrapper
- * around NavigationEntry
- */
-public class WebHistoryItemChromium extends WebHistoryItem {
- private final String mUrl;
- private final String mOriginalUrl;
- private final String mTitle;
- private final Bitmap mFavicon;
-
- /* package */ WebHistoryItemChromium(NavigationEntry entry) {
- mUrl = entry.getUrl();
- mOriginalUrl = entry.getOriginalUrl();
- mTitle = entry.getTitle();
- mFavicon = entry.getFavicon();
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#getId}.
- */
- @Override
- public int getId() {
- // This method is deprecated in superclass. Returning constant -1 now.
- return -1;
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#getUrl}.
- */
- @Override
- public String getUrl() {
- return mUrl;
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#getOriginalUrl}.
- */
- @Override
- public String getOriginalUrl() {
- return mOriginalUrl;
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#getTitle}.
- */
- @Override
- public String getTitle() {
- return mTitle;
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#getFavicon}.
- */
- @Override
- public Bitmap getFavicon() {
- return mFavicon;
- }
-
- // Clone constructor.
- private WebHistoryItemChromium(
- String url, String originalUrl, String title, Bitmap favicon) {
- mUrl = url;
- mOriginalUrl = originalUrl;
- mTitle = title;
- mFavicon = favicon;
- }
-
- /**
- * See {@link android.webkit.WebHistoryItem#clone}.
- */
- @Override
- public synchronized WebHistoryItemChromium clone() {
- return new WebHistoryItemChromium(mUrl, mOriginalUrl, mTitle, mFavicon);
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java b/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java
deleted file mode 100644
index c8af220..0000000
--- a/chromium/java/com/android/webview/chromium/WebIconDatabaseAdapter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-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) {
- AwContents.setShouldDownloadFavicons();
- }
-
- @Override
- public void close() {
- // Intentional no-op.
- }
-
- @Override
- public void removeAllIcons() {
- // Intentional no-op: we have no database so nothing to remove.
- }
-
- @Override
- public void requestIconForPageUrl(String url, IconListener listener) {
- // Intentional no-op.
- }
-
- @Override
- public void bulkRequestIconForPageUrl(ContentResolver cr, String where,
- IconListener listener) {
- // Intentional no-op: hidden in base class.
- }
-
- @Override
- public void retainIconForPageUrl(String url) {
- // Intentional no-op.
- }
-
- @Override
- public void releaseIconForPageUrl(String url) {
- // Intentional no-op.
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebStorageAdapter.java b/chromium/java/com/android/webview/chromium/WebStorageAdapter.java
deleted file mode 100644
index 13b34dd..0000000
--- a/chromium/java/com/android/webview/chromium/WebStorageAdapter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.webkit.ValueCallback;
-import android.webkit.WebStorage;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.chromium.android_webview.AwQuotaManagerBridge;
-
-/**
- * Chromium implementation of WebStorage -- forwards calls to the
- * chromium internal implementation.
- */
-final class WebStorageAdapter extends WebStorage {
- private final AwQuotaManagerBridge mQuotaManagerBridge;
- WebStorageAdapter(AwQuotaManagerBridge quotaManagerBridge) {
- mQuotaManagerBridge = quotaManagerBridge;
- }
-
- @Override
- public void getOrigins(final ValueCallback<Map> callback) {
- mQuotaManagerBridge.getOrigins(new ValueCallback<AwQuotaManagerBridge.Origins>() {
- @Override
- public void onReceiveValue(AwQuotaManagerBridge.Origins origins) {
- Map<String, Origin> originsMap = new HashMap<String, Origin>();
- for (int i = 0; i < origins.mOrigins.length; ++i) {
- Origin origin = new Origin(origins.mOrigins[i], origins.mQuotas[i],
- origins.mUsages[i]) {
- // Intentionally empty to work around cross-package protected visibility
- // of Origin constructor.
- };
- originsMap.put(origins.mOrigins[i], origin);
- }
- callback.onReceiveValue(originsMap);
- }
- });
- }
-
- @Override
- public void getUsageForOrigin(String origin, ValueCallback<Long> callback) {
- mQuotaManagerBridge.getUsageForOrigin(origin, callback);
- }
-
- @Override
- public void getQuotaForOrigin(String origin, ValueCallback<Long> callback) {
- mQuotaManagerBridge.getQuotaForOrigin(origin, callback);
- }
-
- @Override
- public void setQuotaForOrigin(String origin, long quota) {
- // Intentional no-op for deprecated method.
- }
-
- @Override
- public void deleteOrigin(String origin) {
- mQuotaManagerBridge.deleteOrigin(origin);
- }
-
- @Override
- public void deleteAllData() {
- mQuotaManagerBridge.deleteAllData();
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java
deleted file mode 100644
index 6cf4238..0000000
--- a/chromium/java/com/android/webview/chromium/WebViewChromium.java
+++ /dev/null
@@ -1,2275 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.pm.PackageManager;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Picture;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.net.http.SslCertificate;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Looper;
-import android.os.Handler;
-import android.os.Message;
-import android.print.PrintDocumentAdapter;
-import android.text.TextUtils;
-import android.util.Base64;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.MeasureSpec;
-import android.view.ViewGroup;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityNodeInfo;
-import android.view.accessibility.AccessibilityNodeProvider;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputConnection;
-import android.webkit.DownloadListener;
-import android.webkit.FindActionModeCallback;
-import android.webkit.JavascriptInterface;
-import android.webkit.ValueCallback;
-import android.webkit.WebBackForwardList;
-import android.webkit.WebChromeClient;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.webkit.WebViewFactory;
-import android.webkit.WebViewProvider;
-import android.webkit.WebChromeClient.CustomViewCallback;
-import android.widget.TextView;
-
-import org.chromium.android_webview.AwBrowserContext;
-import org.chromium.android_webview.AwContents;
-import org.chromium.android_webview.AwContentsStatics;
-import org.chromium.android_webview.AwLayoutSizer;
-import org.chromium.android_webview.AwSettings;
-import org.chromium.android_webview.AwPrintDocumentAdapter;
-import org.chromium.base.ThreadUtils;
-import org.chromium.content.browser.SmartClipProvider;
-import org.chromium.content_public.browser.LoadUrlParams;
-import org.chromium.net.NetworkChangeNotifier;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.lang.annotation.Annotation;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.TimeUnit;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * This class is the delegate to which WebViewProxy forwards all API calls.
- *
- * Most of the actual functionality is implemented by AwContents (or ContentViewCore within
- * it). This class also contains WebView-specific APIs that require the creation of other
- * adapters (otherwise org.chromium.content would depend on the webview.chromium package)
- * and a small set of no-op deprecated APIs.
- */
-class WebViewChromium implements WebViewProvider,
- WebViewProvider.ScrollDelegate, WebViewProvider.ViewDelegate, SmartClipProvider {
-
- private class WebViewChromiumRunQueue {
- public WebViewChromiumRunQueue() {
- mQueue = new ConcurrentLinkedQueue<Runnable>();
- }
-
- public void addTask(Runnable task) {
- mQueue.add(task);
- if (mFactory.hasStarted()) {
- ThreadUtils.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- drainQueue();
- }
- });
- }
- }
-
- public void drainQueue() {
- if (mQueue == null || mQueue.isEmpty()) {
- return;
- }
-
- Runnable task = mQueue.poll();
- while(task != null) {
- task.run();
- task = mQueue.poll();
- }
- }
-
- private Queue<Runnable> mQueue;
- }
-
- private WebViewChromiumRunQueue mRunQueue;
-
- private static final String TAG = WebViewChromium.class.getSimpleName();
-
- // The WebView that this WebViewChromium is the provider for.
- WebView mWebView;
- // Lets us access protected View-derived methods on the WebView instance we're backing.
- WebView.PrivateAccess mWebViewPrivate;
- // The client adapter class.
- private WebViewContentsClientAdapter mContentsClientAdapter;
-
- // Variables for functionality provided by this adapter ---------------------------------------
- private ContentSettingsAdapter mWebSettings;
- // The WebView wrapper for ContentViewCore and required browser compontents.
- private AwContents mAwContents;
- // Non-null if this webview is using the GL accelerated draw path.
- private DrawGLFunctor mGLfunctor;
-
- private final WebView.HitTestResult mHitTestResult;
-
- private final int mAppTargetSdkVersion;
-
- private WebViewChromiumFactoryProvider mFactory;
-
- private static boolean sRecordWholeDocumentEnabledByApi = false;
- static void enableSlowWholeDocumentDraw() {
- sRecordWholeDocumentEnabledByApi = true;
- }
-
- // This does not touch any global / non-threadsafe state, but note that
- // init is ofter called right after and is NOT threadsafe.
- public WebViewChromium(WebViewChromiumFactoryProvider factory, WebView webView,
- WebView.PrivateAccess webViewPrivate) {
- mWebView = webView;
- mWebViewPrivate = webViewPrivate;
- mHitTestResult = new WebView.HitTestResult();
- mAppTargetSdkVersion = mWebView.getContext().getApplicationInfo().targetSdkVersion;
- mFactory = factory;
- mRunQueue = new WebViewChromiumRunQueue();
- factory.getWebViewDelegate().addWebViewAssetPath(mWebView.getContext());
- }
-
- static void completeWindowCreation(WebView parent, WebView child) {
- AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider()).mAwContents;
- AwContents childContents =
- child == null ? null : ((WebViewChromium) child.getWebViewProvider()).mAwContents;
- parentContents.supplyContentsForPopup(childContents);
- }
-
- private <T> T runBlockingFuture(FutureTask<T> task) {
- if (!mFactory.hasStarted()) throw new RuntimeException("Must be started before we block!");
- if (ThreadUtils.runningOnUiThread()) {
- throw new IllegalStateException("This method should only be called off the UI thread");
- }
- mRunQueue.addTask(task);
- try {
- return task.get(4, TimeUnit.SECONDS);
- } catch (java.util.concurrent.TimeoutException e) {
- throw new RuntimeException("Probable deadlock detected due to WebView API being called "
- + "on incorrect thread while the UI thread is blocked.", e);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- // We have a 4 second timeout to try to detect deadlocks to detect and aid in debuggin
- // deadlocks.
- // Do not call this method while on the UI thread!
- private void runVoidTaskOnUiThreadBlocking(Runnable r) {
- FutureTask<Void> task = new FutureTask<Void>(r, null);
- runBlockingFuture(task);
- }
-
- private <T> T runOnUiThreadBlocking(Callable<T> c) {
- return runBlockingFuture(new FutureTask<T>(c));
- }
-
- // WebViewProvider methods --------------------------------------------------------------------
-
- @Override
- // BUG=6790250 |javaScriptInterfaces| was only ever used by the obsolete DumpRenderTree
- // so is ignored. TODO: remove it from WebViewProvider.
- public void init(final Map<String, Object> javaScriptInterfaces,
- final boolean privateBrowsing) {
- if (privateBrowsing) {
- mFactory.startYourEngines(true);
- final String msg = "Private browsing is not supported in WebView.";
- if (mAppTargetSdkVersion >= Build.VERSION_CODES.KITKAT) {
- throw new IllegalArgumentException(msg);
- } else {
- Log.w(TAG, msg);
- TextView warningLabel = new TextView(mWebView.getContext());
- warningLabel.setText(mWebView.getContext().getString(
- R.string.webviewchromium_private_browsing_warning));
- mWebView.addView(warningLabel);
- }
- }
-
- // We will defer real initialization until we know which thread to do it on, unless:
- // - we are on the main thread already (common case),
- // - the app is targeting >= JB MR2, in which case checkThread enforces that all usage
- // comes from a single thread. (Note in JB MR2 this exception was in WebView.java).
- if (mAppTargetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
- mFactory.startYourEngines(false);
- checkThread();
- } else if (!mFactory.hasStarted()) {
- if (Looper.myLooper() == Looper.getMainLooper()) {
- mFactory.startYourEngines(true);
- }
- }
-
- final boolean isAccessFromFileURLsGrantedByDefault =
- mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN;
- final boolean areLegacyQuirksEnabled =
- mAppTargetSdkVersion < Build.VERSION_CODES.KITKAT;
-
- mContentsClientAdapter = new WebViewContentsClientAdapter(
- mWebView, mFactory.getWebViewDelegate());
- mWebSettings = new ContentSettingsAdapter(new AwSettings(
- mWebView.getContext(), isAccessFromFileURLsGrantedByDefault,
- areLegacyQuirksEnabled));
-
- if (mAppTargetSdkVersion <= Build.VERSION_CODES.KITKAT) {
- mWebSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
- // On KK and older versions we always allowed third party cookies.
- mWebSettings.setAcceptThirdPartyCookies(true);
- mWebSettings.getAwSettings().setZeroLayoutHeightDisablesViewportQuirk(true);
- }
-
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- initForReal();
- if (privateBrowsing) {
- // Intentionally irreversibly disable the webview instance, so that private
- // user data cannot leak through misuse of a non-privateBrowing WebView
- // instance. Can't just null out mAwContents as we never null-check it
- // before use.
- destroy();
- }
- }
- });
- }
-
- // Wrap Context so that we can use resources from the webview resource apk.
- private static Context resourcesContextWrapper(final Context ctx) {
- return new ContextWrapper(ctx) {
- @Override
- public ClassLoader getClassLoader() {
- final ClassLoader appCl = getBaseContext().getClassLoader();
- final ClassLoader webViewCl = this.getClass().getClassLoader();
- return new ClassLoader() {
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- // First look in the WebViewProvider class loader.
- try {
- return webViewCl.loadClass(name);
- } catch (ClassNotFoundException e) {
- // Look in the app class loader; allowing it to throw ClassNotFoundException.
- return appCl.loadClass(name);
- }
- }
- };
- }
-
- @Override
- public Object getSystemService(String name) {
- if (name.equals(Context.LAYOUT_INFLATER_SERVICE)) {
- LayoutInflater i = (LayoutInflater) getBaseContext().getSystemService(name);
- return i.cloneInContext(this);
- } else {
- return getBaseContext().getSystemService(name);
- }
- }
-
- };
- }
-
- private void initForReal() {
- Context ctx = resourcesContextWrapper(mWebView.getContext());
- mAwContents = new AwContents(mFactory.getBrowserContext(), mWebView, ctx,
- new InternalAccessAdapter(), new WebViewNativeGLDelegate(),
- mContentsClientAdapter, 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();
- }
-
- AwContentsStatics.setRecordFullDocument(sRecordWholeDocumentEnabledByApi ||
- mAppTargetSdkVersion < Build.VERSION_CODES.LOLLIPOP);
-
- if (mAppTargetSdkVersion <= Build.VERSION_CODES.KITKAT) {
- // On KK and older versions, JavaScript objects injected via addJavascriptInterface
- // were not inspectable.
- mAwContents.disableJavascriptInterfacesInspection();
- }
-
- // TODO: This assumes AwContents ignores second Paint param.
- mAwContents.setLayerType(mWebView.getLayerType(), null);
- }
-
- void startYourEngine() {
- mRunQueue.drainQueue();
- }
-
- private RuntimeException createThreadException() {
- return new IllegalStateException(
- "Calling View methods on another thread than the UI thread.");
- }
-
- private boolean checkNeedsPost() {
- boolean needsPost = !mFactory.hasStarted() || !ThreadUtils.runningOnUiThread();
- if (!needsPost && mAwContents == null) {
- throw new IllegalStateException(
- "AwContents must be created if we are not posting!");
- }
- return needsPost;
- }
-
- // Intentionally not static, as no need to check thread on static methods
- private void checkThread() {
- if (!ThreadUtils.runningOnUiThread()) {
- final RuntimeException threadViolation = createThreadException();
- ThreadUtils.postOnUiThread(new Runnable() {
- @Override
- public void run() {
- throw threadViolation;
- }
- });
- throw createThreadException();
- }
- }
-
- @Override
- public void setHorizontalScrollbarOverlay(final boolean overlay) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setHorizontalScrollbarOverlay(overlay);
- }
- });
- return;
- }
- mAwContents.setHorizontalScrollbarOverlay(overlay);
- }
-
- @Override
- public void setVerticalScrollbarOverlay(final boolean overlay) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setVerticalScrollbarOverlay(overlay);
- }
- });
- return;
- }
- mAwContents.setVerticalScrollbarOverlay(overlay);
- }
-
- @Override
- public boolean overlayHorizontalScrollbar() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return overlayHorizontalScrollbar();
- }
- });
- return ret;
- }
- return mAwContents.overlayHorizontalScrollbar();
- }
-
- @Override
- public boolean overlayVerticalScrollbar() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return overlayVerticalScrollbar();
- }
- });
- return ret;
- }
- return mAwContents.overlayVerticalScrollbar();
- }
-
- @Override
- public int getVisibleTitleHeight() {
- // This is deprecated in WebView and should always return 0.
- return 0;
- }
-
- @Override
- public SslCertificate getCertificate() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- SslCertificate ret = runOnUiThreadBlocking(new Callable<SslCertificate>() {
- @Override
- public SslCertificate call() {
- return getCertificate();
- }
- });
- return ret;
- }
- return mAwContents.getCertificate();
- }
-
- @Override
- public void setCertificate(SslCertificate certificate) {
- // intentional no-op
- }
-
- @Override
- public void savePassword(String host, String username, String password) {
- // This is a deprecated API: intentional no-op.
- }
-
- @Override
- public void setHttpAuthUsernamePassword(final String host, final String realm,
- final String username, final String password) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setHttpAuthUsernamePassword(host, realm, username, password);
- }
- });
- return;
- }
- mAwContents.setHttpAuthUsernamePassword(host, realm, username, password);
- }
-
- @Override
- public String[] getHttpAuthUsernamePassword(final String host, final String realm) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- String[] ret = runOnUiThreadBlocking(new Callable<String[]>() {
- @Override
- public String[] call() {
- return getHttpAuthUsernamePassword(host, realm);
- }
- });
- return ret;
- }
- return mAwContents.getHttpAuthUsernamePassword(host, realm);
- }
-
- @Override
- public void destroy() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- destroy();
- }
- });
- return;
- }
-
- mAwContents.destroy();
- if (mGLfunctor != null) {
- mGLfunctor.destroy();
- mGLfunctor = null;
- }
- }
-
- @Override
- public void setNetworkAvailable(final boolean networkUp) {
- // Note that this purely toggles the JS navigator.online property.
- // It does not in affect chromium or network stack state in any way.
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setNetworkAvailable(networkUp);
- }
- });
- return;
- }
- mAwContents.setNetworkAvailable(networkUp);
- }
-
- @Override
- public WebBackForwardList saveState(final Bundle outState) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- WebBackForwardList ret = runOnUiThreadBlocking(new Callable<WebBackForwardList>() {
- @Override
- public WebBackForwardList call() {
- return saveState(outState);
- }
- });
- return ret;
- }
- if (outState == null) return null;
- if (!mAwContents.saveState(outState)) return null;
- return copyBackForwardList();
- }
-
- @Override
- public boolean savePicture(Bundle b, File dest) {
- // Intentional no-op: hidden method on WebView.
- return false;
- }
-
- @Override
- public boolean restorePicture(Bundle b, File src) {
- // Intentional no-op: hidden method on WebView.
- return false;
- }
-
- @Override
- public WebBackForwardList restoreState(final Bundle inState) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- WebBackForwardList ret = runOnUiThreadBlocking(new Callable<WebBackForwardList>() {
- @Override
- public WebBackForwardList call() {
- return restoreState(inState);
- }
- });
- return ret;
- }
- if (inState == null) return null;
- if (!mAwContents.restoreState(inState)) return null;
- return copyBackForwardList();
- }
-
- @Override
- public void loadUrl(final String url, Map<String, String> additionalHttpHeaders) {
- // TODO: We may actually want to do some sanity checks here (like filter about://chrome).
-
- // For backwards compatibility, apps targeting less than K will have JS URLs evaluated
- // directly and any result of the evaluation will not replace the current page content.
- // Matching Chrome behavior more closely; apps targetting >= K that load a JS URL will
- // have the result of that URL replace the content of the current page.
- final String JAVASCRIPT_SCHEME = "javascript:";
- if (mAppTargetSdkVersion < Build.VERSION_CODES.KITKAT &&
- url != null && url.startsWith(JAVASCRIPT_SCHEME)) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- mAwContents.evaluateJavaScriptEvenIfNotYetNavigated(
- url.substring(JAVASCRIPT_SCHEME.length()));
- }
- });
- } else {
- mAwContents.evaluateJavaScriptEvenIfNotYetNavigated(
- url.substring(JAVASCRIPT_SCHEME.length()));
- }
- return;
- }
-
- LoadUrlParams params = new LoadUrlParams(url);
- if (additionalHttpHeaders != null) params.setExtraHeaders(additionalHttpHeaders);
- loadUrlOnUiThread(params);
- }
-
- @Override
- public void loadUrl(String url) {
- // Early out to match old WebView implementation
- if (url == null) {
- return;
- }
- loadUrl(url, null);
- }
-
- @Override
- public void postUrl(String url, byte[] postData) {
- LoadUrlParams params = LoadUrlParams.createLoadHttpPostParams(url, postData);
- Map<String,String> headers = new HashMap<String,String>();
- headers.put("Content-Type", "application/x-www-form-urlencoded");
- params.setExtraHeaders(headers);
- loadUrlOnUiThread(params);
- }
-
- private static String fixupMimeType(String mimeType) {
- return TextUtils.isEmpty(mimeType) ? "text/html" : mimeType;
- }
-
- private static String fixupData(String data) {
- return TextUtils.isEmpty(data) ? "" : data;
- }
-
- private static String fixupBase(String url) {
- return TextUtils.isEmpty(url) ? "about:blank" : url;
- }
-
- private static String fixupHistory(String url) {
- return TextUtils.isEmpty(url) ? "about:blank" : url;
- }
-
- private static boolean isBase64Encoded(String encoding) {
- return "base64".equals(encoding);
- }
-
- @Override
- public void loadData(String data, String mimeType, String encoding) {
- loadUrlOnUiThread(LoadUrlParams.createLoadDataParams(
- fixupData(data), fixupMimeType(mimeType), isBase64Encoded(encoding)));
- }
-
- @Override
- public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding,
- String historyUrl) {
- data = fixupData(data);
- mimeType = fixupMimeType(mimeType);
- LoadUrlParams loadUrlParams;
- baseUrl = fixupBase(baseUrl);
- historyUrl = fixupHistory(historyUrl);
-
- if (baseUrl.startsWith("data:")) {
- // For backwards compatibility with WebViewClassic, we use the value of |encoding|
- // as the charset, as long as it's not "base64".
- boolean isBase64 = isBase64Encoded(encoding);
- loadUrlParams = LoadUrlParams.createLoadDataParamsWithBaseUrl(
- data, mimeType, isBase64, baseUrl, historyUrl, isBase64 ? null : encoding);
- } else {
- // When loading data with a non-data: base URL, the classic WebView would effectively
- // "dump" that string of data into the WebView without going through regular URL
- // loading steps such as decoding URL-encoded entities. We achieve this same behavior by
- // base64 encoding the data that is passed here and then loading that as a data: URL.
- try {
- loadUrlParams = LoadUrlParams.createLoadDataParamsWithBaseUrl(
- Base64.encodeToString(data.getBytes("utf-8"), Base64.DEFAULT), mimeType,
- true, baseUrl, historyUrl, "utf-8");
- } catch (java.io.UnsupportedEncodingException e) {
- Log.wtf(TAG, "Unable to load data string " + data, e);
- return;
- }
- }
- loadUrlOnUiThread(loadUrlParams);
- }
-
- private void loadUrlOnUiThread(final LoadUrlParams loadUrlParams) {
- // This is the last point that we can delay starting the Chromium backend up
- // and if the app has not caused us to bind the Chromium UI thread to a background thread
- // we now bind Chromium's notion of the UI thread to the app main thread.
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- // Disallowed in WebView API for apps targetting a new SDK
- assert mAppTargetSdkVersion < Build.VERSION_CODES.JELLY_BEAN_MR2;
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- mAwContents.loadUrl(loadUrlParams);
- }
- });
- return;
- }
- mAwContents.loadUrl(loadUrlParams);
- }
-
- public void evaluateJavaScript(String script, ValueCallback<String> resultCallback) {
- checkThread();
- mAwContents.evaluateJavaScript(script, resultCallback);
- }
-
- @Override
- public void saveWebArchive(String filename) {
- saveWebArchive(filename, false, null);
- }
-
- @Override
- public void saveWebArchive(final String basename, final boolean autoname,
- final ValueCallback<String> callback) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- saveWebArchive(basename, autoname, callback);
- }
- });
- return;
- }
- mAwContents.saveWebArchive(basename, autoname, callback);
- }
-
- @Override
- public void stopLoading() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- stopLoading();
- }
- });
- return;
- }
-
- mAwContents.stopLoading();
- }
-
- @Override
- public void reload() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- reload();
- }
- });
- return;
- }
- mAwContents.reload();
- }
-
- @Override
- public boolean canGoBack() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return canGoBack();
- }
- });
- return ret;
- }
- return mAwContents.canGoBack();
- }
-
- @Override
- public void goBack() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- goBack();
- }
- });
- return;
- }
- mAwContents.goBack();
- }
-
- @Override
- public boolean canGoForward() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return canGoForward();
- }
- });
- return ret;
- }
- return mAwContents.canGoForward();
- }
-
- @Override
- public void goForward() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- goForward();
- }
- });
- return;
- }
- mAwContents.goForward();
- }
-
- @Override
- public boolean canGoBackOrForward(final int steps) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return canGoBackOrForward(steps);
- }
- });
- return ret;
- }
- return mAwContents.canGoBackOrForward(steps);
- }
-
- @Override
- public void goBackOrForward(final int steps) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- goBackOrForward(steps);
- }
- });
- return;
- }
- mAwContents.goBackOrForward(steps);
- }
-
- @Override
- public boolean isPrivateBrowsingEnabled() {
- // Not supported in this WebView implementation.
- return false;
- }
-
- @Override
- public boolean pageUp(final boolean top) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return pageUp(top);
- }
- });
- return ret;
- }
- return mAwContents.pageUp(top);
- }
-
- @Override
- public boolean pageDown(final boolean bottom) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return pageDown(bottom);
- }
- });
- return ret;
- }
- return mAwContents.pageDown(bottom);
- }
-
- @Override
- public void clearView() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearView();
- }
- });
- return;
- }
- mAwContents.clearView();
- }
-
- @Override
- public Picture capturePicture() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Picture ret = runOnUiThreadBlocking(new Callable<Picture>() {
- @Override
- public Picture call() {
- return capturePicture();
- }
- });
- return ret;
- }
- return mAwContents.capturePicture();
- }
-
- @Override
- public float getScale() {
- // No checkThread() as it is mostly thread safe (workaround for b/10652991).
- mFactory.startYourEngines(true);
- return mAwContents.getScale();
- }
-
- @Override
- public void setInitialScale(final int scaleInPercent) {
- // No checkThread() as it is thread safe
- mWebSettings.getAwSettings().setInitialPageScale(scaleInPercent);
- }
-
- @Override
- public void invokeZoomPicker() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- invokeZoomPicker();
- }
- });
- return;
- }
- mAwContents.invokeZoomPicker();
- }
-
- @Override
- public WebView.HitTestResult getHitTestResult() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- WebView.HitTestResult ret = runOnUiThreadBlocking(
- new Callable<WebView.HitTestResult>() {
- @Override
- public WebView.HitTestResult call() {
- return getHitTestResult();
- }
- });
- return ret;
- }
- AwContents.HitTestData data = mAwContents.getLastHitTestResult();
- mHitTestResult.setType(data.hitTestResultType);
- mHitTestResult.setExtra(data.hitTestResultExtraData);
- return mHitTestResult;
- }
-
- @Override
- public void requestFocusNodeHref(final Message hrefMsg) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- requestFocusNodeHref(hrefMsg);
- }
- });
- return;
- }
- mAwContents.requestFocusNodeHref(hrefMsg);
- }
-
- @Override
- public void requestImageRef(final Message msg) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- requestImageRef(msg);
- }
- });
- return;
- }
- mAwContents.requestImageRef(msg);
- }
-
- @Override
- public String getUrl() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- String ret = runOnUiThreadBlocking(new Callable<String>() {
- @Override
- public String call() {
- return getUrl();
- }
- });
- return ret;
- }
- String url = mAwContents.getUrl();
- if (url == null || url.trim().isEmpty()) return null;
- return url;
- }
-
- @Override
- public String getOriginalUrl() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- String ret = runOnUiThreadBlocking(new Callable<String>() {
- @Override
- public String call() {
- return getOriginalUrl();
- }
- });
- return ret;
- }
- String url = mAwContents.getOriginalUrl();
- if (url == null || url.trim().isEmpty()) return null;
- return url;
- }
-
- @Override
- public String getTitle() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- String ret = runOnUiThreadBlocking(new Callable<String>() {
- @Override
- public String call() {
- return getTitle();
- }
- });
- return ret;
- }
- return mAwContents.getTitle();
- }
-
- @Override
- public Bitmap getFavicon() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Bitmap ret = runOnUiThreadBlocking(new Callable<Bitmap>() {
- @Override
- public Bitmap call() {
- return getFavicon();
- }
- });
- return ret;
- }
- return mAwContents.getFavicon();
- }
-
- @Override
- public String getTouchIconUrl() {
- // Intentional no-op: hidden method on WebView.
- return null;
- }
-
- @Override
- public int getProgress() {
- if (mAwContents == null) return 100;
- // No checkThread() because the value is cached java side (workaround for b/10533304).
- return mAwContents.getMostRecentProgress();
- }
-
- @Override
- public int getContentHeight() {
- if (mAwContents == null) return 0;
- // No checkThread() as it is mostly thread safe (workaround for b/10594869).
- return mAwContents.getContentHeightCss();
- }
-
- @Override
- public int getContentWidth() {
- if (mAwContents == null) return 0;
- // No checkThread() as it is mostly thread safe (workaround for b/10594869).
- return mAwContents.getContentWidthCss();
- }
-
- @Override
- public void pauseTimers() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- pauseTimers();
- }
- });
- return;
- }
- mAwContents.pauseTimers();
- }
-
- @Override
- public void resumeTimers() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- resumeTimers();
- }
- });
- return;
- }
- mAwContents.resumeTimers();
- }
-
- @Override
- public void onPause() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onPause();
- }
- });
- return;
- }
- mAwContents.onPause();
- }
-
- @Override
- public void onResume() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onResume();
- }
- });
- return;
- }
- mAwContents.onResume();
- }
-
- @Override
- public boolean isPaused() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- Boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return isPaused();
- }
- });
- return ret;
- }
- return mAwContents.isPaused();
- }
-
- @Override
- public void freeMemory() {
- // Intentional no-op. Memory is managed automatically by Chromium.
- }
-
- @Override
- public void clearCache(final boolean includeDiskFiles) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearCache(includeDiskFiles);
- }
- });
- return;
- }
- mAwContents.clearCache(includeDiskFiles);
- }
-
- /**
- * This is a poorly named method, but we keep it for historical reasons.
- */
- @Override
- public void clearFormData() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearFormData();
- }
- });
- return;
- }
- mAwContents.hideAutofillPopup();
- }
-
- @Override
- public void clearHistory() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearHistory();
- }
- });
- return;
- }
- mAwContents.clearHistory();
- }
-
- @Override
- public void clearSslPreferences() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearSslPreferences();
- }
- });
- return;
- }
- mAwContents.clearSslPreferences();
- }
-
- @Override
- public WebBackForwardList copyBackForwardList() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- WebBackForwardList ret = runOnUiThreadBlocking(new Callable<WebBackForwardList>() {
- @Override
- public WebBackForwardList call() {
- return copyBackForwardList();
- }
- });
- return ret;
- }
- return new WebBackForwardListChromium(
- mAwContents.getNavigationHistory());
- }
-
- @Override
- public void setFindListener(WebView.FindListener listener) {
- mContentsClientAdapter.setFindListener(listener);
- }
-
- @Override
- public void findNext(final boolean forwards) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- findNext(forwards);
- }
- });
- return;
- }
- mAwContents.findNext(forwards);
- }
-
- @Override
- public int findAll(final String searchString) {
- findAllAsync(searchString);
- return 0;
- }
-
- @Override
- public void findAllAsync(final String searchString) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- findAllAsync(searchString);
- }
- });
- return;
- }
- mAwContents.findAllAsync(searchString);
- }
-
- @Override
- public boolean showFindDialog(final String text, final boolean showIme) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- return false;
- }
- if (mWebView.getParent() == null) {
- return false;
- }
-
- FindActionModeCallback findAction = new FindActionModeCallback(mWebView.getContext());
- if (findAction == null) {
- return false;
- }
-
- mWebView.startActionMode(findAction);
- findAction.setWebView(mWebView);
- if (showIme) {
- findAction.showSoftInput();
- }
-
- if (text != null) {
- findAction.setText(text);
- findAction.findAll();
- }
-
- return true;
- }
-
- @Override
- public void notifyFindDialogDismissed() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- notifyFindDialogDismissed();
- }
- });
- return;
- }
- clearMatches();
- }
-
- @Override
- public void clearMatches() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- clearMatches();
- }
- });
- return;
- }
- mAwContents.clearMatches();
- }
-
- @Override
- public void documentHasImages(final Message response) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- documentHasImages(response);
- }
- });
- return;
- }
- mAwContents.documentHasImages(response);
- }
-
- @Override
- public void setWebViewClient(WebViewClient client) {
- mContentsClientAdapter.setWebViewClient(client);
- }
-
- @Override
- public void setDownloadListener(DownloadListener listener) {
- mContentsClientAdapter.setDownloadListener(listener);
- }
-
- @Override
- public void setWebChromeClient(WebChromeClient client) {
- mWebSettings.getAwSettings().setFullscreenSupported(doesSupportFullscreen(client));
- mContentsClientAdapter.setWebChromeClient(client);
- }
-
- /**
- * Returns true if the supplied {@link WebChromeClient} supports fullscreen.
- *
- * <p>For fullscreen support, implementations of {@link WebChromeClient#onShowCustomView}
- * and {@link WebChromeClient#onHideCustomView()} are required.
- */
- private boolean doesSupportFullscreen(WebChromeClient client) {
- if (client == null) {
- return false;
- }
- // If client is not a subclass of WebChromeClient then the methods have not been
- // implemented because WebChromeClient has empty implementations.
- if (client.getClass().isAssignableFrom(WebChromeClient.class)) {
- return false;
- }
- try {
- client.getClass().getDeclaredMethod("onShowCustomView", View.class,
- CustomViewCallback.class);
- client.getClass().getDeclaredMethod("onHideCustomView");
- return true;
- } catch (NoSuchMethodException e) {
- return false;
- }
- }
-
- @Override
- public void setPictureListener(final WebView.PictureListener listener) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setPictureListener(listener);
- }
- });
- return;
- }
- mContentsClientAdapter.setPictureListener(listener);
- mAwContents.enableOnNewPicture(listener != null,
- mAppTargetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN_MR2);
- }
-
- @Override
- public void addJavascriptInterface(final Object obj, final String interfaceName) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- addJavascriptInterface(obj, interfaceName);
- }
- });
- return;
- }
- Class<? extends Annotation> requiredAnnotation = null;
- if (mAppTargetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- requiredAnnotation = JavascriptInterface.class;
- }
- mAwContents.addPossiblyUnsafeJavascriptInterface(obj, interfaceName, requiredAnnotation);
- }
-
- @Override
- public void removeJavascriptInterface(final String interfaceName) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- removeJavascriptInterface(interfaceName);
- }
- });
- return;
- }
- mAwContents.removeJavascriptInterface(interfaceName);
- }
-
- @Override
- public WebSettings getSettings() {
- return mWebSettings;
- }
-
- @Override
- public void setMapTrackballToArrowKeys(boolean setMap) {
- // This is a deprecated API: intentional no-op.
- }
-
- @Override
- public void flingScroll(final int vx, final int vy) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- flingScroll(vx, vy);
- }
- });
- return;
- }
- mAwContents.flingScroll(vx, vy);
- }
-
- @Override
- public View getZoomControls() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- return null;
- }
-
- // This was deprecated in 2009 and hidden in JB MR1, so just provide the minimum needed
- // to stop very out-dated applications from crashing.
- Log.w(TAG, "WebView doesn't support getZoomControls");
- return mAwContents.getSettings().supportZoom() ? new View(mWebView.getContext()) : null;
- }
-
- @Override
- public boolean canZoomIn() {
- if (checkNeedsPost()) {
- return false;
- }
- return mAwContents.canZoomIn();
- }
-
- @Override
- public boolean canZoomOut() {
- if (checkNeedsPost()) {
- return false;
- }
- return mAwContents.canZoomOut();
- }
-
- @Override
- public boolean zoomIn() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return zoomIn();
- }
- });
- return ret;
- }
- return mAwContents.zoomIn();
- }
-
- @Override
- public boolean zoomOut() {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return zoomOut();
- }
- });
- return ret;
- }
- return mAwContents.zoomOut();
- }
-
- @Override
- public boolean zoomBy(float factor) {
- mFactory.startYourEngines(true);
- // This is an L API and therefore we can enforce stricter threading constraints.
- checkThread();
- return mAwContents.zoomBy(factor);
- }
-
- @Override
- public void dumpViewHierarchyWithProperties(BufferedWriter out, int level) {
- // Intentional no-op
- }
-
- @Override
- public View findHierarchyView(String className, int hashCode) {
- // Intentional no-op
- return null;
- }
-
- // WebViewProvider glue methods ---------------------------------------------------------------
-
- @Override
- // This needs to be kept thread safe!
- public WebViewProvider.ViewDelegate getViewDelegate() {
- return this;
- }
-
- @Override
- // This needs to be kept thread safe!
- public WebViewProvider.ScrollDelegate getScrollDelegate() {
- return this;
- }
-
-
- // WebViewProvider.ViewDelegate implementation ------------------------------------------------
-
- // TODO: remove from WebViewProvider and use default implementation from
- // ViewGroup.
- // @Override
- public boolean shouldDelayChildPressedState() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return shouldDelayChildPressedState();
- }
- });
- return ret;
- }
- return true;
- }
-
-// @Override
- public AccessibilityNodeProvider getAccessibilityNodeProvider() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- AccessibilityNodeProvider ret = runOnUiThreadBlocking(
- new Callable<AccessibilityNodeProvider>() {
- @Override
- public AccessibilityNodeProvider call() {
- return getAccessibilityNodeProvider();
- }
- });
- return ret;
- }
- return mAwContents.getAccessibilityNodeProvider();
- }
-
- @Override
- public void onInitializeAccessibilityNodeInfo(final AccessibilityNodeInfo info) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- runVoidTaskOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- onInitializeAccessibilityNodeInfo(info);
- }
- });
- return;
- }
- mAwContents.onInitializeAccessibilityNodeInfo(info);
- }
-
- @Override
- public void onInitializeAccessibilityEvent(final AccessibilityEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- runVoidTaskOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- onInitializeAccessibilityEvent(event);
- }
- });
- return;
- }
- mAwContents.onInitializeAccessibilityEvent(event);
- }
-
- @Override
- public boolean performAccessibilityAction(final int action, final Bundle arguments) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return performAccessibilityAction(action, arguments);
- }
- });
- return ret;
- }
- if (mAwContents.supportsAccessibilityAction(action)) {
- return mAwContents.performAccessibilityAction(action, arguments);
- }
- return mWebViewPrivate.super_performAccessibilityAction(action, arguments);
- }
-
- @Override
- public void setOverScrollMode(final int mode) {
- // This gets called from the android.view.View c'tor that WebView inherits from. This
- // causes the method to be called when mAwContents == null.
- // It's safe to ignore these calls however since AwContents will read the current value of
- // this setting when it's created.
- if (mAwContents == null) return;
-
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setOverScrollMode(mode);
- }
- });
- return;
- }
- mAwContents.setOverScrollMode(mode);
- }
-
- @Override
- public void setScrollBarStyle(final int style) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- setScrollBarStyle(style);
- }
- });
- return;
- }
- mAwContents.setScrollBarStyle(style);
- }
-
- @Override
- public void onDrawVerticalScrollBar(final Canvas canvas, final Drawable scrollBar, final int l,
- final int t, final int r, final int b) {
- // WebViewClassic was overriding this method to handle rubberband over-scroll. Since
- // WebViewChromium doesn't support that the vanilla implementation of this method can be
- // used.
- mWebViewPrivate.super_onDrawVerticalScrollBar(canvas, scrollBar, l, t, r, b);
- }
-
- @Override
- public void onOverScrolled(final int scrollX, final int scrollY, final boolean clampedX,
- final boolean clampedY) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onOverScrolled(scrollX, scrollY, clampedX, clampedY);
- }
- });
- return;
- }
- mAwContents.onContainerViewOverScrolled(scrollX, scrollY, clampedX, clampedY);
- }
-
- @Override
- public void onWindowVisibilityChanged(final int visibility) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onWindowVisibilityChanged(visibility);
- }
- });
- return;
- }
- mAwContents.onWindowVisibilityChanged(visibility);
- }
-
- @Override
- public void onDraw(final Canvas canvas) {
- mFactory.startYourEngines(true);
- if (checkNeedsPost()) {
- runVoidTaskOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- onDraw(canvas);
- }
- });
- return;
- }
- mAwContents.onDraw(canvas);
- }
-
- @Override
- public void setLayoutParams(final ViewGroup.LayoutParams layoutParams) {
- // This API is our strongest signal from the View system that this
- // WebView is going to be bound to a View hierarchy and so at this
- // point we must bind Chromium's UI thread to the current thread.
- mFactory.startYourEngines(false);
- checkThread();
- mWebViewPrivate.super_setLayoutParams(layoutParams);
- }
-
- @Override
- public boolean performLongClick() {
- // Return false unless the WebView is attached to a View with a parent
- return mWebView.getParent() != null ? mWebViewPrivate.super_performLongClick() : false;
- }
-
- @Override
- public void onConfigurationChanged(final Configuration newConfig) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onConfigurationChanged(newConfig);
- }
- });
- return;
- }
- mAwContents.onConfigurationChanged(newConfig);
- }
-
- @Override
- public InputConnection onCreateInputConnection(final EditorInfo outAttrs) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- return null;
- }
- return mAwContents.onCreateInputConnection(outAttrs);
- }
-
- @Override
- public boolean onKeyMultiple(final int keyCode, final int repeatCount, final KeyEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onKeyMultiple(keyCode, repeatCount, event);
- }
- });
- return ret;
- }
- UnimplementedWebViewApi.invoke();
- return false;
- }
-
- @Override
- public boolean onKeyDown(final int keyCode, final KeyEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onKeyDown(keyCode, event);
- }
- });
- return ret;
- }
- UnimplementedWebViewApi.invoke();
- return false;
- }
-
- @Override
- public boolean onKeyUp(final int keyCode, final KeyEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onKeyUp(keyCode, event);
- }
- });
- return ret;
- }
- return mAwContents.onKeyUp(keyCode, event);
- }
-
- @Override
- public void onAttachedToWindow() {
- // This API is our strongest signal from the View system that this
- // WebView is going to be bound to a View hierarchy and so at this
- // point we must bind Chromium's UI thread to the current thread.
- mFactory.startYourEngines(false);
- checkThread();
- mAwContents.onAttachedToWindow();
- }
-
- @Override
- public void onDetachedFromWindow() {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onDetachedFromWindow();
- }
- });
- return;
- }
-
- mAwContents.onDetachedFromWindow();
- }
-
- @Override
- public void onVisibilityChanged(final View changedView, final int visibility) {
- // The AwContents will find out the container view visibility before the first draw so we
- // can safely ignore onVisibilityChanged callbacks that happen before init().
- if (mAwContents == null) return;
-
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onVisibilityChanged(changedView, visibility);
- }
- });
- return;
- }
- mAwContents.onVisibilityChanged(changedView, visibility);
- }
-
- @Override
- public void onWindowFocusChanged(final boolean hasWindowFocus) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onWindowFocusChanged(hasWindowFocus);
- }
- });
- return;
- }
- mAwContents.onWindowFocusChanged(hasWindowFocus);
- }
-
- @Override
- public void onFocusChanged(final boolean focused, final int direction,
- final Rect previouslyFocusedRect) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onFocusChanged(focused, direction, previouslyFocusedRect);
- }
- });
- return;
- }
- mAwContents.onFocusChanged(focused, direction, previouslyFocusedRect);
- }
-
- @Override
- public boolean setFrame(final int left, final int top, final int right, final int bottom) {
- return mWebViewPrivate.super_setFrame(left, top, right, bottom);
- }
-
- @Override
- public void onSizeChanged(final int w, final int h, final int ow, final int oh) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onSizeChanged(w, h, ow, oh);
- }
- });
- return;
- }
- mAwContents.onSizeChanged(w, h, ow, oh);
- }
-
- @Override
- public void onScrollChanged(final int l, final int t, final int oldl, final int oldt) {
- if (checkNeedsPost()) {
- mRunQueue.addTask(new Runnable() {
- @Override
- public void run() {
- onScrollChanged(l, t, oldl, oldt);
- }
- });
- return;
- }
- mAwContents.onContainerViewScrollChanged(l, t, oldl, oldt);
- }
-
- @Override
- public boolean dispatchKeyEvent(final KeyEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return dispatchKeyEvent(event);
- }
- });
- return ret;
- }
- return mAwContents.dispatchKeyEvent(event);
- }
-
- @Override
- public boolean onTouchEvent(final MotionEvent ev) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onTouchEvent(ev);
- }
- });
- return ret;
- }
- return mAwContents.onTouchEvent(ev);
- }
-
- @Override
- public boolean onHoverEvent(final MotionEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onHoverEvent(event);
- }
- });
- return ret;
- }
- return mAwContents.onHoverEvent(event);
- }
-
- @Override
- public boolean onGenericMotionEvent(final MotionEvent event) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return onGenericMotionEvent(event);
- }
- });
- return ret;
- }
- return mAwContents.onGenericMotionEvent(event);
- }
-
- @Override
- public boolean onTrackballEvent(MotionEvent ev) {
- // Trackball event not handled, which eventually gets converted to DPAD keyevents
- return false;
- }
-
- @Override
- public boolean requestFocus(final int direction, final Rect previouslyFocusedRect) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return requestFocus(direction, previouslyFocusedRect);
- }
- });
- return ret;
- }
- mAwContents.requestFocus();
- return mWebViewPrivate.super_requestFocus(direction, previouslyFocusedRect);
- }
-
- @Override
- public void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- runVoidTaskOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
- });
- return;
- }
- mAwContents.onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
-
- @Override
- public boolean requestChildRectangleOnScreen(final View child, final Rect rect,
- final boolean immediate) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- boolean ret = runOnUiThreadBlocking(new Callable<Boolean>() {
- @Override
- public Boolean call() {
- return requestChildRectangleOnScreen(child, rect, immediate);
- }
- });
- return ret;
- }
- return mAwContents.requestChildRectangleOnScreen(child, rect, immediate);
- }
-
- @Override
- public void setBackgroundColor(final int color) {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- ThreadUtils.postOnUiThread(new Runnable() {
- @Override
- public void run() {
- setBackgroundColor(color);
- }
- });
- return;
- }
- mAwContents.setBackgroundColor(color);
- }
-
- @Override
- public void setLayerType(final int layerType, final Paint paint) {
- // This can be called from WebView constructor in which case mAwContents
- // is still null. We set the layer type in initForReal in that case.
- if (mAwContents == null) return;
- if (checkNeedsPost()) {
- ThreadUtils.postOnUiThread(new Runnable() {
- @Override
- public void run() {
- setLayerType(layerType, paint);
- }
- });
- return;
- }
- mAwContents.setLayerType(layerType, paint);
- }
-
- // Remove from superclass
- public void preDispatchDraw(Canvas canvas) {
- // TODO(leandrogracia): remove this method from WebViewProvider if we think
- // we won't need it again.
- }
-
- public void onStartTemporaryDetach() {
- mAwContents.onStartTemporaryDetach();
- }
-
- public void onFinishTemporaryDetach() {
- mAwContents.onFinishTemporaryDetach();
- }
-
- // WebViewProvider.ScrollDelegate implementation ----------------------------------------------
-
- @Override
- public int computeHorizontalScrollRange() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- int ret = runOnUiThreadBlocking(new Callable<Integer>() {
- @Override
- public Integer call() {
- return computeHorizontalScrollRange();
- }
- });
- return ret;
- }
- return mAwContents.computeHorizontalScrollRange();
- }
-
- @Override
- public int computeHorizontalScrollOffset() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- int ret = runOnUiThreadBlocking(new Callable<Integer>() {
- @Override
- public Integer call() {
- return computeHorizontalScrollOffset();
- }
- });
- return ret;
- }
- return mAwContents.computeHorizontalScrollOffset();
- }
-
- @Override
- public int computeVerticalScrollRange() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- int ret = runOnUiThreadBlocking(new Callable<Integer>() {
- @Override
- public Integer call() {
- return computeVerticalScrollRange();
- }
- });
- return ret;
- }
- return mAwContents.computeVerticalScrollRange();
- }
-
- @Override
- public int computeVerticalScrollOffset() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- int ret = runOnUiThreadBlocking(new Callable<Integer>() {
- @Override
- public Integer call() {
- return computeVerticalScrollOffset();
- }
- });
- return ret;
- }
- return mAwContents.computeVerticalScrollOffset();
- }
-
- @Override
- public int computeVerticalScrollExtent() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- int ret = runOnUiThreadBlocking(new Callable<Integer>() {
- @Override
- public Integer call() {
- return computeVerticalScrollExtent();
- }
- });
- return ret;
- }
- return mAwContents.computeVerticalScrollExtent();
- }
-
- @Override
- public void computeScroll() {
- mFactory.startYourEngines(false);
- if (checkNeedsPost()) {
- runVoidTaskOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- computeScroll();
- }
- });
- return;
- }
- mAwContents.computeScroll();
- }
-
- // TODO(sgurun) this is only to have master-gpl compiling.
- public PrintDocumentAdapter createPrintDocumentAdapter() {
- return createPrintDocumentAdapter("default");
- }
-
- //@Override TODO(sgurun) commenting this out to have master-gpl compiling.
- public PrintDocumentAdapter createPrintDocumentAdapter(String documentName) {
- checkThread();
- return new AwPrintDocumentAdapter(mAwContents.getPdfExporter(), documentName);
- }
-
- // AwContents.NativeGLDelegate implementation --------------------------------------
- private class WebViewNativeGLDelegate implements AwContents.NativeGLDelegate {
- @Override
- public boolean requestDrawGL(Canvas canvas, boolean waitForCompletion,
- View containerView) {
- if (mGLfunctor == null) {
- mGLfunctor = new DrawGLFunctor(mAwContents.getAwDrawGLViewContext(),
- mFactory.getWebViewDelegate());
- }
- return mGLfunctor.requestDrawGL(canvas, containerView, waitForCompletion);
- }
-
- @Override
- public void detachGLFunctor() {
- if (mGLfunctor != null) {
- mGLfunctor.detach();
- }
- }
- }
-
- // AwContents.InternalAccessDelegate implementation --------------------------------------
- private class InternalAccessAdapter implements AwContents.InternalAccessDelegate {
- @Override
- public boolean drawChild(Canvas arg0, View arg1, long arg2) {
- UnimplementedWebViewApi.invoke();
- return false;
- }
-
- @Override
- public boolean super_onKeyUp(int arg0, KeyEvent arg1) {
- // Intentional no-op
- return false;
- }
-
- @Override
- public boolean super_dispatchKeyEventPreIme(KeyEvent arg0) {
- UnimplementedWebViewApi.invoke();
- return false;
- }
-
- @Override
- public boolean super_dispatchKeyEvent(KeyEvent event) {
- return mWebViewPrivate.super_dispatchKeyEvent(event);
- }
-
- @Override
- public boolean super_onGenericMotionEvent(MotionEvent arg0) {
- return mWebViewPrivate.super_onGenericMotionEvent(arg0);
- }
-
- @Override
- public void super_onConfigurationChanged(Configuration arg0) {
- // Intentional no-op
- }
-
- @Override
- public int super_getScrollBarStyle() {
- return mWebViewPrivate.super_getScrollBarStyle();
- }
-
- @Override
- public boolean awakenScrollBars() {
- mWebViewPrivate.awakenScrollBars(0);
- // TODO: modify the WebView.PrivateAccess to provide a return value.
- return true;
- }
-
- @Override
- public boolean super_awakenScrollBars(int arg0, boolean arg1) {
- // TODO: need method on WebView.PrivateAccess?
- UnimplementedWebViewApi.invoke();
- return false;
- }
-
- @Override
- public void onScrollChanged(int l, int t, int oldl, int oldt) {
- // Intentional no-op.
- // Chromium calls this directly to trigger accessibility events. That isn't needed
- // for WebView since super_scrollTo invokes onScrollChanged for us.
- }
-
- @Override
- public void overScrollBy(int deltaX, int deltaY,
- int scrollX, int scrollY,
- int scrollRangeX, int scrollRangeY,
- int maxOverScrollX, int maxOverScrollY,
- boolean isTouchEvent) {
- mWebViewPrivate.overScrollBy(deltaX, deltaY, scrollX, scrollY,
- scrollRangeX, scrollRangeY, maxOverScrollX, maxOverScrollY, isTouchEvent);
- }
-
- @Override
- public void super_scrollTo(int scrollX, int scrollY) {
- mWebViewPrivate.super_scrollTo(scrollX, scrollY);
- }
-
- @Override
- public void setMeasuredDimension(int measuredWidth, int measuredHeight) {
- mWebViewPrivate.setMeasuredDimension(measuredWidth, measuredHeight);
- }
-
- // @Override
- public boolean super_onHoverEvent(MotionEvent event) {
- return mWebViewPrivate.super_onHoverEvent(event);
- }
- }
-
- // Implements SmartClipProvider
- @Override
- public void extractSmartClipData(int x, int y, int width, int height) {
- checkThread();
- mAwContents.extractSmartClipData(x, y, width, height);
- }
-
- // Implements SmartClipProvider
- @Override
- public void setSmartClipResultHandler(final Handler resultHandler) {
- checkThread();
- mAwContents.setSmartClipResultHandler(resultHandler);
- }
-
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
deleted file mode 100644
index f54c964..0000000
--- a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.res.Resources;
-import android.app.ActivityManager;
-import android.content.ComponentCallbacks2;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Looper;
-import android.os.StrictMode;
-import android.util.Log;
-import android.webkit.CookieManager;
-import android.webkit.GeolocationPermissions;
-import android.webkit.WebIconDatabase;
-import android.webkit.WebStorage;
-import android.webkit.WebView;
-import android.webkit.WebViewDatabase;
-import android.webkit.WebViewFactory;
-import android.webkit.WebViewFactoryProvider;
-import android.webkit.WebViewProvider;
-
-import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate;
-
-import org.chromium.android_webview.AwBrowserContext;
-import org.chromium.android_webview.AwBrowserProcess;
-import org.chromium.android_webview.AwContents;
-import org.chromium.android_webview.AwContentsStatics;
-import org.chromium.android_webview.AwCookieManager;
-import org.chromium.android_webview.AwDevToolsServer;
-import org.chromium.android_webview.AwFormDatabase;
-import org.chromium.android_webview.AwGeolocationPermissions;
-import org.chromium.android_webview.AwQuotaManagerBridge;
-import org.chromium.android_webview.AwResource;
-import org.chromium.android_webview.AwSettings;
-import org.chromium.base.CommandLine;
-import org.chromium.base.MemoryPressureListener;
-import org.chromium.base.PathService;
-import org.chromium.base.PathUtils;
-import org.chromium.base.ResourceExtractor;
-import org.chromium.base.ThreadUtils;
-import org.chromium.base.TraceEvent;
-import org.chromium.base.library_loader.LibraryLoader;
-import org.chromium.base.library_loader.ProcessInitException;
-import org.chromium.content.app.ContentMain;
-import org.chromium.content.browser.ContentViewStatics;
-
-import java.io.File;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-
-public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
-
- private static final String TAG = "WebViewChromiumFactoryProvider";
-
- private static final String CHROMIUM_PREFS_NAME = "WebViewChromiumPrefs";
- private static final String VERSION_CODE_PREF = "lastVersionCodeUsed";
- private static final String COMMAND_LINE_FILE = "/data/local/tmp/webview-command-line";
-
- // Guards accees to the other members, and is notifyAll() signalled on the UI thread
- // when the chromium process has been started.
- private final Object mLock = new Object();
-
- // Initialization guarded by mLock.
- private AwBrowserContext mBrowserContext;
- private Statics mStaticMethods;
- private GeolocationPermissionsAdapter mGeolocationPermissions;
- private CookieManagerAdapter mCookieManager;
- private WebIconDatabaseAdapter mWebIconDatabase;
- private WebStorageAdapter mWebStorage;
- private WebViewDatabaseAdapter mWebViewDatabase;
- private AwDevToolsServer mDevToolsServer;
-
- private ArrayList<WeakReference<WebViewChromium>> mWebViewsToStart =
- new ArrayList<WeakReference<WebViewChromium>>();
-
- // Read/write protected by mLock.
- private boolean mStarted;
-
- private DataReductionProxyManager mProxyManager;
- private SharedPreferences mWebViewPrefs;
- private WebViewDelegate mWebViewDelegate;
-
- /**
- * Constructor called by the API 21 version of {@link WebViewFactory} and earlier.
- */
- public WebViewChromiumFactoryProvider() {
- initialize(WebViewDelegateFactory.createApi21CompatibilityDelegate());
- }
-
- /**
- * Constructor called by the API 22 version of {@link WebViewFactory} and later.
- */
- public WebViewChromiumFactoryProvider(android.webkit.WebViewDelegate delegate) {
- initialize(WebViewDelegateFactory.createProxyDelegate(delegate));
- }
-
- private void initialize(WebViewDelegate webViewDelegate) {
- mWebViewDelegate = webViewDelegate;
- if (isBuildDebuggable()) {
- // Suppress the StrictMode violation as this codepath is only hit on debugglable builds.
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
- CommandLine.initFromFile(COMMAND_LINE_FILE);
- StrictMode.setThreadPolicy(oldPolicy);
- } else {
- CommandLine.init(null);
- }
-
- CommandLine cl = CommandLine.getInstance();
- // TODO: currently in a relase build the DCHECKs only log. We either need to insall
- // a report handler with SetLogReportHandler to make them assert, or else compile
- // them out of the build altogether (b/8284203). Either way, so long they're
- // compiled in, we may as unconditionally enable them here.
- cl.appendSwitch("enable-dcheck");
-
- ThreadUtils.setWillOverrideUiThread();
- // Load chromium library.
- AwBrowserProcess.loadLibrary();
-
- final PackageInfo packageInfo = WebViewFactory.getLoadedPackageInfo();
-
- // Register the handler that will append the WebView version to logcat in case of a crash.
- AwContentsStatics.registerCrashHandler(
- "Version " + packageInfo.versionName + " (code " + packageInfo.versionCode + ")");
-
- // Load glue-layer support library.
- System.loadLibrary("webviewchromium_plat_support");
-
- // Use shared preference to check for package downgrade.
- mWebViewPrefs = mWebViewDelegate.getApplication().getSharedPreferences(
- CHROMIUM_PREFS_NAME, Context.MODE_PRIVATE);
- int lastVersion = mWebViewPrefs.getInt(VERSION_CODE_PREF, 0);
- int currentVersion = packageInfo.versionCode;
- if (lastVersion > currentVersion) {
- // The WebView package has been downgraded since we last ran in this application.
- // Delete the WebView data directory's contents.
- String dataDir = PathUtils.getDataDirectory(mWebViewDelegate.getApplication());
- Log.i(TAG, "WebView package downgraded from " + lastVersion + " to " + currentVersion +
- "; deleting contents of " + dataDir);
- deleteContents(new File(dataDir));
- }
- if (lastVersion != currentVersion) {
- mWebViewPrefs.edit().putInt(VERSION_CODE_PREF, currentVersion).apply();
- }
- // Now safe to use WebView data directory.
- }
-
- private static boolean isBuildDebuggable() {
- return !Build.TYPE.equals("user");
- }
-
- private static void deleteContents(File dir) {
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory()) {
- deleteContents(file);
- }
- if (!file.delete()) {
- Log.w(TAG, "Failed to delete " + file);
- }
- }
- }
- }
-
- private void initPlatSupportLibrary() {
- DrawGLFunctor.setChromiumAwDrawGLFunction(AwContents.getAwDrawGLFunction());
- AwContents.setAwDrawSWFunctionTable(GraphicsUtils.getDrawSWFunctionTable());
- AwContents.setAwDrawGLFunctionTable(GraphicsUtils.getDrawGLFunctionTable());
- }
-
- private void ensureChromiumStartedLocked(boolean onMainThread) {
- assert Thread.holdsLock(mLock);
-
- if (mStarted) { // Early-out for the common case.
- return;
- }
-
- Looper looper = !onMainThread ? Looper.myLooper() : Looper.getMainLooper();
- Log.v(TAG, "Binding Chromium to " +
- (Looper.getMainLooper().equals(looper) ? "main":"background") +
- " looper " + looper);
- ThreadUtils.setUiThread(looper);
-
- if (ThreadUtils.runningOnUiThread()) {
- startChromiumLocked();
- return;
- }
-
- // We must post to the UI thread to cover the case that the user has invoked Chromium
- // startup by using the (thread-safe) CookieManager rather than creating a WebView.
- ThreadUtils.postOnUiThread(new Runnable() {
- @Override
- public void run() {
- synchronized (mLock) {
- startChromiumLocked();
- }
- }
- });
- while (!mStarted) {
- try {
- // Important: wait() releases |mLock| the UI thread can take it :-)
- mLock.wait();
- } catch (InterruptedException e) {
- // Keep trying... eventually the UI thread will process the task we sent it.
- }
- }
- }
-
- private void startChromiumLocked() {
- assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread();
-
- // The post-condition of this method is everything is ready, so notify now to cover all
- // return paths. (Other threads will not wake-up until we release |mLock|, whatever).
- mLock.notifyAll();
-
- if (mStarted) {
- return;
- }
-
- // We don't need to extract any paks because for WebView, they are
- // in the system image.
- ResourceExtractor.setMandatoryPaksToExtract("");
-
- try {
- LibraryLoader.ensureInitialized();
- } catch(ProcessInitException e) {
- throw new RuntimeException("Error initializing WebView library", e);
- }
-
- PathService.override(PathService.DIR_MODULE, "/system/lib/");
- // TODO: DIR_RESOURCE_PAKS_ANDROID needs to live somewhere sensible,
- // inlined here for simplicity setting up the HTMLViewer demo. Unfortunately
- // it can't go into base.PathService, as the native constant it refers to
- // lives in the ui/ layer. See ui/base/ui_base_paths.h
- final int DIR_RESOURCE_PAKS_ANDROID = 3003;
- PathService.override(DIR_RESOURCE_PAKS_ANDROID,
- "/system/framework/webview/paks");
-
- // Make sure that ResourceProvider is initialized before starting the browser process.
- setUpResources(mWebViewDelegate.getApplication());
- initPlatSupportLibrary();
- AwBrowserProcess.start(mWebViewDelegate.getApplication());
-
- if (isBuildDebuggable()) {
- setWebContentsDebuggingEnabled(true);
- }
-
- TraceEvent.setATraceEnabled(mWebViewDelegate.isTraceTagEnabled());
- mWebViewDelegate.setOnTraceEnabledChangeListener(
- new WebViewDelegate.OnTraceEnabledChangeListener() {
- @Override
- public void onTraceEnabledChange(boolean enabled) {
- TraceEvent.setATraceEnabled(enabled);
- }
- });
- mStarted = true;
-
- for (WeakReference<WebViewChromium> wvc : mWebViewsToStart) {
- WebViewChromium w = wvc.get();
- if (w != null) {
- w.startYourEngine();
- }
- }
- mWebViewsToStart.clear();
- mWebViewsToStart = null;
-
- // Start listening for data reduction proxy setting changes.
- mProxyManager = new DataReductionProxyManager();
- mProxyManager.start(mWebViewDelegate.getApplication());
- }
-
- boolean hasStarted() {
- return mStarted;
- }
-
- void startYourEngines(boolean onMainThread) {
- synchronized (mLock) {
- ensureChromiumStartedLocked(onMainThread);
-
- }
- }
-
- AwBrowserContext getBrowserContext() {
- synchronized (mLock) {
- return getBrowserContextLocked();
- }
- }
-
- private AwBrowserContext getBrowserContextLocked() {
- assert Thread.holdsLock(mLock);
- assert mStarted;
- if (mBrowserContext == null) {
- mBrowserContext = new AwBrowserContext(mWebViewPrefs);
- }
- return mBrowserContext;
- }
-
- private void setWebContentsDebuggingEnabled(boolean enable) {
- if (Looper.myLooper() != ThreadUtils.getUiThreadLooper()) {
- throw new RuntimeException(
- "Toggling of Web Contents Debugging must be done on the UI thread");
- }
- if (mDevToolsServer == null) {
- if (!enable) return;
- mDevToolsServer = new AwDevToolsServer();
- }
- mDevToolsServer.setRemoteDebuggingEnabled(enable);
- }
-
- private void setUpResources(Context context) {
- // The resources are always called com.android.webview even if the manifest has had the
- // package renamed.
- ResourceRewriter.rewriteRValues(
- mWebViewDelegate.getPackageId(context.getResources(), "com.android.webview"));
-
- AwResource.setResources(context.getResources());
- AwResource.setErrorPageResources(android.R.raw.loaderror,
- android.R.raw.nodomain);
- AwResource.setConfigKeySystemUuidMapping(
- android.R.array.config_keySystemUuidMapping);
- }
-
- @Override
- public Statics getStatics() {
- synchronized (mLock) {
- if (mStaticMethods == null) {
- // TODO: Optimization potential: most these methods only need the native library
- // loaded and initialized, not the entire browser process started.
- // See also http://b/7009882
- ensureChromiumStartedLocked(true);
- mStaticMethods = new WebViewFactoryProvider.Statics() {
- @Override
- public String findAddress(String addr) {
- return ContentViewStatics.findAddress(addr);
- }
-
- @Override
- public String getDefaultUserAgent(Context context) {
- return AwSettings.getDefaultUserAgent();
- }
-
- @Override
- public void setWebContentsDebuggingEnabled(boolean enable) {
- // Web Contents debugging is always enabled on debug builds.
- if (!isBuildDebuggable()) {
- WebViewChromiumFactoryProvider.this.
- setWebContentsDebuggingEnabled(enable);
- }
- }
-
- // TODO enable after L release to AOSP
- //@Override
- public void clearClientCertPreferences(Runnable onCleared) {
- AwContentsStatics.clearClientCertPreferences(onCleared);
- }
-
- @Override
- public void freeMemoryForTests() {
- if (ActivityManager.isRunningInTestHarness()) {
- MemoryPressureListener.maybeNotifyMemoryPresure(
- ComponentCallbacks2.TRIM_MEMORY_COMPLETE);
- }
- }
-
- // TODO: Add @Override.
- public void enableSlowWholeDocumentDraw() {
- WebViewChromium.enableSlowWholeDocumentDraw();
- }
-
- @Override
- public Uri[] parseFileChooserResult(int resultCode, Intent intent) {
- return FileChooserParamsAdapter.parseFileChooserResult(resultCode, intent);
- }
- };
- }
- }
- return mStaticMethods;
- }
-
- @Override
- public WebViewProvider createWebView(WebView webView, WebView.PrivateAccess privateAccess) {
- WebViewChromium wvc = new WebViewChromium(this, webView, privateAccess);
-
- synchronized (mLock) {
- if (mWebViewsToStart != null) {
- mWebViewsToStart.add(new WeakReference<WebViewChromium>(wvc));
- }
- }
-
- return wvc;
- }
-
- @Override
- public GeolocationPermissions getGeolocationPermissions() {
- synchronized (mLock) {
- if (mGeolocationPermissions == null) {
- ensureChromiumStartedLocked(true);
- mGeolocationPermissions = new GeolocationPermissionsAdapter(
- getBrowserContextLocked().getGeolocationPermissions());
- }
- }
- return mGeolocationPermissions;
- }
-
- @Override
- public CookieManager getCookieManager() {
- synchronized (mLock) {
- if (mCookieManager == null) {
- if (!mStarted) {
- // We can use CookieManager without starting Chromium; the native code
- // will bring up just the parts it needs to make this work on a temporary
- // basis until Chromium is started for real. The temporary cookie manager
- // needs the application context to have been set.
- ContentMain.initApplicationContext(mWebViewDelegate.getApplication());
- }
- mCookieManager = new CookieManagerAdapter(new AwCookieManager());
- }
- }
- return mCookieManager;
- }
-
- @Override
- public WebIconDatabase getWebIconDatabase() {
- synchronized (mLock) {
- if (mWebIconDatabase == null) {
- ensureChromiumStartedLocked(true);
- mWebIconDatabase = new WebIconDatabaseAdapter();
- }
- }
- return mWebIconDatabase;
- }
-
- @Override
- public WebStorage getWebStorage() {
- synchronized (mLock) {
- if (mWebStorage == null) {
- ensureChromiumStartedLocked(true);
- mWebStorage = new WebStorageAdapter(AwQuotaManagerBridge.getInstance());
- }
- }
- return mWebStorage;
- }
-
- @Override
- public WebViewDatabase getWebViewDatabase(Context context) {
- synchronized (mLock) {
- if (mWebViewDatabase == null) {
- ensureChromiumStartedLocked(true);
- AwBrowserContext browserContext = getBrowserContextLocked();
- mWebViewDatabase = new WebViewDatabaseAdapter(
- browserContext.getFormDatabase(),
- browserContext.getHttpAuthDatabase(context));
- }
- }
- return mWebViewDatabase;
- }
-
- WebViewDelegate getWebViewDelegate() {
- return mWebViewDelegate;
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java b/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java
deleted file mode 100644
index 825bfb1..0000000
--- a/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java
+++ /dev/null
@@ -1,1231 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Picture;
-import android.net.http.SslError;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.provider.Browser;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.webkit.ClientCertRequest;
-import android.webkit.ConsoleMessage;
-import android.webkit.DownloadListener;
-import android.webkit.GeolocationPermissions;
-import android.webkit.JsDialogHelper;
-import android.webkit.JsPromptResult;
-import android.webkit.JsResult;
-import android.webkit.PermissionRequest;
-import android.webkit.SslErrorHandler;
-import android.webkit.ValueCallback;
-import android.webkit.WebChromeClient;
-import android.webkit.WebChromeClient.CustomViewCallback;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import com.android.webview.chromium.WebViewDelegateFactory.WebViewDelegate;
-
-import org.chromium.android_webview.AwContentsClient;
-import org.chromium.android_webview.AwContentsClientBridge;
-import org.chromium.android_webview.AwHttpAuthHandler;
-import org.chromium.android_webview.AwWebResourceResponse;
-import org.chromium.android_webview.JsPromptResultReceiver;
-import org.chromium.android_webview.JsResultReceiver;
-import org.chromium.android_webview.permission.AwPermissionRequest;
-import org.chromium.base.ThreadUtils;
-import org.chromium.base.TraceEvent;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewClient;
-
-import java.lang.ref.WeakReference;
-import java.net.URISyntaxException;
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-/**
- * An adapter class that forwards the callbacks from {@link ContentViewClient}
- * to the appropriate {@link WebViewClient} or {@link WebChromeClient}.
- *
- * An instance of this class is associated with one {@link WebViewChromium}
- * instance. A WebViewChromium is a WebView implementation provider (that is
- * android.webkit.WebView delegates all functionality to it) and has exactly
- * one corresponding {@link ContentView} instance.
- *
- * A {@link ContentViewClient} may be shared between multiple {@link ContentView}s,
- * and hence multiple WebViews. Many WebViewClient methods pass the source
- * WebView as an argument. This means that we either need to pass the
- * corresponding ContentView to the corresponding ContentViewClient methods,
- * or use an instance of ContentViewClientAdapter per WebViewChromium, to
- * allow the source WebView to be injected by ContentViewClientAdapter. We
- * choose the latter, because it makes for a cleaner design.
- */
-public class WebViewContentsClientAdapter extends AwContentsClient {
- // TAG is chosen for consistency with classic webview tracing.
- private static final String TAG = "WebViewCallback";
- // Enables API callback tracing
- private static final boolean TRACE = false;
- // The WebView instance that this adapter is serving.
- private final WebView mWebView;
- // The WebViewClient instance that was passed to WebView.setWebViewClient().
- private WebViewClient mWebViewClient;
- // The WebChromeClient instance that was passed to WebView.setContentViewClient().
- private WebChromeClient mWebChromeClient;
- // The listener receiving find-in-page API results.
- private WebView.FindListener mFindListener;
- // The listener receiving notifications of screen updates.
- private WebView.PictureListener mPictureListener;
-
- private WebViewDelegate mWebViewDelegate;
-
- private DownloadListener mDownloadListener;
-
- private Handler mUiThreadHandler;
-
- private static final int NEW_WEBVIEW_CREATED = 100;
-
- private WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdapter>>
- mOngoingPermissionRequests;
- /**
- * Adapter constructor.
- *
- * @param webView the {@link WebView} instance that this adapter is serving.
- */
- WebViewContentsClientAdapter(WebView webView, WebViewDelegate webViewDelegate) {
- if (webView == null || webViewDelegate == null) {
- throw new IllegalArgumentException("webView or delegate can't be null");
- }
-
- mWebView = webView;
- mWebViewDelegate = webViewDelegate;
- setWebViewClient(null);
-
- mUiThreadHandler = new Handler() {
-
- @Override
- public void handleMessage(Message msg) {
- switch(msg.what) {
- case NEW_WEBVIEW_CREATED:
- WebView.WebViewTransport t = (WebView.WebViewTransport) msg.obj;
- WebView newWebView = t.getWebView();
- if (newWebView == mWebView) {
- throw new IllegalArgumentException(
- "Parent WebView cannot host it's own popup window. Please " +
- "use WebSettings.setSupportMultipleWindows(false)");
- }
-
- if (newWebView != null && newWebView.copyBackForwardList().getSize() != 0) {
- throw new IllegalArgumentException(
- "New WebView for popup window must not have been previously " +
- "navigated.");
- }
-
- WebViewChromium.completeWindowCreation(mWebView, newWebView);
- break;
- default:
- throw new IllegalStateException();
- }
- }
- };
-
- }
-
- // WebViewClassic is coded in such a way that even if a null WebViewClient is set,
- // certain actions take place.
- // We choose to replicate this behavior by using a NullWebViewClient implementation (also known
- // as the Null Object pattern) rather than duplicating the WebViewClassic approach in
- // ContentView.
- static class NullWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
- // TODO: Investigate more and add a test case.
- // This is reflecting Clank's behavior.
- int keyCode = event.getKeyCode();
- return !ContentViewClient.shouldPropagateKey(keyCode);
- }
-
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- Intent intent;
- // Perform generic parsing of the URI to turn it into an Intent.
- try {
- intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
- } catch (URISyntaxException ex) {
- Log.w(TAG, "Bad URI " + url + ": " + ex.getMessage());
- return false;
- }
- // Sanitize the Intent, ensuring web pages can not bypass browser
- // security (only access to BROWSABLE activities).
- intent.addCategory(Intent.CATEGORY_BROWSABLE);
- intent.setComponent(null);
- Intent selector = intent.getSelector();
- if (selector != null) {
- selector.addCategory(Intent.CATEGORY_BROWSABLE);
- selector.setComponent(null);
- }
- // Pass the package name as application ID so that the intent from the
- // same application can be opened in the same tab.
- intent.putExtra(Browser.EXTRA_APPLICATION_ID,
- view.getContext().getPackageName());
- try {
- view.getContext().startActivity(intent);
- } catch (ActivityNotFoundException ex) {
- Log.w(TAG, "No application can handle " + url);
- return false;
- }
- return true;
- }
- }
-
- void setWebViewClient(WebViewClient client) {
- if (client != null) {
- mWebViewClient = client;
- } else {
- mWebViewClient = new NullWebViewClient();
- }
- }
-
- void setWebChromeClient(WebChromeClient client) {
- mWebChromeClient = client;
- }
-
- void setDownloadListener(DownloadListener listener) {
- mDownloadListener = listener;
- }
-
- void setFindListener(WebView.FindListener listener) {
- mFindListener = listener;
- }
-
- void setPictureListener(WebView.PictureListener listener) {
- mPictureListener = listener;
- }
-
- //--------------------------------------------------------------------------------------------
- // Adapter for all the methods.
- //--------------------------------------------------------------------------------------------
-
- /**
- * @see AwContentsClient#getVisitedHistory
- */
- @Override
- public void getVisitedHistory(ValueCallback<String[]> callback) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.getVisitedHistory");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "getVisitedHistory");
- mWebChromeClient.getVisitedHistory(callback);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.getVisitedHistory");
- }
- }
-
- /**
- * @see AwContentsClient#doUpdateVisiteHistory(String, boolean)
- */
- @Override
- public void doUpdateVisitedHistory(String url, boolean isReload) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.doUpdateVisitedHistory");
- if (TRACE) Log.d(TAG, "doUpdateVisitedHistory=" + url + " reload=" + isReload);
- mWebViewClient.doUpdateVisitedHistory(mWebView, url, isReload);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.doUpdateVisitedHistory");
- }
- }
-
- /**
- * @see AwContentsClient#onProgressChanged(int)
- */
- @Override
- public void onProgressChanged(int progress) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onProgressChanged");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onProgressChanged=" + progress);
- mWebChromeClient.onProgressChanged(mWebView, progress);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onProgressChanged");
- }
- }
-
- private static class WebResourceRequestImpl implements WebResourceRequest {
- private final ShouldInterceptRequestParams mParams;
-
- public WebResourceRequestImpl(ShouldInterceptRequestParams params) {
- mParams = params;
- }
-
- @Override
- public Uri getUrl() {
- return Uri.parse(mParams.url);
- }
-
- @Override
- public boolean isForMainFrame() {
- return mParams.isMainFrame;
- }
-
- @Override
- public boolean hasGesture() {
- return mParams.hasUserGesture;
- }
-
- @Override
- public String getMethod() {
- return mParams.method;
- }
-
- @Override
- public Map<String, String> getRequestHeaders() {
- return mParams.requestHeaders;
- }
- }
-
- /**
- * @see AwContentsClient#shouldInterceptRequest(java.lang.String)
- */
- @Override
- public AwWebResourceResponse shouldInterceptRequest(ShouldInterceptRequestParams params) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.shouldInterceptRequest");
- if (TRACE) Log.d(TAG, "shouldInterceptRequest=" + params.url);
- WebResourceResponse response = mWebViewClient.shouldInterceptRequest(mWebView,
- new WebResourceRequestImpl(params));
- if (response == null) return null;
-
- // AwWebResourceResponse should support null headers. b/16332774.
- Map<String, String> responseHeaders = response.getResponseHeaders();
- if (responseHeaders == null)
- responseHeaders = new HashMap<String, String>();
-
- return new AwWebResourceResponse(
- response.getMimeType(),
- response.getEncoding(),
- response.getData(),
- response.getStatusCode(),
- response.getReasonPhrase(),
- responseHeaders);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.shouldInterceptRequest");
- }
- }
-
- /**
- * @see AwContentsClient#shouldOverrideUrlLoading(java.lang.String)
- */
- @Override
- public boolean shouldOverrideUrlLoading(String url) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.shouldOverrideUrlLoading");
- if (TRACE) Log.d(TAG, "shouldOverrideUrlLoading=" + url);
- boolean result = mWebViewClient.shouldOverrideUrlLoading(mWebView, url);
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.shouldOverrideUrlLoading");
- }
- }
-
- /**
- * @see AwContentsClient#onUnhandledKeyEvent(android.view.KeyEvent)
- */
- @Override
- public void onUnhandledKeyEvent(KeyEvent event) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onUnhandledKeyEvent");
- if (TRACE) Log.d(TAG, "onUnhandledKeyEvent");
- mWebViewClient.onUnhandledKeyEvent(mWebView, event);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onUnhandledKeyEvent");
- }
- }
-
- /**
- * @see AwContentsClient#onConsoleMessage(android.webkit.ConsoleMessage)
- */
- @Override
- public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onConsoleMessage");
- boolean result;
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onConsoleMessage: " + consoleMessage.message());
- result = mWebChromeClient.onConsoleMessage(consoleMessage);
- String message = consoleMessage.message();
- if (result && message != null && message.startsWith("[blocked]")) {
- Log.e(TAG, "Blocked URL: " + message);
- }
- } else {
- result = false;
- }
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onConsoleMessage");
- }
- }
-
- /**
- * @see AwContentsClient#onFindResultReceived(int,int,boolean)
- */
- @Override
- public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
- boolean isDoneCounting) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onFindResultReceived");
- if (mFindListener == null) return;
- if (TRACE) Log.d(TAG, "onFindResultReceived");
- mFindListener.onFindResultReceived(activeMatchOrdinal, numberOfMatches, isDoneCounting);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onFindResultReceived");
- }
- }
-
- /**
- * @See AwContentsClient#onNewPicture(Picture)
- */
- @Override
- public void onNewPicture(Picture picture) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onNewPicture");
- if (mPictureListener == null) return;
- if (TRACE) Log.d(TAG, "onNewPicture");
- mPictureListener.onNewPicture(mWebView, picture);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onNewPicture");
- }
- }
-
- @Override
- public void onLoadResource(String url) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onLoadResource");
- if (TRACE) Log.d(TAG, "onLoadResource=" + url);
- mWebViewClient.onLoadResource(mWebView, url);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onLoadResource");
- }
- }
-
- @Override
- public boolean onCreateWindow(boolean isDialog, boolean isUserGesture) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onCreateWindow");
- Message m = mUiThreadHandler.obtainMessage(
- NEW_WEBVIEW_CREATED, mWebView.new WebViewTransport());
- boolean result;
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onCreateWindow");
- result = mWebChromeClient.onCreateWindow(mWebView, isDialog, isUserGesture, m);
- } else {
- result = false;
- }
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onCreateWindow");
- }
- }
-
- /**
- * @see AwContentsClient#onCloseWindow()
- */
- @Override
- public void onCloseWindow() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onCloseWindow");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onCloseWindow");
- mWebChromeClient.onCloseWindow(mWebView);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onCloseWindow");
- }
- }
-
- /**
- * @see AwContentsClient#onRequestFocus()
- */
- @Override
- public void onRequestFocus() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onRequestFocus");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onRequestFocus");
- mWebChromeClient.onRequestFocus(mWebView);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onRequestFocus");
- }
- }
-
- /**
- * @see AwContentsClient#onReceivedTouchIconUrl(String url, boolean precomposed)
- */
- @Override
- public void onReceivedTouchIconUrl(String url, boolean precomposed) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedTouchIconUrl");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onReceivedTouchIconUrl=" + url);
- mWebChromeClient.onReceivedTouchIconUrl(mWebView, url, precomposed);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedTouchIconUrl");
- }
- }
-
- /**
- * @see AwContentsClient#onReceivedIcon(Bitmap bitmap)
- */
- @Override
- public void onReceivedIcon(Bitmap bitmap) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedIcon");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onReceivedIcon");
- mWebChromeClient.onReceivedIcon(mWebView, bitmap);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedIcon");
- }
- }
-
- /**
- * @see ContentViewClient#onPageStarted(String)
- */
- @Override
- public void onPageStarted(String url) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onPageStarted");
- if (TRACE) Log.d(TAG, "onPageStarted=" + url);
- mWebViewClient.onPageStarted(mWebView, url, mWebView.getFavicon());
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onPageStarted");
- }
- }
-
- /**
- * @see ContentViewClient#onPageFinished(String)
- */
- @Override
- public void onPageFinished(String url) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onPageFinished");
- if (TRACE) Log.d(TAG, "onPageFinished=" + url);
- mWebViewClient.onPageFinished(mWebView, url);
-
- // See b/8208948
- // This fakes an onNewPicture callback after onPageFinished to allow
- // CTS tests to run in an un-flaky manner. This is required as the
- // path for sending Picture updates in Chromium are decoupled from the
- // page loading callbacks, i.e. the Chrome compositor may draw our
- // content and send the Picture before onPageStarted or onPageFinished
- // are invoked. The CTS harness discards any pictures it receives before
- // onPageStarted is invoked, so in the case we get the Picture before that and
- // no further updates after onPageStarted, we'll fail the test by timing
- // out waiting for a Picture.
- // To ensure backwards compatibility, we need to defer sending Picture updates
- // until onPageFinished has been invoked. This work is being done
- // upstream, and we can revert this hack when it lands.
- if (mPictureListener != null) {
- ThreadUtils.postOnUiThreadDelayed(new Runnable() {
- @Override
- public void run() {
- UnimplementedWebViewApi.invoke();
- if (mPictureListener != null) {
- if (TRACE) Log.d(TAG, "onPageFinished-fake");
- mPictureListener.onNewPicture(mWebView, new Picture());
- }
- }
- }, 100);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onPageFinished");
- }
- }
-
- /**
- * @see ContentViewClient#onReceivedError(int,String,String)
- */
- @Override
- public void onReceivedError(int errorCode, String description, String failingUrl) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedError");
- if (description == null || description.isEmpty()) {
- // ErrorStrings is @hidden, so we can't do this in AwContents.
- // Normally the net/ layer will set a valid description, but for synthesized callbacks
- // (like in the case for intercepted requests) AwContents will pass in null.
- description = mWebViewDelegate.getErrorString(mWebView.getContext(), errorCode);
- }
- if (TRACE) Log.d(TAG, "onReceivedError=" + failingUrl);
- mWebViewClient.onReceivedError(mWebView, errorCode, description, failingUrl);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedError");
- }
- }
-
- /**
- * @see ContentViewClient#onReceivedTitle(String)
- */
- @Override
- public void onReceivedTitle(String title) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedTitle");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onReceivedTitle");
- mWebChromeClient.onReceivedTitle(mWebView, title);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedTitle");
- }
- }
-
-
- /**
- * @see ContentViewClient#shouldOverrideKeyEvent(KeyEvent)
- */
- @Override
- public boolean shouldOverrideKeyEvent(KeyEvent event) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.shouldOverrideKeyEvent");
- // The check below is reflecting Clank's behavior and is a workaround for
- // http://b/7697782.
- // 1. The check for system key should be made in AwContents or ContentViewCore, before
- // shouldOverrideKeyEvent() is called at all.
- // 2. shouldOverrideKeyEvent() should be called in onKeyDown/onKeyUp, not from
- // dispatchKeyEvent().
- if (!ContentViewClient.shouldPropagateKey(event.getKeyCode())) return true;
- if (TRACE) Log.d(TAG, "shouldOverrideKeyEvent");
- boolean result = mWebViewClient.shouldOverrideKeyEvent(mWebView, event);
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.shouldOverrideKeyEvent");
- }
- }
-
-
- /**
- * @see ContentViewClient#onStartContentIntent(Context, String)
- * Callback when detecting a click on a content link.
- */
- // TODO: Delete this method when removed from base class.
- public void onStartContentIntent(Context context, String contentUrl) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onStartContentIntent");
- if (TRACE) Log.d(TAG, "shouldOverrideUrlLoading=" + contentUrl);
- mWebViewClient.shouldOverrideUrlLoading(mWebView, contentUrl);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onStartContentIntent");
- }
- }
-
- @Override
- public void onGeolocationPermissionsShowPrompt(String origin,
- GeolocationPermissions.Callback callback) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onGeolocationPermissionsShowPrompt");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onGeolocationPermissionsShowPrompt");
- mWebChromeClient.onGeolocationPermissionsShowPrompt(origin, callback);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onGeolocationPermissionsShowPrompt");
- }
- }
-
- @Override
- public void onGeolocationPermissionsHidePrompt() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onGeolocationPermissionsHidePrompt");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onGeolocationPermissionsHidePrompt");
- mWebChromeClient.onGeolocationPermissionsHidePrompt();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onGeolocationPermissionsHidePrompt");
- }
- }
-
- @Override
- public void onPermissionRequest(AwPermissionRequest permissionRequest) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onPermissionRequest");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onPermissionRequest");
- if (mOngoingPermissionRequests == null) {
- mOngoingPermissionRequests =
- new WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdapter>>();
- }
- PermissionRequestAdapter adapter = new PermissionRequestAdapter(permissionRequest);
- mOngoingPermissionRequests.put(
- permissionRequest, new WeakReference<PermissionRequestAdapter>(adapter));
- mWebChromeClient.onPermissionRequest(adapter);
- } else {
- // By default, we deny the permission.
- permissionRequest.deny();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onPermissionRequest");
- }
- }
-
- @Override
- public void onPermissionRequestCanceled(AwPermissionRequest permissionRequest) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onPermissionRequestCanceled");
- if (mWebChromeClient != null && mOngoingPermissionRequests != null) {
- if (TRACE) Log.d(TAG, "onPermissionRequestCanceled");
- WeakReference<PermissionRequestAdapter> weakRef =
- mOngoingPermissionRequests.get(permissionRequest);
- // We don't hold strong reference to PermissionRequestAdpater and don't expect the
- // user only holds weak reference to it either, if so, user has no way to call
- // grant()/deny(), and no need to be notified the cancellation of request.
- if (weakRef != null) {
- PermissionRequestAdapter adapter = weakRef.get();
- if (adapter != null) mWebChromeClient.onPermissionRequestCanceled(adapter);
- }
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onPermissionRequestCanceled");
- }
- }
-
- private static class JsPromptResultReceiverAdapter implements JsResult.ResultReceiver {
- private JsPromptResultReceiver mChromePromptResultReceiver;
- private JsResultReceiver mChromeResultReceiver;
- // We hold onto the JsPromptResult here, just to avoid the need to downcast
- // in onJsResultComplete.
- private final JsPromptResult mPromptResult = new JsPromptResult(this);
-
- public JsPromptResultReceiverAdapter(JsPromptResultReceiver receiver) {
- mChromePromptResultReceiver = receiver;
- }
-
- public JsPromptResultReceiverAdapter(JsResultReceiver receiver) {
- mChromeResultReceiver = receiver;
- }
-
- public JsPromptResult getPromptResult() {
- return mPromptResult;
- }
-
- @Override
- public void onJsResultComplete(JsResult result) {
- if (mChromePromptResultReceiver != null) {
- if (mPromptResult.getResult()) {
- mChromePromptResultReceiver.confirm(mPromptResult.getStringResult());
- } else {
- mChromePromptResultReceiver.cancel();
- }
- } else {
- if (mPromptResult.getResult()) {
- mChromeResultReceiver.confirm();
- } else {
- mChromeResultReceiver.cancel();
- }
- }
- }
- }
-
- @Override
- public void handleJsAlert(String url, String message, JsResultReceiver receiver) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.handleJsAlert");
- if (mWebChromeClient != null) {
- final JsPromptResult res =
- new JsPromptResultReceiverAdapter(receiver).getPromptResult();
- if (TRACE) Log.d(TAG, "onJsAlert");
- if (!mWebChromeClient.onJsAlert(mWebView, url, message, res)) {
- new JsDialogHelper(res, JsDialogHelper.ALERT, null, message, url)
- .showDialog(mWebView.getContext());
- }
- } else {
- receiver.cancel();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.handleJsAlert");
- }
- }
-
- @Override
- public void handleJsBeforeUnload(String url, String message, JsResultReceiver receiver) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.handleJsBeforeUnload");
- if (mWebChromeClient != null) {
- final JsPromptResult res =
- new JsPromptResultReceiverAdapter(receiver).getPromptResult();
- if (TRACE) Log.d(TAG, "onJsBeforeUnload");
- if (!mWebChromeClient.onJsBeforeUnload(mWebView, url, message, res)) {
- new JsDialogHelper(res, JsDialogHelper.UNLOAD, null, message, url)
- .showDialog(mWebView.getContext());
- }
- } else {
- receiver.cancel();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.handleJsBeforeUnload");
- }
- }
-
- @Override
- public void handleJsConfirm(String url, String message, JsResultReceiver receiver) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.handleJsConfirm");
- if (mWebChromeClient != null) {
- final JsPromptResult res =
- new JsPromptResultReceiverAdapter(receiver).getPromptResult();
- if (TRACE) Log.d(TAG, "onJsConfirm");
- if (!mWebChromeClient.onJsConfirm(mWebView, url, message, res)) {
- new JsDialogHelper(res, JsDialogHelper.CONFIRM, null, message, url)
- .showDialog(mWebView.getContext());
- }
- } else {
- receiver.cancel();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.handleJsConfirm");
- }
- }
-
- @Override
- public void handleJsPrompt(String url, String message, String defaultValue,
- JsPromptResultReceiver receiver) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.handleJsPrompt");
- if (mWebChromeClient != null) {
- final JsPromptResult res =
- new JsPromptResultReceiverAdapter(receiver).getPromptResult();
- if (TRACE) Log.d(TAG, "onJsPrompt");
- if (!mWebChromeClient.onJsPrompt(mWebView, url, message, defaultValue, res)) {
- new JsDialogHelper(res, JsDialogHelper.PROMPT, defaultValue, message, url)
- .showDialog(mWebView.getContext());
- }
- } else {
- receiver.cancel();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.handleJsPrompt");
- }
- }
-
- @Override
- public void onReceivedHttpAuthRequest(AwHttpAuthHandler handler, String host, String realm) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedHttpAuthRequest");
- if (TRACE) Log.d(TAG, "onReceivedHttpAuthRequest=" + host);
- mWebViewClient.onReceivedHttpAuthRequest(mWebView,
- new AwHttpAuthHandlerAdapter(handler), host, realm);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedHttpAuthRequest");
- }
- }
-
- @Override
- public void onReceivedSslError(final ValueCallback<Boolean> callback, SslError error) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedSslError");
- SslErrorHandler handler = new SslErrorHandler() {
- @Override
- public void proceed() {
- callback.onReceiveValue(true);
- }
- @Override
- public void cancel() {
- callback.onReceiveValue(false);
- }
- };
- if (TRACE) Log.d(TAG, "onReceivedSslError");
- mWebViewClient.onReceivedSslError(mWebView, handler, error);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedSslError");
- }
- }
-
- private static class ClientCertRequestImpl extends ClientCertRequest {
-
- final private AwContentsClientBridge.ClientCertificateRequestCallback mCallback;
- final private String[] mKeyTypes;
- final private Principal[] mPrincipals;
- final private String mHost;
- final private int mPort;
-
- public ClientCertRequestImpl(
- AwContentsClientBridge.ClientCertificateRequestCallback callback,
- String[] keyTypes, Principal[] principals, String host, int port) {
- mCallback = callback;
- mKeyTypes = keyTypes;
- mPrincipals = principals;
- mHost = host;
- mPort = port;
- }
-
- @Override
- public String[] getKeyTypes() {
- // This is already a copy of native argument, so return directly.
- return mKeyTypes;
- }
-
- @Override
- public Principal[] getPrincipals() {
- // This is already a copy of native argument, so return directly.
- return mPrincipals;
- }
-
- @Override
- public String getHost() {
- return mHost;
- }
-
- @Override
- public int getPort() {
- return mPort;
- }
-
- @Override
- public void proceed(final PrivateKey privateKey, final X509Certificate[] chain) {
- mCallback.proceed(privateKey, chain);
- }
-
- @Override
- public void ignore() {
- mCallback.ignore();
- }
-
- @Override
- public void cancel() {
- mCallback.cancel();
- }
- }
-
- @Override
- public void onReceivedClientCertRequest(
- AwContentsClientBridge.ClientCertificateRequestCallback callback,
- String[] keyTypes, Principal[] principals, String host, int port) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedClientCertRequest");
- if (TRACE) Log.d(TAG, "onReceivedClientCertRequest");
- final ClientCertRequestImpl request = new ClientCertRequestImpl(callback,
- keyTypes, principals, host, port);
- mWebViewClient.onReceivedClientCertRequest(mWebView, request);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedClientCertRequest");
- }
- }
-
- @Override
- public void onReceivedLoginRequest(String realm, String account, String args) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onReceivedLoginRequest");
- if (TRACE) Log.d(TAG, "onReceivedLoginRequest=" + realm);
- mWebViewClient.onReceivedLoginRequest(mWebView, realm, account, args);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onReceivedLoginRequest");
- }
- }
-
- @Override
- public void onFormResubmission(Message dontResend, Message resend) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onFormResubmission");
- if (TRACE) Log.d(TAG, "onFormResubmission");
- mWebViewClient.onFormResubmission(mWebView, dontResend, resend);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onFormResubmission");
- }
-
- }
-
- @Override
- public void onDownloadStart(String url,
- String userAgent,
- String contentDisposition,
- String mimeType,
- long contentLength) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onDownloadStart");
- if (mDownloadListener != null) {
- if (TRACE) Log.d(TAG, "onDownloadStart");
- mDownloadListener.onDownloadStart(url,
- userAgent,
- contentDisposition,
- mimeType,
- contentLength);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onDownloadStart");
- }
- }
-
- @Override
- public void showFileChooser(final ValueCallback<String[]> uploadFileCallback,
- final AwContentsClient.FileChooserParams fileChooserParams) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.showFileChooser");
- if (mWebChromeClient == null) {
- uploadFileCallback.onReceiveValue(null);
- return;
- }
- FileChooserParamsAdapter adapter = new FileChooserParamsAdapter(
- fileChooserParams, mWebView.getContext());
- if (TRACE) Log.d(TAG, "showFileChooser");
- ValueCallback<Uri[]> callbackAdapter = new ValueCallback<Uri[]>() {
- private boolean mCompleted;
- @Override
- public void onReceiveValue(Uri[] uriList) {
- if (mCompleted) {
- throw new IllegalStateException("showFileChooser result was already called");
- }
- mCompleted = true;
- String s[] = null;
- if (uriList != null) {
- s = new String[uriList.length];
- for(int i = 0; i < uriList.length; i++) {
- s[i] = uriList[i].toString();
- }
- }
- uploadFileCallback.onReceiveValue(s);
- }
- };
- if (mWebChromeClient.onShowFileChooser(mWebView, callbackAdapter, adapter)) {
- return;
- }
- if (mWebView.getContext().getApplicationInfo().targetSdkVersion >
- Build.VERSION_CODES.KITKAT) {
- uploadFileCallback.onReceiveValue(null);
- return;
- }
- ValueCallback<Uri> innerCallback = new ValueCallback<Uri>() {
- private boolean mCompleted;
- @Override
- public void onReceiveValue(Uri uri) {
- if (mCompleted) {
- throw new IllegalStateException("showFileChooser result was already called");
- }
- mCompleted = true;
- uploadFileCallback.onReceiveValue(
- uri == null ? null : new String[] { uri.toString() });
- }
- };
- if (TRACE) Log.d(TAG, "openFileChooser");
- mWebChromeClient.openFileChooser(innerCallback, fileChooserParams.acceptTypes,
- fileChooserParams.capture ? "*" : "");
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.showFileChooser");
- }
- }
-
- @Override
- public void onScaleChangedScaled(float oldScale, float newScale) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onScaleChangedScaled");
- if (TRACE) Log.d(TAG, " onScaleChangedScaled");
- mWebViewClient.onScaleChanged(mWebView, oldScale, newScale);
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onScaleChangedScaled");
- }
- }
-
- @Override
- public void onShowCustomView(View view, CustomViewCallback cb) {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onShowCustomView");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onShowCustomView");
- mWebChromeClient.onShowCustomView(view, cb);
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onShowCustomView");
- }
- }
-
- @Override
- public void onHideCustomView() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.onHideCustomView");
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "onHideCustomView");
- mWebChromeClient.onHideCustomView();
- }
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.onHideCustomView");
- }
- }
-
- @Override
- protected View getVideoLoadingProgressView() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.getVideoLoadingProgressView");
- View result;
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "getVideoLoadingProgressView");
- result = mWebChromeClient.getVideoLoadingProgressView();
- } else {
- result = null;
- }
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.getVideoLoadingProgressView");
- }
- }
-
- @Override
- public Bitmap getDefaultVideoPoster() {
- try {
- TraceEvent.begin("WebViewContentsClientAdapter.getDefaultVideoPoster");
- Bitmap result = null;
- if (mWebChromeClient != null) {
- if (TRACE) Log.d(TAG, "getDefaultVideoPoster");
- result = mWebChromeClient.getDefaultVideoPoster();
- }
- if (result == null) {
- // The ic_media_video_poster icon is transparent so we need to draw it on a gray
- // background.
- Bitmap poster = BitmapFactory.decodeResource(
- mWebView.getContext().getResources(),
- R.drawable.ic_media_video_poster);
- result = Bitmap.createBitmap(poster.getWidth(), poster.getHeight(), poster.getConfig());
- result.eraseColor(Color.GRAY);
- Canvas canvas = new Canvas(result);
- canvas.drawBitmap(poster, 0f, 0f, null);
- }
- return result;
- } finally {
- TraceEvent.end("WebViewContentsClientAdapter.getDefaultVideoPoster");
- }
- }
-
- // TODO: Move to upstream.
- private static class AwHttpAuthHandlerAdapter extends android.webkit.HttpAuthHandler {
- private AwHttpAuthHandler mAwHandler;
-
- public AwHttpAuthHandlerAdapter(AwHttpAuthHandler awHandler) {
- mAwHandler = awHandler;
- }
-
- @Override
- public void proceed(String username, String password) {
- if (username == null) {
- username = "";
- }
-
- if (password == null) {
- password = "";
- }
- mAwHandler.proceed(username, password);
- }
-
- @Override
- public void cancel() {
- mAwHandler.cancel();
- }
-
- @Override
- public boolean useHttpAuthUsernamePassword() {
- return mAwHandler.isFirstAttempt();
- }
- }
-
- // TODO: Move to the upstream once the PermissionRequest is part of SDK.
- public static class PermissionRequestAdapter extends PermissionRequest {
- // TODO: Move the below definitions to AwPermissionRequest.
- private static long BITMASK_RESOURCE_VIDEO_CAPTURE = 1 << 1;
- private static long BITMASK_RESOURCE_AUDIO_CAPTURE = 1 << 2;
- private static long BITMASK_RESOURCE_PROTECTED_MEDIA_ID = 1 << 3;
-
- public static long toAwPermissionResources(String[] resources) {
- long result = 0;
- for (String resource : resources) {
- if (resource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE))
- result |= BITMASK_RESOURCE_VIDEO_CAPTURE;
- else if (resource.equals(PermissionRequest.RESOURCE_AUDIO_CAPTURE))
- result |= BITMASK_RESOURCE_AUDIO_CAPTURE;
- else if (resource.equals(PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID))
- result |= BITMASK_RESOURCE_PROTECTED_MEDIA_ID;
- }
- return result;
- }
-
- private static String[] toPermissionResources(long resources) {
- ArrayList<String> result = new ArrayList<String>();
- if ((resources & BITMASK_RESOURCE_VIDEO_CAPTURE) != 0)
- result.add(PermissionRequest.RESOURCE_VIDEO_CAPTURE);
- if ((resources & BITMASK_RESOURCE_AUDIO_CAPTURE) != 0)
- result.add(PermissionRequest.RESOURCE_AUDIO_CAPTURE);
- if ((resources & BITMASK_RESOURCE_PROTECTED_MEDIA_ID) != 0)
- result.add(PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID);
- String[] resource_array = new String[result.size()];
- return result.toArray(resource_array);
- }
-
- private AwPermissionRequest mAwPermissionRequest;
- private String[] mResources;
-
- public PermissionRequestAdapter(AwPermissionRequest awPermissionRequest) {
- assert awPermissionRequest != null;
- mAwPermissionRequest = awPermissionRequest;
- }
-
- @Override
- public Uri getOrigin() {
- return mAwPermissionRequest.getOrigin();
- }
-
- @Override
- public String[] getResources() {
- synchronized (this) {
- if (mResources == null) {
- mResources = toPermissionResources(mAwPermissionRequest.getResources());
- }
- return mResources;
- }
- }
-
- @Override
- public void grant(String[] resources) {
- long requestedResource = mAwPermissionRequest.getResources();
- if ((requestedResource & toAwPermissionResources(resources)) == requestedResource)
- mAwPermissionRequest.grant();
- else
- mAwPermissionRequest.deny();
- }
-
- @Override
- public void deny() {
- mAwPermissionRequest.deny();
- }
-
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewDatabaseAdapter.java b/chromium/java/com/android/webview/chromium/WebViewDatabaseAdapter.java
deleted file mode 100644
index 8ec44a3..0000000
--- a/chromium/java/com/android/webview/chromium/WebViewDatabaseAdapter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-import android.content.Context;
-import android.webkit.WebViewDatabase;
-
-import org.chromium.android_webview.AwFormDatabase;
-import org.chromium.android_webview.HttpAuthDatabase;
-
-/**
- * Chromium implementation of WebViewDatabase -- forwards calls to the
- * chromium internal implementation.
- */
-final class WebViewDatabaseAdapter extends WebViewDatabase {
-
- private AwFormDatabase mFormDatabase;
- private HttpAuthDatabase mHttpAuthDatabase;
-
- public WebViewDatabaseAdapter(AwFormDatabase formDatabase, HttpAuthDatabase httpAuthDatabase) {
- mFormDatabase = formDatabase;
- mHttpAuthDatabase = httpAuthDatabase;
- }
-
- @Override
- public boolean hasUsernamePassword() {
- // This is a deprecated API: intentional no-op.
- return false;
- }
-
- @Override
- public void clearUsernamePassword() {
- // This is a deprecated API: intentional no-op.
- }
-
- @Override
- public boolean hasHttpAuthUsernamePassword() {
- return mHttpAuthDatabase.hasHttpAuthUsernamePassword();
- }
-
- @Override
- public void clearHttpAuthUsernamePassword() {
- mHttpAuthDatabase.clearHttpAuthUsernamePassword();
- }
-
- @Override
- public boolean hasFormData() {
- return mFormDatabase.hasFormData();
- }
-
- @Override
- public void clearFormData() {
- mFormDatabase.clearFormData();
- }
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewDelegateFactory.java b/chromium/java/com/android/webview/chromium/WebViewDelegateFactory.java
deleted file mode 100644
index 2bf6f14..0000000
--- a/chromium/java/com/android/webview/chromium/WebViewDelegateFactory.java
+++ /dev/null
@@ -1,343 +0,0 @@
-package com.android.webview.chromium;
-
-import android.app.Application;
-import android.content.Context;
-import android.content.pm.PackageInfo;
-import android.content.res.AssetManager;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.os.Trace;
-import android.util.SparseArray;
-import android.view.View;
-
-
-import java.lang.reflect.Method;
-
-/**
- * Factory class for {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate}s.
- *
- * <p>{@link WebViewDelegate com.android.webview.chromium.WebViewDelegate}s provide the same
- * interface as {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate} but without
- * a dependency on the webkit class. Defining our own
- * {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} in frameworks/webview
- * allows the WebView apk to be binary compatible with the API 21 version of the framework, in
- * which {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate} had not yet been
- * introduced.
- *
- * <p>The {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} interface and this
- * factory class can be removed once we don't longer need to support WebView apk updates to devices
- * running the API 21 version of the framework. At that point, we should use
- * {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate} directly instead.
- */
-class WebViewDelegateFactory {
-
- /**
- * Copy of {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate}'s interface.
- * See {@link WebViewDelegateFactory} for the reasons why this copy is needed.
- */
- interface WebViewDelegate {
- /** @see android.webkit.WebViewDelegate.OnTraceEnabledChangeListener */
- interface OnTraceEnabledChangeListener {
- void onTraceEnabledChange(boolean enabled);
- }
-
- /** @see android.webkit.WebViewDelegate#setOnTraceEnabledChangeListener */
- void setOnTraceEnabledChangeListener(final OnTraceEnabledChangeListener listener);
-
- /** @see android.webkit.WebViewDelegate#isTraceTagEnabled */
- boolean isTraceTagEnabled();
-
- /** @see android.webkit.WebViewDelegate#canInvokeDrawGlFunctor */
- boolean canInvokeDrawGlFunctor(View containerView);
-
- /** @see android.webkit.WebViewDelegate#invokeDrawGlFunctor */
- void invokeDrawGlFunctor(View containerView, long nativeDrawGLFunctor,
- boolean waitForCompletion);
-
- /** @see android.webkit.WebViewDelegate#callDrawGlFunction */
- void callDrawGlFunction(Canvas canvas, long nativeDrawGLFunctor);
-
- /** @see android.webkit.WebViewDelegate#detachDrawGlFunctor */
- void detachDrawGlFunctor(View containerView, long nativeDrawGLFunctor);
-
- /** @see android.webkit.WebViewDelegate#getPackageId */
- int getPackageId(Resources resources, String packageName);
-
- /** @see android.webkit.WebViewDelegate#getApplication */
- Application getApplication();
-
- /** @see android.webkit.WebViewDelegate#getErrorString */
- String getErrorString(Context context, int errorCode);
-
- /** @see android.webkit.WebViewDelegate#addWebViewAssetPath */
- void addWebViewAssetPath(Context context);
- }
-
- /**
- * Creates a {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} that proxies
- * requests to the given {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate}.
- *
- * @return the created delegate
- */
- static WebViewDelegate createProxyDelegate(android.webkit.WebViewDelegate delegate) {
- return new ProxyDelegate(delegate);
- }
-
- /**
- * Creates a {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} compatible
- * with the API 21 version of the framework in which
- * {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate} had not yet been
- * introduced.
- *
- * @return the created delegate
- */
- static WebViewDelegate createApi21CompatibilityDelegate() {
- return new Api21CompatibilityDelegate();
- }
-
- /**
- * A {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} that proxies requests
- * to a {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate}.
- */
- private static class ProxyDelegate implements WebViewDelegate {
-
- android.webkit.WebViewDelegate delegate;
-
- ProxyDelegate(android.webkit.WebViewDelegate delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public void setOnTraceEnabledChangeListener(final OnTraceEnabledChangeListener listener) {
- delegate.setOnTraceEnabledChangeListener(
- new android.webkit.WebViewDelegate.OnTraceEnabledChangeListener() {
- @Override
- public void onTraceEnabledChange(boolean enabled) {
- listener.onTraceEnabledChange(enabled);
- ;
- }
- });
- }
-
- @Override
- public boolean isTraceTagEnabled() {
- return delegate.isTraceTagEnabled();
- }
-
- @Override
- public boolean canInvokeDrawGlFunctor(View containerView) {
- return delegate.canInvokeDrawGlFunctor(containerView);
- }
-
- @Override
- public void invokeDrawGlFunctor(View containerView, long nativeDrawGLFunctor,
- boolean waitForCompletion) {
- delegate.invokeDrawGlFunctor(containerView, nativeDrawGLFunctor, waitForCompletion);
- }
-
- @Override
- public void callDrawGlFunction(Canvas canvas, long nativeDrawGLFunctor) {
- delegate.callDrawGlFunction(canvas, nativeDrawGLFunctor);
- }
-
- @Override
- public void detachDrawGlFunctor(View containerView, long nativeDrawGLFunctor) {
- delegate.detachDrawGlFunctor(containerView, nativeDrawGLFunctor);
- }
-
- @Override
- public int getPackageId(Resources resources, String packageName) {
- return delegate.getPackageId(resources, packageName);
- }
-
- @Override
- public Application getApplication() {
- return delegate.getApplication();
- }
-
- @Override
- public String getErrorString(Context context, int errorCode) {
- return delegate.getErrorString(context, errorCode);
- }
-
- @Override
- public void addWebViewAssetPath(Context context) {
- delegate.addWebViewAssetPath(context);
- }
- }
-
- /**
- * A {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} compatible with the
- * API 21 version of the framework in which
- * {@link android.webkit.WebViewDelegate android.webkit.WebViewDelegate} had not yet been
- * introduced.
- *
- * <p>This class implements the
- * {@link WebViewDelegate com.android.webview.chromium.WebViewDelegate} functionality by using
- * reflection to call into hidden frameworks APIs released in the API-21 version of the
- * framework.
- */
- private static class Api21CompatibilityDelegate implements WebViewDelegate {
- /** Copy of Trace.TRACE_TAG_WEBVIEW */
- private final static long TRACE_TAG_WEBVIEW = 1L << 4;
-
- /** Hidden APIs released in the API 21 version of the framework */
- private final Method mIsTagEnabledMethod;
- private final Method mAddChangeCallbackMethod;
- private final Method mGetViewRootImplMethod;
- private final Method mInvokeFunctorMethod;
- private final Method mCallDrawGLFunctionMethod;
- private final Method mDetachFunctorMethod;
- private final Method mGetAssignedPackageIdentifiersMethod;
- private final Method mAddAssetPathMethod;
- private final Method mCurrentApplicationMethod;
- private final Method mGetStringMethod;
- private final Method mGetLoadedPackageInfoMethod;
-
- Api21CompatibilityDelegate() {
- try {
- // Important: This reflection essentially defines a snapshot of some hidden APIs
- // at version 21 of the framework for compatibility reasons, and the reflection
- // should not be changed even if those hidden APIs change in future releases.
- mIsTagEnabledMethod = Trace.class.getMethod("isTagEnabled", long.class);
- mAddChangeCallbackMethod = Class.forName("android.os.SystemProperties")
- .getMethod("addChangeCallback", Runnable.class);
- mGetViewRootImplMethod = View.class.getMethod("getViewRootImpl");
- mInvokeFunctorMethod = Class.forName("android.view.ViewRootImpl")
- .getMethod("invokeFunctor", long.class, boolean.class);
- mDetachFunctorMethod = Class.forName("android.view.ViewRootImpl")
- .getMethod("detachFunctor", long.class);
- mCallDrawGLFunctionMethod = Class.forName("android.view.HardwareCanvas")
- .getMethod("callDrawGLFunction", long.class);
- mGetAssignedPackageIdentifiersMethod = AssetManager.class.getMethod(
- "getAssignedPackageIdentifiers");
- mAddAssetPathMethod = AssetManager.class.getMethod(
- "addAssetPath", String.class);
- mCurrentApplicationMethod = Class.forName("android.app.ActivityThread")
- .getMethod("currentApplication");
- mGetStringMethod = Class.forName("android.net.http.ErrorStrings")
- .getMethod("getString", int.class, Context.class);
- mGetLoadedPackageInfoMethod = Class.forName("android.webkit.WebViewFactory")
- .getMethod("getLoadedPackageInfo");
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public void setOnTraceEnabledChangeListener(final OnTraceEnabledChangeListener listener) {
- try {
- mAddChangeCallbackMethod.invoke(null, new Runnable() {
- @Override
- public void run() {
- listener.onTraceEnabledChange(isTraceTagEnabled());
- }
- });
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public boolean isTraceTagEnabled() {
- try {
- return ((Boolean) mIsTagEnabledMethod.invoke(null, TRACE_TAG_WEBVIEW));
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public boolean canInvokeDrawGlFunctor(View containerView) {
- try {
- Object viewRootImpl = mGetViewRootImplMethod.invoke(containerView);
- // viewRootImpl can be null during teardown when window is leaked.
- return viewRootImpl != null;
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public void invokeDrawGlFunctor(View containerView, long nativeDrawGLFunctor,
- boolean waitForCompletion) {
- try {
- Object viewRootImpl = mGetViewRootImplMethod.invoke(containerView);
- if (viewRootImpl != null) {
- mInvokeFunctorMethod.invoke(viewRootImpl, nativeDrawGLFunctor, waitForCompletion);
- }
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public void callDrawGlFunction(Canvas canvas, long nativeDrawGLFunctor) {
- try {
- mCallDrawGLFunctionMethod.invoke(canvas, nativeDrawGLFunctor);
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public void detachDrawGlFunctor(View containerView, long nativeDrawGLFunctor) {
- try {
- Object viewRootImpl = mGetViewRootImplMethod.invoke(containerView);
- if (viewRootImpl != null) {
- mDetachFunctorMethod.invoke(viewRootImpl, nativeDrawGLFunctor);
- }
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public int getPackageId(Resources resources, String packageName) {
- try {
- SparseArray packageIdentifiers =
- (SparseArray) mGetAssignedPackageIdentifiersMethod.invoke(
- resources.getAssets());
- for (int i = 0; i < packageIdentifiers.size(); i++) {
- final String name = (String) packageIdentifiers.valueAt(i);
-
- if (packageName.equals(name)) {
- return packageIdentifiers.keyAt(i);
- }
- }
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- throw new RuntimeException("Package not found: " + packageName);
- }
-
- @Override
- public Application getApplication() {
- try {
- return (Application) mCurrentApplicationMethod.invoke(null);
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public String getErrorString(Context context, int errorCode) {
- try {
- return (String) mGetStringMethod.invoke(null, errorCode, context);
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
-
- @Override
- public void addWebViewAssetPath(Context context) {
- try {
- PackageInfo info = (PackageInfo) mGetLoadedPackageInfoMethod.invoke(null);
- mAddAssetPathMethod.invoke(context.getAssets(), info.applicationInfo.sourceDir);
- } catch (Exception e) {
- throw new RuntimeException("Invalid reflection", e);
- }
- }
- }
-}
-
diff --git a/chromium/package.mk b/chromium/package.mk
index 2f890ca..dd645ad 100644
--- a/chromium/package.mk
+++ b/chromium/package.mk
@@ -37,7 +37,8 @@ LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES += android_webview_java_with_new_resources
-LOCAL_SRC_FILES := $(call all-java-files-under, java)
+LOCAL_SRC_FILES := $(call all-java-files-under, \
+ ../../../$(CHROMIUM_PATH)/android_webview/glue/java/src)
LOCAL_SRC_FILES += $(extra_java_files)
LOCAL_JARJAR_RULES := $(CHROMIUM_PATH)/android_webview/build/jarjar-rules.txt
@@ -45,7 +46,6 @@ LOCAL_JARJAR_RULES := $(CHROMIUM_PATH)/android_webview/build/jarjar-rules.txt
include $(CHROMIUM_PATH)/android_webview/build/resources_config.mk
LOCAL_RESOURCE_DIR := \
$(res_overrides) \
- $(LOCAL_PATH)/res \
$(android_webview_resources_dirs)
LOCAL_AAPT_FLAGS := $(android_webview_aapt_flags)
diff --git a/chromium/res/drawable-hdpi/ic_media_video_poster.png b/chromium/res/drawable-hdpi/ic_media_video_poster.png
deleted file mode 100644
index 77b6b0e..0000000
--- a/chromium/res/drawable-hdpi/ic_media_video_poster.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-hdpi/icon_webview.png b/chromium/res/drawable-hdpi/icon_webview.png
deleted file mode 100644
index 4f9377f..0000000
--- a/chromium/res/drawable-hdpi/icon_webview.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-ldpi/ic_media_video_poster.png b/chromium/res/drawable-ldpi/ic_media_video_poster.png
deleted file mode 100644
index 7b34913..0000000
--- a/chromium/res/drawable-ldpi/ic_media_video_poster.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-mdpi/ic_media_video_poster.png b/chromium/res/drawable-mdpi/ic_media_video_poster.png
deleted file mode 100644
index f457f23..0000000
--- a/chromium/res/drawable-mdpi/ic_media_video_poster.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-mdpi/icon_webview.png b/chromium/res/drawable-mdpi/icon_webview.png
deleted file mode 100644
index 9bc6817..0000000
--- a/chromium/res/drawable-mdpi/icon_webview.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-xhdpi/ic_media_video_poster.png b/chromium/res/drawable-xhdpi/ic_media_video_poster.png
deleted file mode 100644
index 4aa4904..0000000
--- a/chromium/res/drawable-xhdpi/ic_media_video_poster.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-xhdpi/icon_webview.png b/chromium/res/drawable-xhdpi/icon_webview.png
deleted file mode 100644
index 9412fbe..0000000
--- a/chromium/res/drawable-xhdpi/icon_webview.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/drawable-xxhdpi/icon_webview.png b/chromium/res/drawable-xxhdpi/icon_webview.png
deleted file mode 100644
index bd8c447..0000000
--- a/chromium/res/drawable-xxhdpi/icon_webview.png
+++ /dev/null
Binary files differ
diff --git a/chromium/res/values-af/strings.xml b/chromium/res/values-af/strings.xml
deleted file mode 100644
index 5a9af53..0000000
--- a/chromium/res/values-af/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Dié weergawe van Android steun nie díe funksie nie."</string>
-</resources>
diff --git a/chromium/res/values-am/strings.xml b/chromium/res/values-am/strings.xml
deleted file mode 100644
index 944f0b5..0000000
--- a/chromium/res/values-am/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"ይህ ተግባራዊ በዚህ የAndroid ስሪት ላይ የተደገ አይደለም።"</string>
-</resources>
diff --git a/chromium/res/values-ar/strings.xml b/chromium/res/values-ar/strings.xml
deleted file mode 100644
index 15f29db..0000000
--- a/chromium/res/values-ar/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"‏هذه الخدمة غير متوافقة مع هذا الإصدار من Android."</string>
-</resources>
diff --git a/chromium/res/values-az-rAZ/strings.xml b/chromium/res/values-az-rAZ/strings.xml
deleted file mode 100644
index 8f388bd..0000000
--- a/chromium/res/values-az-rAZ/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="5444325116504635857">"Bu funksionallıq Androidin bu versiyasında dəstəklənmir."</string>
-</resources>
diff --git a/chromium/res/values-az/strings.xml b/chromium/res/values-az/strings.xml
deleted file mode 100644
index 8f388bd..0000000
--- a/chromium/res/values-az/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="5444325116504635857">"Bu funksionallıq Androidin bu versiyasında dəstəklənmir."</string>
-</resources>
diff --git a/chromium/res/values-bg/strings.xml b/chromium/res/values-bg/strings.xml
deleted file mode 100644
index d57e8fd..0000000
--- a/chromium/res/values-bg/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Функционалността не се поддържа в тази версия на Android."</string>
-</resources>
diff --git a/chromium/res/values-bn-rBD/strings.xml b/chromium/res/values-bn-rBD/strings.xml
deleted file mode 100644
index 9add0e9..0000000
--- a/chromium/res/values-bn-rBD/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"এই কার্যকারিতাটি Android এর এই সংস্করণে সমর্থিত নয়।"</string>
-</resources>
diff --git a/chromium/res/values-ca/strings.xml b/chromium/res/values-ca/strings.xml
deleted file mode 100644
index a4c2a83..0000000
--- a/chromium/res/values-ca/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Aquesta funció no és compatible amb aquesta versió d\'Android."</string>
-</resources>
diff --git a/chromium/res/values-cs/strings.xml b/chromium/res/values-cs/strings.xml
deleted file mode 100644
index f0a8c29..0000000
--- a/chromium/res/values-cs/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Tuto funkci daná verze systému Android nepodporuje."</string>
-</resources>
diff --git a/chromium/res/values-da/strings.xml b/chromium/res/values-da/strings.xml
deleted file mode 100644
index 4284767..0000000
--- a/chromium/res/values-da/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Denne funktion understøttes ikke i denne version af Android."</string>
-</resources>
diff --git a/chromium/res/values-de/strings.xml b/chromium/res/values-de/strings.xml
deleted file mode 100644
index f714539..0000000
--- a/chromium/res/values-de/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Die Funktion wird von dieser Android-Version nicht unterstützt."</string>
-</resources>
diff --git a/chromium/res/values-el/strings.xml b/chromium/res/values-el/strings.xml
deleted file mode 100644
index 9e2d943..0000000
--- a/chromium/res/values-el/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Αυτή η λειτουργία δεν υποστηρίζεται σε αυτήν την έκδοση Android."</string>
-</resources>
diff --git a/chromium/res/values-en-rGB/strings.xml b/chromium/res/values-en-rGB/strings.xml
deleted file mode 100644
index 388e12c..0000000
--- a/chromium/res/values-en-rGB/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"This functionality is not supported in this version of Android."</string>
-</resources>
diff --git a/chromium/res/values-en-rIN/strings.xml b/chromium/res/values-en-rIN/strings.xml
deleted file mode 100644
index 388e12c..0000000
--- a/chromium/res/values-en-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"This functionality is not supported in this version of Android."</string>
-</resources>
diff --git a/chromium/res/values-es-rUS/strings.xml b/chromium/res/values-es-rUS/strings.xml
deleted file mode 100644
index 1320a1c..0000000
--- a/chromium/res/values-es-rUS/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Incompatible con versión"</string>
-</resources>
diff --git a/chromium/res/values-es/strings.xml b/chromium/res/values-es/strings.xml
deleted file mode 100644
index 383c959..0000000
--- a/chromium/res/values-es/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Incompatible con versión."</string>
-</resources>
diff --git a/chromium/res/values-et-rEE/strings.xml b/chromium/res/values-et-rEE/strings.xml
deleted file mode 100644
index 4d9682d..0000000
--- a/chromium/res/values-et-rEE/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"See funktsioon pole selles Androidi versioonis toetatud."</string>
-</resources>
diff --git a/chromium/res/values-eu-rES/strings.xml b/chromium/res/values-eu-rES/strings.xml
deleted file mode 100644
index ec152a0..0000000
--- a/chromium/res/values-eu-rES/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android bertsio honek ez du funtzio hori onartzen."</string>
-</resources>
diff --git a/chromium/res/values-fa/strings.xml b/chromium/res/values-fa/strings.xml
deleted file mode 100644
index 4207c0b..0000000
--- a/chromium/res/values-fa/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"‏این عملکرد در این نسخه Android پشتیبانی نمی‌شود."</string>
-</resources>
diff --git a/chromium/res/values-fi/strings.xml b/chromium/res/values-fi/strings.xml
deleted file mode 100644
index 4350924..0000000
--- a/chromium/res/values-fi/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Toiminnallisuutta ei tueta tässä Android-versiossa."</string>
-</resources>
diff --git a/chromium/res/values-fr-rCA/strings.xml b/chromium/res/values-fr-rCA/strings.xml
deleted file mode 100644
index 39caa21..0000000
--- a/chromium/res/values-fr-rCA/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Cette fonctionnalité n\'est pas compatible avec cette version d\'Android."</string>
-</resources>
diff --git a/chromium/res/values-fr/strings.xml b/chromium/res/values-fr/strings.xml
deleted file mode 100644
index d735e7d..0000000
--- a/chromium/res/values-fr/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Fonctionnalité non compatible avec cette version d\'Android."</string>
-</resources>
diff --git a/chromium/res/values-gl-rES/strings.xml b/chromium/res/values-gl-rES/strings.xml
deleted file mode 100644
index 4246bfa..0000000
--- a/chromium/res/values-gl-rES/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Esta funcionalidade non é compatible con esta versión de Android."</string>
-</resources>
diff --git a/chromium/res/values-hi/strings.xml b/chromium/res/values-hi/strings.xml
deleted file mode 100644
index 6972fce..0000000
--- a/chromium/res/values-hi/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"कार्यक्षमता, Android वर्शन में समर्थित नहीं."</string>
-</resources>
diff --git a/chromium/res/values-hr/strings.xml b/chromium/res/values-hr/strings.xml
deleted file mode 100644
index e7e1d83..0000000
--- a/chromium/res/values-hr/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Ver. Androida ne podrž. tu fun."</string>
-</resources>
diff --git a/chromium/res/values-hu/strings.xml b/chromium/res/values-hu/strings.xml
deleted file mode 100644
index 67b848c..0000000
--- a/chromium/res/values-hu/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Ez a funkció nem támogatott az Android ezen verzióján."</string>
-</resources>
diff --git a/chromium/res/values-hy-rAM/strings.xml b/chromium/res/values-hy-rAM/strings.xml
deleted file mode 100644
index 55dfcb1..0000000
--- a/chromium/res/values-hy-rAM/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Այս գործառույթը Android-ի այս տարբերակում չի աջակցվում:"</string>
-</resources>
diff --git a/chromium/res/values-in/strings.xml b/chromium/res/values-in/strings.xml
deleted file mode 100644
index d7b08bb..0000000
--- a/chromium/res/values-in/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Fungsi ini tidak didukung oleh versi Android ini."</string>
-</resources>
diff --git a/chromium/res/values-is-rIS/strings.xml b/chromium/res/values-is-rIS/strings.xml
deleted file mode 100644
index d6245e6..0000000
--- a/chromium/res/values-is-rIS/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Þessi eiginleiki er ekki studdur í þessari útgáfu af Android."</string>
-</resources>
diff --git a/chromium/res/values-it/strings.xml b/chromium/res/values-it/strings.xml
deleted file mode 100644
index f407a4b..0000000
--- a/chromium/res/values-it/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Questa funzionalità non è supportata in questa versione di Android."</string>
-</resources>
diff --git a/chromium/res/values-iw/strings.xml b/chromium/res/values-iw/strings.xml
deleted file mode 100644
index 9be0ed5..0000000
--- a/chromium/res/values-iw/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"פעולה לא נתמכת בגרסה זו."</string>
-</resources>
diff --git a/chromium/res/values-ja/strings.xml b/chromium/res/values-ja/strings.xml
deleted file mode 100644
index 44ca5a8..0000000
--- a/chromium/res/values-ja/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"この機能はこのバージョンのAndroidではサポートされていません。"</string>
-</resources>
diff --git a/chromium/res/values-ka-rGE/strings.xml b/chromium/res/values-ka-rGE/strings.xml
deleted file mode 100644
index 7735693..0000000
--- a/chromium/res/values-ka-rGE/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"ამ ვერს. ფუნქც.მხარდაუჭ."</string>
-</resources>
diff --git a/chromium/res/values-kk-rKZ/strings.xml b/chromium/res/values-kk-rKZ/strings.xml
deleted file mode 100644
index 9248461..0000000
--- a/chromium/res/values-kk-rKZ/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Бұл фун. осы Android қолдам."</string>
-</resources>
diff --git a/chromium/res/values-km-rKH/strings.xml b/chromium/res/values-km-rKH/strings.xml
deleted file mode 100644
index c2cbf48..0000000
--- a/chromium/res/values-km-rKH/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"មុខងារនេះមិនត្រូវបានគាំទ្រនៅក្នុងកំណែ Android នេះទេ។"</string>
-</resources>
diff --git a/chromium/res/values-kn-rIN/strings.xml b/chromium/res/values-kn-rIN/strings.xml
deleted file mode 100644
index 8dbf6c9..0000000
--- a/chromium/res/values-kn-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android ನ ಈ ಆವೃತ್ತಿಯಲ್ಲಿ ಈ ಕಾರ್ಯಕ್ಷಮತೆಯು ಬೆಂಬಲಿತವಾಗಿಲ್ಲ."</string>
-</resources>
diff --git a/chromium/res/values-ko/strings.xml b/chromium/res/values-ko/strings.xml
deleted file mode 100644
index f097b7f..0000000
--- a/chromium/res/values-ko/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"사용 중인 Android 버전에서 지원되지 않는 기능입니다."</string>
-</resources>
diff --git a/chromium/res/values-ky-rKG/strings.xml b/chromium/res/values-ky-rKG/strings.xml
deleted file mode 100644
index 2262754..0000000
--- a/chromium/res/values-ky-rKG/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Бул функция ушул Android версиясында колдоого алынбайт."</string>
-</resources>
diff --git a/chromium/res/values-lo-rLA/strings.xml b/chromium/res/values-lo-rLA/strings.xml
deleted file mode 100644
index 1fa390b..0000000
--- a/chromium/res/values-lo-rLA/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"ຄວາມ​ສາມາດນີ້​ຍັງບໍ່ຖືກ​ຮອງຮັບໃນ Android ເວີຊັນ​ນີ້ເທື່ອ."</string>
-</resources>
diff --git a/chromium/res/values-lt/strings.xml b/chromium/res/values-lt/strings.xml
deleted file mode 100644
index 3eee6c6..0000000
--- a/chromium/res/values-lt/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Šios v. „Android“ šios funkc. nepal."</string>
-</resources>
diff --git a/chromium/res/values-lv/strings.xml b/chromium/res/values-lv/strings.xml
deleted file mode 100644
index c6be5ba..0000000
--- a/chromium/res/values-lv/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Šajā Android versijā šī funkcija netiek atbalstīta."</string>
-</resources>
diff --git a/chromium/res/values-mk-rMK/strings.xml b/chromium/res/values-mk-rMK/strings.xml
deleted file mode 100644
index 8ca84e9..0000000
--- a/chromium/res/values-mk-rMK/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Функцијата не е поддржана во оваа верзија на Android."</string>
-</resources>
diff --git a/chromium/res/values-ml-rIN/strings.xml b/chromium/res/values-ml-rIN/strings.xml
deleted file mode 100644
index 3713095..0000000
--- a/chromium/res/values-ml-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android-ന്റെ ഈ പതിപ്പിൽ ഈ പ്രവർത്തനത്തെ പിന്തുണയ്ക്കില്ല."</string>
-</resources>
diff --git a/chromium/res/values-mn-rMN/strings.xml b/chromium/res/values-mn-rMN/strings.xml
deleted file mode 100644
index 31bc7ab..0000000
--- a/chromium/res/values-mn-rMN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Андройдын энэ хувилбар дээр энэ функц дэмжигдээгүй."</string>
-</resources>
diff --git a/chromium/res/values-mr-rIN/strings.xml b/chromium/res/values-mr-rIN/strings.xml
deleted file mode 100644
index 0ce6a26..0000000
--- a/chromium/res/values-mr-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android च्‍या या आवृत्तीत ही कार्यक्षमता समर्थित नाही."</string>
-</resources>
diff --git a/chromium/res/values-ms-rMY/strings.xml b/chromium/res/values-ms-rMY/strings.xml
deleted file mode 100644
index 219a935..0000000
--- a/chromium/res/values-ms-rMY/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Fungsi ini tidak disokong dalam Android versi ini."</string>
-</resources>
diff --git a/chromium/res/values-my-rMM/strings.xml b/chromium/res/values-my-rMM/strings.xml
deleted file mode 100644
index e819ed0..0000000
--- a/chromium/res/values-my-rMM/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"ဤဗားရှင်းတွင် သုံးမရပါ။"</string>
-</resources>
diff --git a/chromium/res/values-nb/strings.xml b/chromium/res/values-nb/strings.xml
deleted file mode 100644
index a07b17f..0000000
--- a/chromium/res/values-nb/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Denne funksjonaliteten støttes ikke i denne Android-versjonen."</string>
-</resources>
diff --git a/chromium/res/values-ne-rNP/strings.xml b/chromium/res/values-ne-rNP/strings.xml
deleted file mode 100644
index ce13393..0000000
--- a/chromium/res/values-ne-rNP/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android को यस संस्करणमा यो कार्य समर्थित छैन।"</string>
-</resources>
diff --git a/chromium/res/values-ne/strings.xml b/chromium/res/values-ne/strings.xml
deleted file mode 100644
index 2f45b9c..0000000
--- a/chromium/res/values-ne/strings.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-</resources>
diff --git a/chromium/res/values-nl/strings.xml b/chromium/res/values-nl/strings.xml
deleted file mode 100644
index c8ef70a..0000000
--- a/chromium/res/values-nl/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Deze functionaliteit wordt niet ondersteund in deze versie van Android."</string>
-</resources>
diff --git a/chromium/res/values-pl/strings.xml b/chromium/res/values-pl/strings.xml
deleted file mode 100644
index d7524ac..0000000
--- a/chromium/res/values-pl/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"W tej wersji Androida ta funkcja jest niedostępna."</string>
-</resources>
diff --git a/chromium/res/values-pt-rPT/strings.xml b/chromium/res/values-pt-rPT/strings.xml
deleted file mode 100644
index 460b29a..0000000
--- a/chromium/res/values-pt-rPT/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Esta funcionalidade não é compatível com esta versão do Android."</string>
-</resources>
diff --git a/chromium/res/values-pt/strings.xml b/chromium/res/values-pt/strings.xml
deleted file mode 100644
index b8db4b0..0000000
--- a/chromium/res/values-pt/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Não ac. neste Android."</string>
-</resources>
diff --git a/chromium/res/values-ro/strings.xml b/chromium/res/values-ro/strings.xml
deleted file mode 100644
index a45ff3a..0000000
--- a/chromium/res/values-ro/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Această funcție nu este acceptată în această versiune de Android."</string>
-</resources>
diff --git a/chromium/res/values-ru/strings.xml b/chromium/res/values-ru/strings.xml
deleted file mode 100644
index fb5c12f..0000000
--- a/chromium/res/values-ru/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Эта функция не поддерживается в данной версии Android"</string>
-</resources>
diff --git a/chromium/res/values-si-rLK/strings.xml b/chromium/res/values-si-rLK/strings.xml
deleted file mode 100644
index 039f0e1..0000000
--- a/chromium/res/values-si-rLK/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"මෙම ක්‍රියාකාරිත්වය මෙම Android අනුවාදයේ සහය නොදක්වයි."</string>
-</resources>
diff --git a/chromium/res/values-si/strings.xml b/chromium/res/values-si/strings.xml
deleted file mode 100644
index 2f45b9c..0000000
--- a/chromium/res/values-si/strings.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-</resources>
diff --git a/chromium/res/values-sk/strings.xml b/chromium/res/values-sk/strings.xml
deleted file mode 100644
index 5989b27..0000000
--- a/chromium/res/values-sk/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Funkcia nie je v tejto verzii Androidu podporovaná."</string>
-</resources>
diff --git a/chromium/res/values-sl/strings.xml b/chromium/res/values-sl/strings.xml
deleted file mode 100644
index 501fb33..0000000
--- a/chromium/res/values-sl/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Ta funkcija ni podprta v tej različici Androida."</string>
-</resources>
diff --git a/chromium/res/values-sr/strings.xml b/chromium/res/values-sr/strings.xml
deleted file mode 100644
index 0ca5ec1..0000000
--- a/chromium/res/values-sr/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Ова функција није подржана у овој верзији Android-а."</string>
-</resources>
diff --git a/chromium/res/values-sv/strings.xml b/chromium/res/values-sv/strings.xml
deleted file mode 100644
index c97f584..0000000
--- a/chromium/res/values-sv/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Funktionen stöds inte i den här versionen av Android."</string>
-</resources>
diff --git a/chromium/res/values-sw/strings.xml b/chromium/res/values-sw/strings.xml
deleted file mode 100644
index 28afac3..0000000
--- a/chromium/res/values-sw/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Utendaji huu hauwezi kutumika katika toleo hili la Android."</string>
-</resources>
diff --git a/chromium/res/values-ta-rIN/strings.xml b/chromium/res/values-ta-rIN/strings.xml
deleted file mode 100644
index 66ed197..0000000
--- a/chromium/res/values-ta-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"இந்த Android பதிப்பில், செயல்பாடு ஆதரிக்கப்படவில்லை."</string>
-</resources>
diff --git a/chromium/res/values-te-rIN/strings.xml b/chromium/res/values-te-rIN/strings.xml
deleted file mode 100644
index cf369e8..0000000
--- a/chromium/res/values-te-rIN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"ఈ కార్యాచరణకు ఈ Android సంస్కరణలో మద్దతు లేదు."</string>
-</resources>
diff --git a/chromium/res/values-th/strings.xml b/chromium/res/values-th/strings.xml
deleted file mode 100644
index c25d58f..0000000
--- a/chromium/res/values-th/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Android ไม่รองรับ"</string>
-</resources>
diff --git a/chromium/res/values-tl/strings.xml b/chromium/res/values-tl/strings.xml
deleted file mode 100644
index 3aeb7fd..0000000
--- a/chromium/res/values-tl/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Hindi sinusuportahan functionality sa Android version na ito."</string>
-</resources>
diff --git a/chromium/res/values-tr/strings.xml b/chromium/res/values-tr/strings.xml
deleted file mode 100644
index c6833c5..0000000
--- a/chromium/res/values-tr/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Bu işlev, Android\'in bu sürümünde desteklenmiyor."</string>
-</resources>
diff --git a/chromium/res/values-uk/strings.xml b/chromium/res/values-uk/strings.xml
deleted file mode 100644
index 0774531..0000000
--- a/chromium/res/values-uk/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Функція не підтримується в цій версії Android."</string>
-</resources>
diff --git a/chromium/res/values-ur-rPK/strings.xml b/chromium/res/values-ur-rPK/strings.xml
deleted file mode 100644
index 0926aeb..0000000
--- a/chromium/res/values-ur-rPK/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"‏یہ فعالیت Android کے اس ورژن میں تعاون یافتہ نہیں ہے۔"</string>
-</resources>
diff --git a/chromium/res/values-uz-rUZ/strings.xml b/chromium/res/values-uz-rUZ/strings.xml
deleted file mode 100644
index 53c31b2..0000000
--- a/chromium/res/values-uz-rUZ/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Bu xususiyat Androidning ushbu versiyasida ishlamaydi."</string>
-</resources>
diff --git a/chromium/res/values-vi/strings.xml b/chromium/res/values-vi/strings.xml
deleted file mode 100644
index 29c7ee8..0000000
--- a/chromium/res/values-vi/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Chức năng này không được hỗ trợ trong phiên bản này của Android."</string>
-</resources>
diff --git a/chromium/res/values-zh-rCN/strings.xml b/chromium/res/values-zh-rCN/strings.xml
deleted file mode 100644
index fcaa983..0000000
--- a/chromium/res/values-zh-rCN/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"此版本的Android系统不支持该功能。"</string>
-</resources>
diff --git a/chromium/res/values-zh-rHK/strings.xml b/chromium/res/values-zh-rHK/strings.xml
deleted file mode 100644
index 5a37ee7..0000000
--- a/chromium/res/values-zh-rHK/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"這個 Android 版本不支援這項功能。"</string>
-</resources>
diff --git a/chromium/res/values-zh-rTW/strings.xml b/chromium/res/values-zh-rTW/strings.xml
deleted file mode 100644
index 5a37ee7..0000000
--- a/chromium/res/values-zh-rTW/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"這個 Android 版本不支援這項功能。"</string>
-</resources>
diff --git a/chromium/res/values-zu/strings.xml b/chromium/res/values-zu/strings.xml
deleted file mode 100644
index 484b4c4..0000000
--- a/chromium/res/values-zu/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="webviewchromium_private_browsing_warning" msgid="4489411236472600535">"Lokhu kusebenza akusekelwe kule nguqulo ye-Android."</string>
-</resources>
diff --git a/chromium/res/values/strings.xml b/chromium/res/values/strings.xml
deleted file mode 100644
index ef71152..0000000
--- a/chromium/res/values/strings.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
--->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Contextual action bar item for sharing a block of text via email, or
- other method. [CHAR-LIMIT=128] -->
- <string name="webviewchromium_private_browsing_warning">This functionality is not supported in this version of Android.</string>
-</resources>