Bug 733153 - Remove obsolete widget.ime.android.landscape_fullscreen and fullscreen_threshold prefs. r=dougt

This commit is contained in:
Chris Peterson 2012-03-07 17:17:00 -08:00
Родитель 9bc4dce93b
Коммит cfc4569fe5
4 изменённых файлов: 11 добавлений и 41 удалений

Просмотреть файл

@ -611,12 +611,6 @@ pref("dom.indexedDB.warningQuota", 5);
pref("media.preload.default", 1); // default to preload none
pref("media.preload.auto", 2); // preload metadata if preload=auto
// 0: don't show fullscreen keyboard
// 1: always show fullscreen keyboard
// -1: show fullscreen keyboard based on threshold pref
pref("widget.ime.android.landscape_fullscreen", 1);
pref("widget.ime.android.fullscreen_threshold", 250); // in hundreths of inches
// optimize images memory usage
pref("image.mem.decodeondraw", true);
pref("content.image.allow_locking", false);

Просмотреть файл

@ -469,10 +469,9 @@ public class GeckoAppShell
mInputConnection.notifyIME(type, state);
}
public static void notifyIMEEnabled(int state, String typeHint,
String actionHint, boolean landscapeFS) {
public static void notifyIMEEnabled(int state, String typeHint, String actionHint) {
if (mInputConnection != null)
mInputConnection.notifyIMEEnabled(state, typeHint, actionHint, landscapeFS);
mInputConnection.notifyIMEEnabled(state, typeHint, actionHint);
}
public static void notifyIMEChange(String text, int start, int end, int newEnd) {

Просмотреть файл

@ -40,6 +40,7 @@ package org.mozilla.gecko;
import android.R;
import android.content.Context;
import android.os.Build.VERSION;
import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
@ -95,7 +96,6 @@ public class GeckoInputConnection
private static int mIMEState;
private static String mIMETypeHint;
private static String mIMEActionHint;
private static boolean mIMELandscapeFS;
// Is a composition active?
private boolean mComposing;
@ -694,8 +694,10 @@ public class GeckoInputConnection
else if (mIMEActionHint != null && mIMEActionHint.length() != 0)
outAttrs.actionLabel = mIMEActionHint;
if (mIMELandscapeFS == false)
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
if (VERSION.SDK_INT >= 11) { // Honeycomb
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_FULLSCREEN;
}
reset();
return this;
@ -872,8 +874,7 @@ public class GeckoInputConnection
}
}
public void notifyIMEEnabled(int state, String typeHint,
String actionHint, boolean landscapeFS) {
public void notifyIMEEnabled(int state, String typeHint, String actionHint) {
View v = GeckoApp.mAppContext.getLayerController().getView();
if (v == null)
@ -884,7 +885,6 @@ public class GeckoInputConnection
mIMEState = state;
mIMETypeHint = typeHint;
mIMEActionHint = actionHint;
mIMELandscapeFS = landscapeFS;
IMEStateUpdater.enableIME();
}

Просмотреть файл

@ -63,9 +63,6 @@
#define ALOG_BRIDGE(args...)
#endif
#define IME_FULLSCREEN_PREF "widget.ime.android.landscape_fullscreen"
#define IME_FULLSCREEN_THRESHOLD_PREF "widget.ime.android.fullscreen_threshold"
using namespace mozilla;
AndroidBridge *AndroidBridge::sBridge = 0;
@ -106,7 +103,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
mGeckoAppShellClass = (jclass) jEnv->NewGlobalRef(jGeckoAppShellClass);
jNotifyIME = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIME", "(II)V");
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Z)V");
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;)V");
jNotifyIMEChange = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEChange", "(Ljava/lang/String;III)V");
jNotifyScreenShot = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyScreenShot", "(Ljava/nio/ByteBuffer;III)V");
jAcknowledgeEventSync = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "acknowledgeEventSync", "()V");
@ -241,34 +238,14 @@ AndroidBridge::NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
nsPromiseFlatString typeHint(aTypeHint);
nsPromiseFlatString actionHint(aActionHint);
jvalue args[4];
jvalue args[3];
AutoLocalJNIFrame jniFrame(env, 1);
args[0].i = aState;
args[1].l = env->NewString(typeHint.get(), typeHint.Length());
args[2].l = env->NewString(actionHint.get(), actionHint.Length());
args[3].z = false;
PRInt32 landscapeFS;
if (NS_SUCCEEDED(Preferences::GetInt(IME_FULLSCREEN_PREF, &landscapeFS))) {
if (landscapeFS == 1) {
args[3].z = true;
} else if (landscapeFS == -1){
if (NS_SUCCEEDED(
Preferences::GetInt(IME_FULLSCREEN_THRESHOLD_PREF,
&landscapeFS))) {
// the threshold is hundreths of inches, so convert the
// threshold to pixels and multiply the height by 100
if (nsWindow::GetAndroidScreenBounds().height * 100 <
landscapeFS * Bridge()->GetDPI()) {
args[3].z = true;
}
}
}
}
env->CallStaticVoidMethodA(sBridge->mGeckoAppShellClass,
sBridge->jNotifyIMEEnabled, args);
sBridge->jNotifyIMEEnabled, args);
}
void