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

Side by Side Diff: content/browser/renderer_host/ime_adapter_android.h

Issue 643193003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (C++ version) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send ImeCompositionRangeChanged only when necessary Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h"
12 #include "ui/gfx/geometry/rect.h"
11 13
12 namespace content { 14 namespace content {
13 15
14 class RenderFrameHost; 16 class RenderFrameHost;
15 class RenderWidgetHostImpl; 17 class RenderWidgetHostImpl;
16 class RenderWidgetHostViewAndroid; 18 class RenderWidgetHostViewAndroid;
17 class WebContents; 19 class WebContents;
18 struct NativeWebKeyboardEvent; 20 struct NativeWebKeyboardEvent;
19 21
20 // This class is in charge of dispatching key events from the java side 22 // This class is in charge of dispatching key events from the java side
(...skipping 26 matching lines...) Expand all
47 jobject obj, 49 jobject obj,
48 jobject text, 50 jobject text,
49 jstring text_str, 51 jstring text_str,
50 int new_cursor_pos); 52 int new_cursor_pos);
51 void CommitText(JNIEnv*, jobject, jstring text_str); 53 void CommitText(JNIEnv*, jobject, jstring text_str);
52 void FinishComposingText(JNIEnv* env, jobject); 54 void FinishComposingText(JNIEnv* env, jobject);
53 void AttachImeAdapter(JNIEnv*, jobject java_object); 55 void AttachImeAdapter(JNIEnv*, jobject java_object);
54 void SetEditableSelectionOffsets(JNIEnv*, jobject, int start, int end); 56 void SetEditableSelectionOffsets(JNIEnv*, jobject, int start, int end);
55 void SetComposingRegion(JNIEnv*, jobject, int start, int end); 57 void SetComposingRegion(JNIEnv*, jobject, int start, int end);
56 void DeleteSurroundingText(JNIEnv*, jobject, int before, int after); 58 void DeleteSurroundingText(JNIEnv*, jobject, int before, int after);
59 bool RequestCursorUpdates(JNIEnv* env,
60 jobject obj,
61 int cursor_update_mode);
57 void Unselect(JNIEnv*, jobject); 62 void Unselect(JNIEnv*, jobject);
58 void SelectAll(JNIEnv*, jobject); 63 void SelectAll(JNIEnv*, jobject);
59 void Cut(JNIEnv*, jobject); 64 void Cut(JNIEnv*, jobject);
60 void Copy(JNIEnv*, jobject); 65 void Copy(JNIEnv*, jobject);
61 void Paste(JNIEnv*, jobject); 66 void Paste(JNIEnv*, jobject);
62 void ResetImeAdapter(JNIEnv*, jobject); 67 void ResetImeAdapter(JNIEnv*, jobject);
63 68
64 // Called from native -> java 69 // Called from native -> java
65 void CancelComposition(); 70 void CancelComposition();
66 void FocusedNodeChanged(bool is_editable_node); 71 void FocusedNodeChanged(bool is_editable_node);
72 void UpdateCursorAnchorInfo(
73 const base::android::ScopedJavaLocalRef<jobject>& cursor_anchor_info);
67 74
68 private: 75 private:
69 RenderWidgetHostImpl* GetRenderWidgetHostImpl(); 76 RenderWidgetHostImpl* GetRenderWidgetHostImpl();
70 RenderFrameHost* GetFocusedFrame(); 77 RenderFrameHost* GetFocusedFrame();
71 WebContents* GetWebContents(); 78 WebContents* GetWebContents();
72 79
73 RenderWidgetHostViewAndroid* rwhva_; 80 RenderWidgetHostViewAndroid* rwhva_;
74 JavaObjectWeakGlobalRef java_ime_adapter_; 81 JavaObjectWeakGlobalRef java_ime_adapter_;
75 }; 82 };
76 83
77 bool RegisterImeAdapter(JNIEnv* env); 84 bool RegisterImeAdapter(JNIEnv* env);
78 85
79 } // namespace content 86 } // namespace content
80 87
81 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ 88 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/ime_adapter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698