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

Side by Side Diff: content/browser/android/content_view_core_impl.h

Issue 1489453003: jni: Pass method parameters as JavaParamRef in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void RequestTextSurroundingSelection( 64 void RequestTextSurroundingSelection(
65 int max_length, 65 int max_length,
66 const base::Callback<void(const base::string16& content, 66 const base::Callback<void(const base::string16& content,
67 int start_offset, 67 int start_offset,
68 int end_offset)>& callback) override; 68 int end_offset)>& callback) override;
69 69
70 // -------------------------------------------------------------------------- 70 // --------------------------------------------------------------------------
71 // Methods called from Java via JNI 71 // Methods called from Java via JNI
72 // -------------------------------------------------------------------------- 72 // --------------------------------------------------------------------------
73 73
74 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, 74 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(
75 jobject obj); 75 JNIEnv* env,
76 base::android::ScopedJavaLocalRef<jobject> GetJavaWindowAndroid(JNIEnv* env, 76 const base::android::JavaParamRef<jobject>& obj);
77 jobject obj); 77 base::android::ScopedJavaLocalRef<jobject> GetJavaWindowAndroid(
78 JNIEnv* env,
79 const base::android::JavaParamRef<jobject>& obj);
78 80
79 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); 81 void OnJavaContentViewCoreDestroyed(
82 JNIEnv* env,
83 const base::android::JavaParamRef<jobject>& obj);
80 84
81 // Notifies the ContentViewCore that items were selected in the currently 85 // Notifies the ContentViewCore that items were selected in the currently
82 // showing select popup. 86 // showing select popup.
83 void SelectPopupMenuItems(JNIEnv* env, jobject obj, 87 void SelectPopupMenuItems(
84 jlong selectPopupSourceFrame, 88 JNIEnv* env,
85 jintArray indices); 89 const base::android::JavaParamRef<jobject>& obj,
90 jlong selectPopupSourceFrame,
91 const base::android::JavaParamRef<jintArray>& indices);
86 92
87 void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation); 93 void SendOrientationChangeEvent(
88 jboolean OnTouchEvent(JNIEnv* env, 94 JNIEnv* env,
89 jobject obj, 95 const base::android::JavaParamRef<jobject>& obj,
90 jobject motion_event, 96 jint orientation);
91 jlong time_ms, 97 jboolean OnTouchEvent(
92 jint android_action, 98 JNIEnv* env,
93 jint pointer_count, 99 const base::android::JavaParamRef<jobject>& obj,
94 jint history_size, 100 const base::android::JavaParamRef<jobject>& motion_event,
95 jint action_index, 101 jlong time_ms,
96 jfloat pos_x_0, 102 jint android_action,
97 jfloat pos_y_0, 103 jint pointer_count,
98 jfloat pos_x_1, 104 jint history_size,
99 jfloat pos_y_1, 105 jint action_index,
100 jint pointer_id_0, 106 jfloat pos_x_0,
101 jint pointer_id_1, 107 jfloat pos_y_0,
102 jfloat touch_major_0, 108 jfloat pos_x_1,
103 jfloat touch_major_1, 109 jfloat pos_y_1,
104 jfloat touch_minor_0, 110 jint pointer_id_0,
105 jfloat touch_minor_1, 111 jint pointer_id_1,
106 jfloat orientation_0, 112 jfloat touch_major_0,
107 jfloat orientation_1, 113 jfloat touch_major_1,
108 jfloat tilt_0, 114 jfloat touch_minor_0,
109 jfloat tilt_1, 115 jfloat touch_minor_1,
110 jfloat raw_pos_x, 116 jfloat orientation_0,
111 jfloat raw_pos_y, 117 jfloat orientation_1,
112 jint android_tool_type_0, 118 jfloat tilt_0,
113 jint android_tool_type_1, 119 jfloat tilt_1,
114 jint android_button_state, 120 jfloat raw_pos_x,
115 jint android_meta_state, 121 jfloat raw_pos_y,
116 jboolean is_touch_handle_event); 122 jint android_tool_type_0,
123 jint android_tool_type_1,
124 jint android_button_state,
125 jint android_meta_state,
126 jboolean is_touch_handle_event);
117 jboolean SendMouseMoveEvent(JNIEnv* env, 127 jboolean SendMouseMoveEvent(JNIEnv* env,
118 jobject obj, 128 const base::android::JavaParamRef<jobject>& obj,
119 jlong time_ms, 129 jlong time_ms,
120 jfloat x, 130 jfloat x,
121 jfloat y); 131 jfloat y);
122 jboolean SendMouseWheelEvent(JNIEnv* env, 132 jboolean SendMouseWheelEvent(JNIEnv* env,
123 jobject obj, 133 const base::android::JavaParamRef<jobject>& obj,
124 jlong time_ms, 134 jlong time_ms,
125 jfloat x, 135 jfloat x,
126 jfloat y, 136 jfloat y,
127 jfloat ticks_x, 137 jfloat ticks_x,
128 jfloat ticks_y, 138 jfloat ticks_y,
129 jfloat pixels_per_tick); 139 jfloat pixels_per_tick);
130 void ScrollBegin(JNIEnv* env, 140 void ScrollBegin(JNIEnv* env,
131 jobject obj, 141 const base::android::JavaParamRef<jobject>& obj,
132 jlong time_ms, 142 jlong time_ms,
133 jfloat x, 143 jfloat x,
134 jfloat y, 144 jfloat y,
135 jfloat hintx, 145 jfloat hintx,
136 jfloat hinty, 146 jfloat hinty,
137 jboolean target_viewport); 147 jboolean target_viewport);
138 void ScrollEnd(JNIEnv* env, jobject obj, jlong time_ms); 148 void ScrollEnd(JNIEnv* env,
139 void ScrollBy(JNIEnv* env, jobject obj, jlong time_ms, 149 const base::android::JavaParamRef<jobject>& obj,
140 jfloat x, jfloat y, jfloat dx, jfloat dy); 150 jlong time_ms);
151 void ScrollBy(JNIEnv* env,
152 const base::android::JavaParamRef<jobject>& obj,
153 jlong time_ms,
154 jfloat x,
155 jfloat y,
156 jfloat dx,
157 jfloat dy);
141 void FlingStart(JNIEnv* env, 158 void FlingStart(JNIEnv* env,
142 jobject obj, 159 const base::android::JavaParamRef<jobject>& obj,
143 jlong time_ms, 160 jlong time_ms,
144 jfloat x, 161 jfloat x,
145 jfloat y, 162 jfloat y,
146 jfloat vx, 163 jfloat vx,
147 jfloat vy, 164 jfloat vy,
148 jboolean target_viewport); 165 jboolean target_viewport);
149 void FlingCancel(JNIEnv* env, jobject obj, jlong time_ms); 166 void FlingCancel(JNIEnv* env,
150 void SingleTap(JNIEnv* env, jobject obj, jlong time_ms, 167 const base::android::JavaParamRef<jobject>& obj,
151 jfloat x, jfloat y); 168 jlong time_ms);
152 void DoubleTap(JNIEnv* env, jobject obj, jlong time_ms, 169 void SingleTap(JNIEnv* env,
153 jfloat x, jfloat y); 170 const base::android::JavaParamRef<jobject>& obj,
154 void LongPress(JNIEnv* env, jobject obj, jlong time_ms, 171 jlong time_ms,
155 jfloat x, jfloat y); 172 jfloat x,
156 void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jfloat x, jfloat y); 173 jfloat y);
157 void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms); 174 void DoubleTap(JNIEnv* env,
158 void PinchBy(JNIEnv* env, jobject obj, jlong time_ms, 175 const base::android::JavaParamRef<jobject>& obj,
159 jfloat x, jfloat y, jfloat delta); 176 jlong time_ms,
160 void SelectBetweenCoordinates(JNIEnv* env, jobject obj, 177 jfloat x,
161 jfloat x1, jfloat y1, 178 jfloat y);
162 jfloat x2, jfloat y2); 179 void LongPress(JNIEnv* env,
163 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); 180 const base::android::JavaParamRef<jobject>& obj,
164 void DismissTextHandles(JNIEnv* env, jobject obj); 181 jlong time_ms,
165 void SetTextHandlesTemporarilyHidden(JNIEnv* env, 182 jfloat x,
166 jobject obj, 183 jfloat y);
167 jboolean hidden); 184 void PinchBegin(JNIEnv* env,
185 const base::android::JavaParamRef<jobject>& obj,
186 jlong time_ms,
187 jfloat x,
188 jfloat y);
189 void PinchEnd(JNIEnv* env,
190 const base::android::JavaParamRef<jobject>& obj,
191 jlong time_ms);
192 void PinchBy(JNIEnv* env,
193 const base::android::JavaParamRef<jobject>& obj,
194 jlong time_ms,
195 jfloat x,
196 jfloat y,
197 jfloat delta);
198 void SelectBetweenCoordinates(JNIEnv* env,
199 const base::android::JavaParamRef<jobject>& obj,
200 jfloat x1,
201 jfloat y1,
202 jfloat x2,
203 jfloat y2);
204 void MoveCaret(JNIEnv* env,
205 const base::android::JavaParamRef<jobject>& obj,
206 jfloat x,
207 jfloat y);
208 void DismissTextHandles(JNIEnv* env,
209 const base::android::JavaParamRef<jobject>& obj);
210 void SetTextHandlesTemporarilyHidden(
211 JNIEnv* env,
212 const base::android::JavaParamRef<jobject>& obj,
213 jboolean hidden);
168 214
169 void ResetGestureDetection(JNIEnv* env, jobject obj); 215 void ResetGestureDetection(JNIEnv* env,
170 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); 216 const base::android::JavaParamRef<jobject>& obj);
171 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, 217 void SetDoubleTapSupportEnabled(
172 jobject obj, 218 JNIEnv* env,
173 jboolean enabled); 219 const base::android::JavaParamRef<jobject>& obj,
220 jboolean enabled);
221 void SetMultiTouchZoomSupportEnabled(
222 JNIEnv* env,
223 const base::android::JavaParamRef<jobject>& obj,
224 jboolean enabled);
174 225
175 long GetNativeImeAdapter(JNIEnv* env, jobject obj); 226 long GetNativeImeAdapter(JNIEnv* env,
176 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); 227 const base::android::JavaParamRef<jobject>& obj);
228 void SetFocus(JNIEnv* env,
229 const base::android::JavaParamRef<jobject>& obj,
230 jboolean focused);
177 231
178 jint GetBackgroundColor(JNIEnv* env, jobject obj); 232 jint GetBackgroundColor(JNIEnv* env, jobject obj);
179 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); 233 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color);
180 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, 234 void SetAllowJavascriptInterfacesInspection(
181 jobject obj, 235 JNIEnv* env,
182 jboolean allow); 236 const base::android::JavaParamRef<jobject>& obj,
183 void AddJavascriptInterface(JNIEnv* env, 237 jboolean allow);
184 jobject obj, 238 void AddJavascriptInterface(
185 jobject object, 239 JNIEnv* env,
186 jstring name, 240 const base::android::JavaParamRef<jobject>& obj,
187 jclass safe_annotation_clazz); 241 const base::android::JavaParamRef<jobject>& object,
188 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); 242 const base::android::JavaParamRef<jstring>& name,
189 void WasResized(JNIEnv* env, jobject obj); 243 const base::android::JavaParamRef<jclass>& safe_annotation_clazz);
244 void RemoveJavascriptInterface(
245 JNIEnv* env,
246 const base::android::JavaParamRef<jobject>& obj,
247 const base::android::JavaParamRef<jstring>& name);
248 void WasResized(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
190 249
191 void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled); 250 void SetAccessibilityEnabled(JNIEnv* env,
251 const base::android::JavaParamRef<jobject>& obj,
252 bool enabled);
192 253
193 void SetTextTrackSettings(JNIEnv* env, 254 void SetTextTrackSettings(
194 jobject obj, 255 JNIEnv* env,
195 jboolean textTracksEnabled, 256 const base::android::JavaParamRef<jobject>& obj,
196 jstring textTrackBackgroundColor, 257 jboolean textTracksEnabled,
197 jstring textTrackFontFamily, 258 const base::android::JavaParamRef<jstring>& textTrackBackgroundColor,
198 jstring textTrackFontStyle, 259 const base::android::JavaParamRef<jstring>& textTrackFontFamily,
199 jstring textTrackFontVariant, 260 const base::android::JavaParamRef<jstring>& textTrackFontStyle,
200 jstring textTrackTextColor, 261 const base::android::JavaParamRef<jstring>& textTrackFontVariant,
201 jstring textTrackTextShadow, 262 const base::android::JavaParamRef<jstring>& textTrackTextColor,
202 jstring textTrackTextSize); 263 const base::android::JavaParamRef<jstring>& textTrackTextShadow,
264 const base::android::JavaParamRef<jstring>& textTrackTextSize);
203 265
204 void ExtractSmartClipData(JNIEnv* env, 266 void ExtractSmartClipData(JNIEnv* env,
205 jobject obj, 267 const base::android::JavaParamRef<jobject>& obj,
206 jint x, 268 jint x,
207 jint y, 269 jint y,
208 jint width, 270 jint width,
209 jint height); 271 jint height);
210 272
211 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque); 273 void SetBackgroundOpaque(JNIEnv* env,
274 const base::android::JavaParamRef<jobject>& jobj,
275 jboolean opaque);
212 276
213 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj); 277 jint GetCurrentRenderProcessId(
278 JNIEnv* env,
279 const base::android::JavaParamRef<jobject>& obj);
214 280
215 // -------------------------------------------------------------------------- 281 // --------------------------------------------------------------------------
216 // Public methods that call to Java via JNI 282 // Public methods that call to Java via JNI
217 // -------------------------------------------------------------------------- 283 // --------------------------------------------------------------------------
218 284
219 void OnSmartClipDataExtracted(const base::string16& text, 285 void OnSmartClipDataExtracted(const base::string16& text,
220 const base::string16& html, 286 const base::string16& html,
221 const gfx::Rect& clip_rect); 287 const gfx::Rect& clip_rect);
222 288
223 // Creates a popup menu with |items|. 289 // Creates a popup menu with |items|.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; 457 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_;
392 458
393 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 459 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
394 }; 460 };
395 461
396 bool RegisterContentViewCore(JNIEnv* env); 462 bool RegisterContentViewCore(JNIEnv* env);
397 463
398 } // namespace content 464 } // namespace content
399 465
400 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 466 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698