Backed out changeset 155c1005c388 (bug 1396951)

MozReview-Commit-ID: Egbc73sWnEB
This commit is contained in:
Sebastian Hengst 2017-09-22 11:48:36 +02:00
Родитель 7bd9fdc344
Коммит 8ac65ca47e
4 изменённых файлов: 18 добавлений и 15 удалений

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

@ -1584,6 +1584,21 @@ public class GeckoAppShell
return HardwareUtils.isTablet();
}
private static boolean sImeWasEnabledOnLastResize = false;
public static void viewSizeChanged() {
GeckoView v = (GeckoView) getLayerView();
if (v == null) {
return;
}
boolean imeIsEnabled = v.isIMEEnabled();
if (imeIsEnabled && !sImeWasEnabledOnLastResize) {
// The IME just came up after not being up, so let's scroll
// to the focused input.
EventDispatcher.getInstance().dispatch("ScrollTo:FocusedInput", null);
}
sImeWasEnabledOnLastResize = imeIsEnabled;
}
@WrapForJNI(calledFrom = "gecko")
private static double[] getCurrentNetworkInformation() {
return GeckoNetworkManager.getInstance().getCurrentInformation();

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

@ -751,8 +751,7 @@ public class GeckoView extends LayerView {
mInputConnectionListener.onKeyMultiple(keyCode, repeatCount, event);
}
@Override
public boolean isIMEEnabled() {
/* package */ boolean isIMEEnabled() {
return mInputConnectionListener != null &&
mInputConnectionListener.isIMEEnabled();
}

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

@ -33,7 +33,6 @@ class GeckoLayerClient implements LayerView.Listener
private IntSize mWindowSize;
private boolean mForceRedraw;
private boolean mImeWasEnabledOnLastResize;
/* The current viewport metrics.
* This is volatile so that we can read and write to it from different threads.
@ -154,13 +153,7 @@ class GeckoLayerClient implements LayerView.Listener
// the following call also sends gecko a message, which will be processed after the resize
// message above has updated the viewport. this message ensures that if we have just put
// focus in a text field, we scroll the content so that the text field is in view.
final boolean imeIsEnabled = mView.isIMEEnabled();
if (imeIsEnabled && !mImeWasEnabledOnLastResize) {
// The IME just came up after not being up, so let's scroll
// to the focused input.
EventDispatcher.getInstance().dispatch("ScrollTo:FocusedInput", null);
}
mImeWasEnabledOnLastResize = imeIsEnabled;
GeckoAppShell.viewSizeChanged();
}
return true;
}

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

@ -825,8 +825,4 @@ public class LayerView extends FrameLayout {
mCompositor.setDefaultClearColor(mDefaultClearColor);
}
}
public boolean isIMEEnabled() {
return false;
}
}