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

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: Tweaks to dragging and visibility 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 int composition_start, int composition_end, 278 int composition_start, int composition_end,
277 bool show_ime_if_needed, bool is_non_ime_change); 279 bool show_ime_if_needed, bool is_non_ime_change);
278 void SetTitle(const base::string16& title); 280 void SetTitle(const base::string16& title);
279 void OnBackgroundColorChanged(SkColor color); 281 void OnBackgroundColorChanged(SkColor color);
280 282
281 bool HasFocus(); 283 bool HasFocus();
282 void OnGestureEventAck(const blink::WebGestureEvent& event, 284 void OnGestureEventAck(const blink::WebGestureEvent& event,
283 InputEventAckState ack_result); 285 InputEventAckState ack_result);
284 bool FilterInputEvent(const blink::WebInputEvent& event); 286 bool FilterInputEvent(const blink::WebInputEvent& event);
285 void OnSelectionChanged(const std::string& text); 287 void OnSelectionChanged(const std::string& text);
286 void OnSelectionBoundsChanged(const gfx::PointF& start, 288 void OnSelectionEvent(SelectionEventType event,
287 const gfx::PointF& end, 289 const gfx::PointF& anchor_position);
288 int start_dir, 290 scoped_ptr<TouchHandleDrawable> CreatePopupTouchHandleDrawable();
289 int end_dir);
290 291
291 void StartContentIntent(const GURL& content_url); 292 void StartContentIntent(const GURL& content_url);
292 293
293 // Shows the disambiguation popup 294 // Shows the disambiguation popup
294 // |target_rect| --> window coordinates which |zoomed_bitmap| represents 295 // |target_rect| --> window coordinates which |zoomed_bitmap| represents
295 // |zoomed_bitmap| --> magnified image of potential touch targets 296 // |zoomed_bitmap| --> magnified image of potential touch targets
296 void ShowDisambiguationPopup( 297 void ShowDisambiguationPopup(
297 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap); 298 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap);
298 299
299 // Creates a java-side touch event, used for injecting touch event for 300 // Creates a java-side touch event, used for injecting touch event for
300 // testing/benchmarking purposes 301 // testing/benchmarking purposes
301 base::android::ScopedJavaLocalRef<jobject> CreateTouchEventSynthesizer(); 302 base::android::ScopedJavaLocalRef<jobject> CreateTouchEventSynthesizer();
302 303
303 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewClient(); 304 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewClient();
304 305
305 // Returns the context that the ContentViewCore was created with, it would 306 // Returns the context that the ContentViewCore was created with, it would
306 // typically be an Activity context for an on screen view. 307 // typically be an Activity context for an on screen view.
307 base::android::ScopedJavaLocalRef<jobject> GetContext(); 308 base::android::ScopedJavaLocalRef<jobject> GetContext();
308 309
309 // Returns True if the given media should be blocked to load. 310 // Returns True if the given media should be blocked to load.
310 bool ShouldBlockMediaRequest(const GURL& url); 311 bool ShouldBlockMediaRequest(const GURL& url);
311 312
312 void DidStopFlinging(); 313 void DidStopFlinging();
313 314
314 // Returns the viewport size after accounting for the viewport offset. 315 // Returns the viewport size after accounting for the viewport offset.
315 gfx::Size GetViewSize() const; 316 gfx::Size GetViewSize() const;
316 317
317 void SetAccessibilityEnabledInternal(bool enabled); 318 void SetAccessibilityEnabledInternal(bool enabled);
318 319
319 void ShowSelectionHandlesAutomatically() const;
320
321 bool IsFullscreenRequiredForOrientationLock() const; 320 bool IsFullscreenRequiredForOrientationLock() const;
322 321
323 // -------------------------------------------------------------------------- 322 // --------------------------------------------------------------------------
324 // Methods called from native code 323 // Methods called from native code
325 // -------------------------------------------------------------------------- 324 // --------------------------------------------------------------------------
326 325
327 gfx::Size GetPhysicalBackingSize() const; 326 gfx::Size GetPhysicalBackingSize() const;
328 gfx::Size GetViewportSizeDip() const; 327 gfx::Size GetViewportSizeDip() const;
329 gfx::Size GetViewportSizeOffsetDip() const; 328 gfx::Size GetViewportSizeOffsetDip() const;
330 float GetOverdrawBottomHeightDip() const; 329 float GetOverdrawBottomHeightDip() const;
331 330
332 void AttachLayer(scoped_refptr<cc::Layer> layer); 331 void AttachLayer(scoped_refptr<cc::Layer> layer);
333 void RemoveLayer(scoped_refptr<cc::Layer> layer); 332 void RemoveLayer(scoped_refptr<cc::Layer> layer);
334 333
334 void SelectBetweenCoordinates(const gfx::PointF& start,
335 const gfx::PointF& end);
336
335 private: 337 private:
336 class ContentViewUserData; 338 class ContentViewUserData;
337 339
338 friend class ContentViewUserData; 340 friend class ContentViewUserData;
339 virtual ~ContentViewCoreImpl(); 341 virtual ~ContentViewCoreImpl();
340 342
341 // WebContentsObserver implementation. 343 // WebContentsObserver implementation.
342 virtual void RenderViewReady() OVERRIDE; 344 virtual void RenderViewReady() OVERRIDE;
343 virtual void RenderViewHostChanged(RenderViewHost* old_host, 345 virtual void RenderViewHostChanged(RenderViewHost* old_host,
344 RenderViewHost* new_host) OVERRIDE; 346 RenderViewHost* new_host) OVERRIDE;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 java_bridge_dispatcher_host_; 404 java_bridge_dispatcher_host_;
403 405
404 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 406 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
405 }; 407 };
406 408
407 bool RegisterContentViewCore(JNIEnv* env); 409 bool RegisterContentViewCore(JNIEnv* env);
408 410
409 } // namespace content 411 } // namespace content
410 412
411 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 413 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698