зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1416918 - 4. Remove unused code; r=esawin
Remove InputConnectionListener, which was replaced by TextInputController.Delegate, and remove IME_STATE_PLUGIN, which is not used anymore. MozReview-Commit-ID: GCbJXWNCmTk --HG-- extra : rebase_source : c90bc79585ce4c5b9c0de5e07b0ea52531b65e04
This commit is contained in:
Родитель
96ffac273d
Коммит
9db87f4a1c
|
@ -408,7 +408,6 @@ gvjar.sources += [geckoview_source_dir + 'java/org/mozilla/gecko/' + x
|
|||
'gfx/SurfaceTextureListener.java',
|
||||
'gfx/VsyncSource.java',
|
||||
'HapticFeedbackDelegate.java',
|
||||
'InputConnectionListener.java',
|
||||
'InputMethods.java',
|
||||
'media/AsyncCodec.java',
|
||||
'media/AsyncCodecFactory.java',
|
||||
|
|
|
@ -34,7 +34,6 @@ interface GeckoEditableListener {
|
|||
int IME_STATE_DISABLED = 0;
|
||||
int IME_STATE_ENABLED = 1;
|
||||
int IME_STATE_PASSWORD = 2;
|
||||
int IME_STATE_PLUGIN = 3;
|
||||
|
||||
void notifyIME(int type);
|
||||
void notifyIMEContext(int state, String typeHint, String modeHint, String actionHint, boolean inPrivateBrowsing, boolean isUserAction);
|
||||
|
|
|
@ -552,8 +552,6 @@ import android.view.inputmethod.InputMethodManager;
|
|||
if (mIMEState == IME_STATE_PASSWORD ||
|
||||
"password".equalsIgnoreCase(mIMETypeHint))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
|
||||
else if (mIMEState == IME_STATE_PLUGIN)
|
||||
outAttrs.inputType = InputType.TYPE_NULL; // "send key events" mode
|
||||
else if (mIMETypeHint.equalsIgnoreCase("url") ||
|
||||
mIMETypeHint.equalsIgnoreCase("mozAwesomebar"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_URI;
|
||||
|
@ -639,12 +637,6 @@ import android.view.inputmethod.InputMethodManager;
|
|||
Log.d(LOGTAG, "IME: CurrentInputMethod=" + mCurrentInputMethod);
|
||||
}
|
||||
|
||||
if (mIMEState == IME_STATE_PLUGIN) {
|
||||
// Since we are using a temporary string as the editable, the selection is at 0
|
||||
outAttrs.initialSelStart = 0;
|
||||
outAttrs.initialSelEnd = 0;
|
||||
return mKeyInputConnection;
|
||||
}
|
||||
Editable editable = getEditable();
|
||||
outAttrs.initialSelStart = Selection.getSelectionStart(editable);
|
||||
outAttrs.initialSelEnd = Selection.getSelectionEnd(editable);
|
||||
|
@ -770,8 +762,7 @@ import android.view.inputmethod.InputMethodManager;
|
|||
}
|
||||
|
||||
private boolean shouldSkipKeyListener(int keyCode, KeyEvent event) {
|
||||
if (mIMEState == IME_STATE_DISABLED ||
|
||||
mIMEState == IME_STATE_PLUGIN) {
|
||||
if (mIMEState == IME_STATE_DISABLED) {
|
||||
return true;
|
||||
}
|
||||
// Preserve enter and tab keys for the browser
|
||||
|
@ -921,7 +912,7 @@ import android.view.inputmethod.InputMethodManager;
|
|||
|
||||
@Override // TextInputController.Delegate
|
||||
public synchronized boolean isInputActive() {
|
||||
// make sure this picks up PASSWORD and PLUGIN states as well
|
||||
// Make sure this picks up PASSWORD state as well.
|
||||
return mIMEState != IME_STATE_DISABLED;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
|
||||
/**
|
||||
* Interface for interacting with GeckoInputConnection from GeckoView.
|
||||
*/
|
||||
interface InputConnectionListener
|
||||
{
|
||||
Handler getHandler(Handler defHandler);
|
||||
InputConnection onCreateInputConnection(EditorInfo outAttrs);
|
||||
boolean onKeyPreIme(int keyCode, KeyEvent event);
|
||||
boolean onKeyDown(int keyCode, KeyEvent event);
|
||||
boolean onKeyLongPress(int keyCode, KeyEvent event);
|
||||
boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event);
|
||||
boolean onKeyUp(int keyCode, KeyEvent event);
|
||||
boolean isIMEEnabled();
|
||||
}
|
|
@ -1339,10 +1339,6 @@ GeckoEditableSupport::WillDispatchKeyboardEvent(
|
|||
NS_IMETHODIMP_(IMENotificationRequests)
|
||||
GeckoEditableSupport::GetIMENotificationRequests()
|
||||
{
|
||||
// While a plugin has focus, Listener doesn't need any notifications.
|
||||
if (GetInputContext().mIMEState.mEnabled == IMEState::PLUGIN) {
|
||||
return IMENotificationRequests();
|
||||
}
|
||||
return IMENotificationRequests(IMENotificationRequests::NOTIFY_TEXT_CHANGE);
|
||||
}
|
||||
|
||||
|
@ -1358,7 +1354,7 @@ GeckoEditableSupport::SetInputContext(const InputContext& aContext,
|
|||
|
||||
mInputContext = aContext;
|
||||
|
||||
if (mInputContext.mIMEState.mEnabled == IMEState::ENABLED &&
|
||||
if (mInputContext.mIMEState.mEnabled != IMEState::DISABLED &&
|
||||
aAction.UserMightRequestOpenVKB()) {
|
||||
// Don't reset keyboard when we should simply open the vkb
|
||||
mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_OPEN_VKB);
|
||||
|
|
Загрузка…
Ссылка в новой задаче