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

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

Powered by Google App Engine
This is Rietveld 408576698