зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 155c1005c388 (bug 1396951)
MozReview-Commit-ID: Egbc73sWnEB
This commit is contained in:
Родитель
7bd9fdc344
Коммит
8ac65ca47e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -824,9 +824,5 @@ public class LayerView extends FrameLayout {
|
|||
if (isCompositorReady()) {
|
||||
mCompositor.setDefaultClearColor(mDefaultClearColor);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isIMEEnabled() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче