Skip to content

Commit

Permalink
Remove deprecated ReplicaInputConnection
Browse files Browse the repository at this point in the history
Since ImeThread and its ThreadedInputConnection implementation are rolled
out to stable, there is no need to keep ReplicaInputConnection and related
logics in renderer.

Note that this just removes dead code and is purely mechanical.
Polish up around ChangeSource will be handled in a separate CL.

BUG=662279

Review-Url: https://codereview.chromium.org/2553923002
Cr-Commit-Position: refs/heads/master@{#437422}
  • Loading branch information
galmacky authored and Commit bot committed Dec 9, 2016
1 parent 28c67cc commit 38c3eb6
Show file tree
Hide file tree
Showing 26 changed files with 12 additions and 1,059 deletions.
2 changes: 0 additions & 2 deletions build/android/lint/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ Still reading?
</issue>
<issue id="Overdraw" severity="ignore"/>
<issue id="Override">
<!-- TODO(crbug.com/635567): Fix this properly. -->
<ignore regexp="org/chromium/content/browser/input/ReplicaInputConnection.class"/>
<!-- TODO(crbug.com/635567): Fix this properly. -->
<ignore regexp="org/chromium/content/browser/input/ThreadedInputConnection.class"/>
<!-- TODO(crbug.com/635567): Fix this properly. -->
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1881,10 +1881,6 @@ const FeatureEntry kFeatureEntries[] = {
IDS_FLAGS_WEBRTC_H264_WITH_OPENH264_FFMPEG_DESCRIPTION, kOsDesktop,
FEATURE_VALUE_TYPE(content::kWebRtcH264WithOpenH264FFmpeg)},
#endif // ENABLE_WEBRTC && BUILDFLAG(RTC_USE_H264) && !MEDIA_DISABLE_FFMPEG
#if defined(OS_ANDROID)
{"ime-thread", IDS_FLAGS_IME_THREAD_NAME, IDS_FLAGS_IME_THREAD_DESCRIPTION,
kOsAndroid, FEATURE_VALUE_TYPE(features::kImeThread)},
#endif // OS_ANDROID
#if defined(OS_ANDROID)
{"offline-pages-ntp", IDS_FLAGS_NTP_OFFLINE_PAGES_NAME,
IDS_FLAGS_NTP_OFFLINE_PAGES_DESCRIPTION, kOsAndroid,
Expand Down
8 changes: 0 additions & 8 deletions content/browser/renderer_host/ime_adapter_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/feature_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "content/browser/frame_host/frame_tree.h"
Expand All @@ -27,7 +26,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "jni/ImeAdapter_jni.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/platform/WebTextInputType.h"
Expand Down Expand Up @@ -310,12 +308,6 @@ void ImeAdapterAndroid::RequestCursorUpdate(
rwhi->GetRoutingID(), immediate_request, monitor_request));
}

bool ImeAdapterAndroid::IsImeThreadEnabled(
JNIEnv* env,
const base::android::JavaParamRef<jobject>&) {
return base::FeatureList::IsEnabled(features::kImeThread);
}

void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env,
const JavaParamRef<jobject>&) {
java_ime_adapter_.reset();
Expand Down
1 change: 0 additions & 1 deletion content/browser/renderer_host/ime_adapter_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class ImeAdapterAndroid {
bool immediateRequest, bool monitorRequest);
bool RequestTextInputStateUpdate(JNIEnv*,
const base::android::JavaParamRef<jobject>&);
bool IsImeThreadEnabled(JNIEnv*, const base::android::JavaParamRef<jobject>&);

// Called from native -> java
void CancelComposition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,6 @@ void RenderWidgetHostViewAndroid::OnUpdateTextInputStateCalled(
GetTextInputManager()->GetActiveWidget()
? *GetTextInputManager()->GetTextInputState()
: TextInputState();
if (state.is_non_ime_change && updated_view->GetRenderWidgetHost()) {
// Sends an acknowledgement to the renderer of a processed IME event.
updated_view->GetRenderWidgetHost()->Send(
new InputMsg_ImeEventAck(host_->GetRoutingID()));
}

if (!content_view_core_)
return;
Expand Down
5 changes: 0 additions & 5 deletions content/common/input_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ IPC_MESSAGE_ROUTED1(InputMsg_MoveCaret,
gfx::Point /* location */)

#if defined(OS_ANDROID)
// Sent by the browser as ACK to ViewHostMsg_TextInputState when necessary.
// NOTE: ImeEventAck and other Ime* messages should be of the same type,
// otherwise a race condition can happen.
IPC_MESSAGE_ROUTED0(InputMsg_ImeEventAck)

// Request from browser to update text input state.
IPC_MESSAGE_ROUTED0(InputMsg_RequestTextInputStateUpdate)
#endif
Expand Down
2 changes: 0 additions & 2 deletions content/public/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ android_library("content_java") {
"java/src/org/chromium/content/browser/input/LGEmailActionModeWorkaround.java",
"java/src/org/chromium/content/browser/input/PastePopupMenu.java",
"java/src/org/chromium/content/browser/input/Range.java",
"java/src/org/chromium/content/browser/input/ReplicaInputConnection.java",
"java/src/org/chromium/content/browser/input/SelectPopup.java",
"java/src/org/chromium/content/browser/input/SelectPopupAdapter.java",
"java/src/org/chromium/content/browser/input/SelectPopupDialog.java",
Expand Down Expand Up @@ -426,7 +425,6 @@ android_library("content_javatests") {
"javatests/src/org/chromium/content/browser/input/ImeTest.java",
"javatests/src/org/chromium/content/browser/input/ImeTestUtils.java",
"javatests/src/org/chromium/content/browser/input/InputDialogContainerTest.java",
"javatests/src/org/chromium/content/browser/input/ReplicaInputConnectionTest.java",
"javatests/src/org/chromium/content/browser/input/SelectPopupTest.java",
"javatests/src/org/chromium/content/browser/input/TestImeAdapterDelegate.java",
"javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,9 @@ public int getComposingTextEnd() {
}
}

private boolean isImeThreadEnabled() {
if (mNativeImeAdapterAndroid == 0) return false;
return nativeIsImeThreadEnabled(mNativeImeAdapterAndroid);
}

private void createInputConnectionFactory() {
if (mInputConnectionFactory != null) return;
if (isImeThreadEnabled()) {
Log.i(TAG, "ImeThread is enabled.");
mInputConnectionFactory =
new ThreadedInputConnectionFactory(mInputMethodManagerWrapper);
} else {
Log.i(TAG, "ImeThread is not enabled.");
mInputConnectionFactory = new ReplicaInputConnection.Factory();
}
mInputConnectionFactory = new ThreadedInputConnectionFactory(mInputMethodManagerWrapper);
}

/**
Expand Down Expand Up @@ -801,5 +789,4 @@ private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid,
private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapterAndroid);
private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid,
boolean immediateRequest, boolean monitorRequest);
private native boolean nativeIsImeThreadEnabled(long nativeImeAdapterAndroid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,4 @@ void recordProxyViewDetectionFailure() {
RecordHistogram.recordEnumeratedHistogram(
UMA_REGISTER_PROXYVIEW, UMA_PROXYVIEW_DETECTION_FAILURE, UMA_PROXYVIEW_COUNT);
}

void recordProxyViewReplicaInputConnection() {
RecordHistogram.recordEnumeratedHistogram(UMA_REGISTER_PROXYVIEW,
UMA_PROXYVIEW_REPLICA_INPUT_CONNECTION, UMA_PROXYVIEW_COUNT);
}
}
Loading

0 comments on commit 38c3eb6

Please sign in to comment.