Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: content/browser/android/ime_adapter_android.h

Issue 2792063003: Factor out RenderWidgetHostConnector (Closed)
Patch Set: base::ObserverList Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/android/ime_adapter_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/ime_adapter_android.h
diff --git a/content/browser/android/ime_adapter_android.h b/content/browser/android/ime_adapter_android.h
index e2860e1203b7f1fb73cb317200af17681443cecc..46cf13a8e6cd1aabbbd306a5908333a88a0590aa 100644
--- a/content/browser/android/ime_adapter_android.h
+++ b/content/browser/android/ime_adapter_android.h
@@ -10,9 +10,8 @@
#include <vector>
#include "base/android/jni_weak_ref.h"
-#include "base/memory/weak_ptr.h"
+#include "content/browser/android/render_widget_host_connector.h"
#include "content/common/content_export.h"
-#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
@@ -31,9 +30,7 @@ struct TextInputState;
// This class is in charge of dispatching key events from the java side
// and forward to renderer along with input method results via
// corresponding host view.
-// Ownership of these objects remains on the native side (see
-// RenderWidgetHostViewAndroid).
-class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver {
+class CONTENT_EXPORT ImeAdapterAndroid : public RenderWidgetHostConnector {
public:
ImeAdapterAndroid(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
@@ -88,6 +85,11 @@ class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver {
bool RequestTextInputStateUpdate(JNIEnv*,
const base::android::JavaParamRef<jobject>&);
+ // RendetWidgetHostConnector implementation.
+ void UpdateRenderProcessConnection(
+ RenderWidgetHostViewAndroid* old_rwhva,
+ RenderWidgetHostViewAndroid* new_rhwva) override;
+
// Called from native -> java
void CancelComposition();
void FocusedNodeChanged(bool is_editable_node);
@@ -98,14 +100,6 @@ class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver {
return java_ime_adapter_.get(env);
}
- // WebContentsObserver implementation.
- void RenderViewReady() override;
- void RenderViewHostChanged(RenderViewHost* old_host,
- RenderViewHost* new_host) override;
- void DidAttachInterstitialPage() override;
- void DidDetachInterstitialPage() override;
- void WebContentsDestroyed() override;
-
void UpdateState(const TextInputState& state);
private:
@@ -116,10 +110,9 @@ class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver {
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& text,
const base::string16& text16);
- RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const;
- void UpdateRenderProcessConnection(RenderWidgetHostViewAndroid* new_rwhva);
- base::WeakPtr<RenderWidgetHostViewAndroid> rwhva_;
+ // Current RenderWidgetHostView connected to this instance. Can be null.
+ RenderWidgetHostViewAndroid* rwhva_;
JavaObjectWeakGlobalRef java_ime_adapter_;
};
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/android/ime_adapter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698