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

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

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Remove logging statements, fix copyright years in new files Created 3 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 <vector> 10 #include <vector>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "ui/gfx/geometry/rect_f.h" 14 #include "ui/gfx/geometry/rect_f.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 struct WebCompositionUnderline; 18 struct WebCompositionUnderline;
19 struct WebTextSuggestionInfo;
19 20
20 } // namespace blink 21 } // namespace blink
21 22
22 namespace content { 23 namespace content {
23 24
24 class RenderFrameHost; 25 class RenderFrameHost;
25 class RenderWidgetHostImpl; 26 class RenderWidgetHostImpl;
26 class RenderWidgetHostViewAndroid; 27 class RenderWidgetHostViewAndroid;
27 class WebContents; 28 class WebContents;
28 29
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 int end); 74 int end);
74 void DeleteSurroundingText(JNIEnv*, 75 void DeleteSurroundingText(JNIEnv*,
75 const base::android::JavaParamRef<jobject>&, 76 const base::android::JavaParamRef<jobject>&,
76 int before, 77 int before,
77 int after); 78 int after);
78 void ResetImeAdapter(JNIEnv*, const base::android::JavaParamRef<jobject>&); 79 void ResetImeAdapter(JNIEnv*, const base::android::JavaParamRef<jobject>&);
79 void RequestCursorUpdate(JNIEnv*, const base::android::JavaParamRef<jobject>&, 80 void RequestCursorUpdate(JNIEnv*, const base::android::JavaParamRef<jobject>&,
80 bool immediateRequest, bool monitorRequest); 81 bool immediateRequest, bool monitorRequest);
81 bool RequestTextInputStateUpdate(JNIEnv*, 82 bool RequestTextInputStateUpdate(JNIEnv*,
82 const base::android::JavaParamRef<jobject>&); 83 const base::android::JavaParamRef<jobject>&);
84 void ApplySuggestionReplacement(JNIEnv*,
85 const base::android::JavaParamRef<jobject>&,
86 int documentMarkerID,
87 int suggestionIndex);
88 void DeleteSuggestionHighlight(JNIEnv*,
89 const base::android::JavaParamRef<jobject>&);
90 void SuggestionMenuClosed(JNIEnv*,
91 const base::android::JavaParamRef<jobject>&);
83 92
84 // Called from native -> java 93 // Called from native -> java
85 void CancelComposition(); 94 void CancelComposition();
86 void FocusedNodeChanged(bool is_editable_node); 95 void FocusedNodeChanged(bool is_editable_node);
87 void SetCharacterBounds(const std::vector<gfx::RectF>& rects); 96 void SetCharacterBounds(const std::vector<gfx::RectF>& rects);
97 void ShowTextSuggestionMenu(
98 const std::vector<blink::WebTextSuggestionInfo>& suggestion_infos);
88 99
89 private: 100 private:
90 RenderWidgetHostImpl* GetRenderWidgetHostImpl(); 101 RenderWidgetHostImpl* GetRenderWidgetHostImpl();
91 RenderFrameHost* GetFocusedFrame(); 102 RenderFrameHost* GetFocusedFrame();
92 WebContents* GetWebContents(); 103 WebContents* GetWebContents();
93 std::vector<blink::WebCompositionUnderline> GetUnderlinesFromSpans( 104 std::vector<blink::WebCompositionUnderline> GetUnderlinesFromSpans(
94 JNIEnv* env, 105 JNIEnv* env,
95 const base::android::JavaParamRef<jobject>& obj, 106 const base::android::JavaParamRef<jobject>& obj,
96 const base::android::JavaParamRef<jobject>& text, 107 const base::android::JavaParamRef<jobject>& text,
97 const base::string16& text16); 108 const base::string16& text16);
98 109
99 RenderWidgetHostViewAndroid* rwhva_; 110 RenderWidgetHostViewAndroid* rwhva_;
100 JavaObjectWeakGlobalRef java_ime_adapter_; 111 JavaObjectWeakGlobalRef java_ime_adapter_;
101 }; 112 };
102 113
103 bool RegisterImeAdapter(JNIEnv* env); 114 bool RegisterImeAdapter(JNIEnv* env);
104 115
105 } // namespace content 116 } // namespace content
106 117
107 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_ 118 #endif // CONTENT_BROWSER_RENDERER_HOST_IME_ADAPTER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698