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

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

Issue 183923030: Almost finish moving context_menu_node_ from RenderViewImpl to RenderFrameImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 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
Index: content/browser/renderer_host/ime_adapter_android.h
===================================================================
--- content/browser/renderer_host/ime_adapter_android.h (revision 255633)
+++ content/browser/renderer_host/ime_adapter_android.h (working copy)
@@ -8,9 +8,12 @@
#include <jni.h>
#include "base/android/jni_helper.h"
+#include "base/memory/ref_counted.h"
+#include "base/strings/string16.h"
namespace content {
+class RenderFrameHost;
class RenderWidgetHostImpl;
class RenderWidgetHostViewAndroid;
struct NativeWebKeyboardEvent;
@@ -20,14 +23,15 @@
// corresponding host view.
// Ownership of these objects remains on the native side (see
// RenderWidgetHostViewAndroid).
-class ImeAdapterAndroid {
+class ImeAdapterAndroid : public base::RefCountedThreadSafe<ImeAdapterAndroid> {
public:
explicit ImeAdapterAndroid(RenderWidgetHostViewAndroid* rwhva);
- ~ImeAdapterAndroid();
// Called from java -> native
// The java side is responsible to translate android KeyEvent various enums
// and values into the corresponding blink::WebInputEvent.
+ // Since these methods are not called on the UI thread, they must be proxied
+ // to the UI thread.
bool SendKeyEvent(JNIEnv* env, jobject,
jobject original_key_event,
int action, int meta_state,
@@ -57,9 +61,30 @@
// Called from native -> java
void CancelComposition();
void FocusedNodeChanged(bool is_editable_node);
+ void RenderWidgetGone();
private:
+ friend class base::RefCountedThreadSafe<ImeAdapterAndroid>;
+ ~ImeAdapterAndroid();
+
+ void SendSyntheticKeyEventOnUI(const NativeWebKeyboardEvent& event);
+ void SendKeyEventOnUI(const NativeWebKeyboardEvent& event,
+ const NativeWebKeyboardEvent& char_event,
+ bool key_down_text_insertion);
+ void SetComposingTextOnUI(const base::string16& text16, int new_cursor_pos);
+ void CommitTextOnUI(const base::string16& text16);
+ void FinishComposingTextsOnUI();
+ void SetEditableSelectionOffsetsOnUI(int start, int end);
+ void SetComposingRegiontOnUI(int start, int end);
+ void DeleteSurroundingTextOnUI(int before, int after);
+ void UnselectOnUI();
+ void SelectAllOnUI();
+ void CutOnUI();
+ void CopyOnUI();
+ void PasteOnUI();
+
RenderWidgetHostImpl* GetRenderWidgetHostImpl();
+ RenderFrameHost* GetFocusedFrame();
RenderWidgetHostViewAndroid* rwhva_;
JavaObjectWeakGlobalRef java_ime_adapter_;

Powered by Google App Engine
This is Rietveld 408576698