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

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

Issue 335943002: [Android] Composited selection handle rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_native_handles_final
Patch Set: More code review Created 6 years, 5 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 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 jfloat pos_x_1, 110 jfloat pos_x_1,
111 jfloat pos_y_1, 111 jfloat pos_y_1,
112 jint pointer_id_0, 112 jint pointer_id_0,
113 jint pointer_id_1, 113 jint pointer_id_1,
114 jfloat touch_major_0, 114 jfloat touch_major_0,
115 jfloat touch_major_1, 115 jfloat touch_major_1,
116 jfloat raw_pos_x, 116 jfloat raw_pos_x,
117 jfloat raw_pos_y, 117 jfloat raw_pos_y,
118 jint android_tool_type_0, 118 jint android_tool_type_0,
119 jint android_tool_type_1, 119 jint android_tool_type_1,
120 jint android_button_state); 120 jint android_button_state,
121 jboolean is_touch_handle_event);
121 jboolean SendMouseMoveEvent(JNIEnv* env, 122 jboolean SendMouseMoveEvent(JNIEnv* env,
122 jobject obj, 123 jobject obj,
123 jlong time_ms, 124 jlong time_ms,
124 jfloat x, 125 jfloat x,
125 jfloat y); 126 jfloat y);
126 jboolean SendMouseWheelEvent(JNIEnv* env, 127 jboolean SendMouseWheelEvent(JNIEnv* env,
127 jobject obj, 128 jobject obj,
128 jlong time_ms, 129 jlong time_ms,
129 jfloat x, 130 jfloat x,
130 jfloat y, 131 jfloat y,
(...skipping 13 matching lines...) Expand all
144 void LongPress(JNIEnv* env, jobject obj, jlong time_ms, 145 void LongPress(JNIEnv* env, jobject obj, jlong time_ms,
145 jfloat x, jfloat y); 146 jfloat x, jfloat y);
146 void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jfloat x, jfloat y); 147 void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jfloat x, jfloat y);
147 void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms); 148 void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms);
148 void PinchBy(JNIEnv* env, jobject obj, jlong time_ms, 149 void PinchBy(JNIEnv* env, jobject obj, jlong time_ms,
149 jfloat x, jfloat y, jfloat delta); 150 jfloat x, jfloat y, jfloat delta);
150 void SelectBetweenCoordinates(JNIEnv* env, jobject obj, 151 void SelectBetweenCoordinates(JNIEnv* env, jobject obj,
151 jfloat x1, jfloat y1, 152 jfloat x1, jfloat y1,
152 jfloat x2, jfloat y2); 153 jfloat x2, jfloat y2);
153 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); 154 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y);
155 void HideTextHandles(JNIEnv* env, jobject obj);
154 156
155 void ResetGestureDetection(JNIEnv* env, jobject obj); 157 void ResetGestureDetection(JNIEnv* env, jobject obj);
156 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); 158 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled);
157 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, 159 void SetMultiTouchZoomSupportEnabled(JNIEnv* env,
158 jobject obj, 160 jobject obj,
159 jboolean enabled); 161 jboolean enabled);
160 162
161 void AddStyleSheetByURL(JNIEnv* env, jobject obj, jstring url); 163 void AddStyleSheetByURL(JNIEnv* env, jobject obj, jstring url);
162 void ClearHistory(JNIEnv* env, jobject obj); 164 void ClearHistory(JNIEnv* env, jobject obj);
163 void EvaluateJavaScript(JNIEnv* env, 165 void EvaluateJavaScript(JNIEnv* env,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 int composition_start, int composition_end, 279 int composition_start, int composition_end,
278 bool show_ime_if_needed, bool is_non_ime_change); 280 bool show_ime_if_needed, bool is_non_ime_change);
279 void SetTitle(const base::string16& title); 281 void SetTitle(const base::string16& title);
280 void OnBackgroundColorChanged(SkColor color); 282 void OnBackgroundColorChanged(SkColor color);
281 283
282 bool HasFocus(); 284 bool HasFocus();
283 void OnGestureEventAck(const blink::WebGestureEvent& event, 285 void OnGestureEventAck(const blink::WebGestureEvent& event,
284 InputEventAckState ack_result); 286 InputEventAckState ack_result);
285 bool FilterInputEvent(const blink::WebInputEvent& event); 287 bool FilterInputEvent(const blink::WebInputEvent& event);
286 void OnSelectionChanged(const std::string& text); 288 void OnSelectionChanged(const std::string& text);
287 void OnSelectionBoundsChanged(const gfx::PointF& start, 289 void OnSelectionEvent(SelectionEventType event,
288 const gfx::PointF& end, 290 const gfx::PointF& anchor_position);
289 int start_dir, 291 scoped_ptr<TouchHandleDrawable> CreatePopupTouchHandleDrawable();
290 int end_dir);
291 292
292 void StartContentIntent(const GURL& content_url); 293 void StartContentIntent(const GURL& content_url);
293 294
294 // Shows the disambiguation popup 295 // Shows the disambiguation popup
295 // |target_rect| --> window coordinates which |zoomed_bitmap| represents 296 // |target_rect| --> window coordinates which |zoomed_bitmap| represents
296 // |zoomed_bitmap| --> magnified image of potential touch targets 297 // |zoomed_bitmap| --> magnified image of potential touch targets
297 void ShowDisambiguationPopup( 298 void ShowDisambiguationPopup(
298 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); 299 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap);
299 300
300 // Creates a java-side touch event, used for injecting touch event for 301 // Creates a java-side touch event, used for injecting touch event for
301 // testing/benchmarking purposes 302 // testing/benchmarking purposes
302 base::android::ScopedJavaLocalRef<jobject> CreateTouchEventSynthesizer(); 303 base::android::ScopedJavaLocalRef<jobject> CreateTouchEventSynthesizer();
303 304
304 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewClient(); 305 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewClient();
305 306
306 // Returns the context that the ContentViewCore was created with, it would 307 // Returns the context that the ContentViewCore was created with, it would
307 // typically be an Activity context for an on screen view. 308 // typically be an Activity context for an on screen view.
308 base::android::ScopedJavaLocalRef<jobject> GetContext(); 309 base::android::ScopedJavaLocalRef<jobject> GetContext();
309 310
310 // Returns True if the given media should be blocked to load. 311 // Returns True if the given media should be blocked to load.
311 bool ShouldBlockMediaRequest(const GURL& url); 312 bool ShouldBlockMediaRequest(const GURL& url);
312 313
313 void DidStopFlinging(); 314 void DidStopFlinging();
314 315
315 // Returns the viewport size after accounting for the viewport offset. 316 // Returns the viewport size after accounting for the viewport offset.
316 gfx::Size GetViewSize() const; 317 gfx::Size GetViewSize() const;
317 318
318 void SetAccessibilityEnabledInternal(bool enabled); 319 void SetAccessibilityEnabledInternal(bool enabled);
319 320
320 void ShowSelectionHandlesAutomatically() const;
321
322 bool IsFullscreenRequiredForOrientationLock() const; 321 bool IsFullscreenRequiredForOrientationLock() const;
323 322
324 // -------------------------------------------------------------------------- 323 // --------------------------------------------------------------------------
325 // Methods called from native code 324 // Methods called from native code
326 // -------------------------------------------------------------------------- 325 // --------------------------------------------------------------------------
327 326
328 gfx::Size GetPhysicalBackingSize() const; 327 gfx::Size GetPhysicalBackingSize() const;
329 gfx::Size GetViewportSizeDip() const; 328 gfx::Size GetViewportSizeDip() const;
330 gfx::Size GetViewportSizeOffsetDip() const; 329 gfx::Size GetViewportSizeOffsetDip() const;
331 float GetOverdrawBottomHeightDip() const; 330 float GetOverdrawBottomHeightDip() const;
332 331
333 void AttachLayer(scoped_refptr<cc::Layer> layer); 332 void AttachLayer(scoped_refptr<cc::Layer> layer);
334 void RemoveLayer(scoped_refptr<cc::Layer> layer); 333 void RemoveLayer(scoped_refptr<cc::Layer> layer);
335 334
335 void SelectBetweenCoordinates(const gfx::PointF& start,
336 const gfx::PointF& end);
337
336 private: 338 private:
337 class ContentViewUserData; 339 class ContentViewUserData;
338 340
339 friend class ContentViewUserData; 341 friend class ContentViewUserData;
340 virtual ~ContentViewCoreImpl(); 342 virtual ~ContentViewCoreImpl();
341 343
342 // WebContentsObserver implementation. 344 // WebContentsObserver implementation.
343 virtual void RenderViewReady() OVERRIDE; 345 virtual void RenderViewReady() OVERRIDE;
344 virtual void RenderViewHostChanged(RenderViewHost* old_host, 346 virtual void RenderViewHostChanged(RenderViewHost* old_host,
345 RenderViewHost* new_host) OVERRIDE; 347 RenderViewHost* new_host) OVERRIDE;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 java_bridge_dispatcher_host_; 405 java_bridge_dispatcher_host_;
404 406
405 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 407 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
406 }; 408 };
407 409
408 bool RegisterContentViewCore(JNIEnv* env); 410 bool RegisterContentViewCore(JNIEnv* env);
409 411
410 } // namespace content 412 } // namespace content
411 413
412 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 414 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698