summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authormnaganov <mnaganov@chromium.org>2015-01-19 13:42:52 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-19 21:43:56 +0000
commit2ff7ac16165a1c6fd017f96094bec5157f0f5ea0 (patch)
tree2c5baa925da8164c92fca6b48cd703cdd27df31f /android_webview
parent6f5436950cf5ffea26c6203d3f1f083ea8097cc8 (diff)
downloadchromium_src-2ff7ac16165a1c6fd017f96094bec5157f0f5ea0.zip
chromium_src-2ff7ac16165a1c6fd017f96094bec5157f0f5ea0.tar.gz
chromium_src-2ff7ac16165a1c6fd017f96094bec5157f0f5ea0.tar.bz2
[Android WebView] Remove AwSettings.LayoutAlgorithm
The custom enum was introduced in pre-KitKat times before the new API had been officially published. Now it should be possible to remove it. BUG=332089 Review URL: https://codereview.chromium.org/837633010 Cr-Commit-Position: refs/heads/master@{#312147}
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/glue/java/src/com/android/webview/chromium/ContentSettingsAdapter.java19
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwSettings.java10
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java2
3 files changed, 5 insertions, 26 deletions
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/ContentSettingsAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/ContentSettingsAdapter.java
index b777d6a..1826e78 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/ContentSettingsAdapter.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/ContentSettingsAdapter.java
@@ -240,26 +240,13 @@ public class ContentSettingsAdapter extends android.webkit.WebSettings {
@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()]);
+ if (TRACE) Log.d(LOGTAG, "setLayoutAlgorithm=" + l);
+ mAwSettings.setLayoutAlgorithm(l);
}
@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()];
+ return mAwSettings.getLayoutAlgorithm();
}
@Override
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
index a80f637..d6bd505 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java
@@ -12,6 +12,7 @@ import android.os.Process;
import android.provider.Settings;
import android.util.Log;
import android.webkit.WebSettings;
+import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.PluginState;
import org.chromium.base.CalledByNative;
@@ -28,15 +29,6 @@ import org.chromium.base.VisibleForTesting;
*/
@JNINamespace("android_webview")
public class AwSettings {
- // This enum corresponds to WebSettings.LayoutAlgorithm. We use our own to be
- // able to extend it.
- public enum LayoutAlgorithm {
- NORMAL,
- SINGLE_COLUMN,
- NARROW_COLUMNS,
- TEXT_AUTOSIZING,
- }
-
// These constants must be kept in sync with the Android framework, defined in WebSettimgs.
@VisibleForTesting
public static final int MIXED_CONTENT_ALWAYS_ALLOW = 0;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
index eed1208..27fe68c 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
@@ -15,6 +15,7 @@ import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebSettings;
+import android.webkit.WebSettings.LayoutAlgorithm;
import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
@@ -23,7 +24,6 @@ import org.apache.http.HttpRequest;
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwContentsClient.ShouldInterceptRequestParams;
import org.chromium.android_webview.AwSettings;
-import org.chromium.android_webview.AwSettings.LayoutAlgorithm;
import org.chromium.android_webview.AwWebResourceResponse;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.ImagePageGenerator;