Commit 18f49b50 authored by noamsml@chromium.org's avatar noamsml@chromium.org

Revert of https://codereview.chromium.org/115253004/

Reason for revert: http://crbug.com/332434

TBR=benm@chromium.org,mnaganov@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=332089

Review URL: https://codereview.chromium.org/128933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243615 0039d316-1c4b-4281-b951-d872f2087c98
parent 531593dd
......@@ -10,7 +10,6 @@ import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.provider.Settings;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState;
......@@ -27,8 +26,8 @@ import org.chromium.base.ThreadUtils;
*/
@JNINamespace("android_webview")
public class AwSettings {
// Do not use! Will be removed soon. See crbug.com/332089.
// Use android.webkit.WebSettings.LayoutAlgorithm instead.
// This enum corresponds to WebSettings.LayoutAlgorithm. We use our own to be
// able to extend it.
public enum LayoutAlgorithm {
NORMAL,
SINGLE_COLUMN,
......@@ -51,8 +50,7 @@ public class AwSettings {
// Lock to protect all settings.
private final Object mAwSettingsLock = new Object();
private WebSettings.LayoutAlgorithm mLayoutAlgorithm =
WebSettings.LayoutAlgorithm.NARROW_COLUMNS;
private LayoutAlgorithm mLayoutAlgorithm = LayoutAlgorithm.NARROW_COLUMNS;
private int mTextSizePercent = 100;
private String mStandardFontFamily = "sans-serif";
private String mFixedFontFamily = "monospace";
......@@ -183,9 +181,7 @@ public class AwSettings {
while (mIsUpdateWebkitPrefsMessagePending) {
mAwSettingsLock.wait();
}
} catch (InterruptedException e) {
Log.w(TAG, "updateWebkitPreferencesLocked interrupted", e);
}
} catch (InterruptedException e) {}
}
}
}
......@@ -1030,21 +1026,10 @@ public class AwSettings {
return mJavaScriptCanOpenWindowsAutomatically;
}
// A temporary adapter to avoid breaking code from Android frameworks/webview. crbug.com/332089
public void setLayoutAlgorithm(AwSettings.LayoutAlgorithm l) {
final WebSettings.LayoutAlgorithm[] webViewValues = {
WebSettings.LayoutAlgorithm.NORMAL,
WebSettings.LayoutAlgorithm.SINGLE_COLUMN,
WebSettings.LayoutAlgorithm.NARROW_COLUMNS,
WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING
};
setLayoutAlgorithm(webViewValues[l.ordinal()]);
}
/**
* See {@link android.webkit.WebSettings#setLayoutAlgorithm}.
*/
public void setLayoutAlgorithm(WebSettings.LayoutAlgorithm l) {
public void setLayoutAlgorithm(LayoutAlgorithm l) {
synchronized (mAwSettingsLock) {
if (mLayoutAlgorithm != l) {
mLayoutAlgorithm = l;
......@@ -1056,7 +1041,7 @@ public class AwSettings {
/**
* See {@link android.webkit.WebSettings#getLayoutAlgorithm}.
*/
public WebSettings.LayoutAlgorithm getLayoutAlgorithm() {
public LayoutAlgorithm getLayoutAlgorithm() {
synchronized (mAwSettingsLock) {
return mLayoutAlgorithm;
}
......@@ -1070,7 +1055,7 @@ public class AwSettings {
*/
@CalledByNative
private boolean getTextAutosizingEnabledLocked() {
return mLayoutAlgorithm == WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING;
return mLayoutAlgorithm == LayoutAlgorithm.TEXT_AUTOSIZING;
}
/**
......
......@@ -14,12 +14,12 @@ import android.test.suitebuilder.annotation.SmallTest;
import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import org.apache.http.Header;
import org.apache.http.HttpRequest;
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.AwSettings.LayoutAlgorithm;
import org.chromium.android_webview.InterceptedRequestData;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.ImagePageGenerator;
......@@ -1919,7 +1919,7 @@ public class AwSettingsTest extends AwTestBase {
}
}
static class AudioEvent {
public static class AudioEvent {
private CallbackHelper mCallback;
public AudioEvent(CallbackHelper callback) {
mCallback = callback;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment