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

Unified Diff: content/browser/renderer_host/input/motion_event_android.h

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/motion_event_android.h
diff --git a/content/browser/renderer_host/input/motion_event_android.h b/content/browser/renderer_host/input/motion_event_android.h
index 2b7f45f67eb12fa945f8e6235326a326c183ba0f..285bb27299d9df68b921fc77f6f63565cfa609b5 100644
--- a/content/browser/renderer_host/input/motion_event_android.h
+++ b/content/browser/renderer_host/input/motion_event_android.h
@@ -37,7 +37,8 @@ class MotionEventAndroid : public ui::MotionEvent {
jint pointer_id_0,
jint pointer_id_1,
jfloat touch_major_0_pixels,
- jfloat touch_major_1_pixels);
+ jfloat touch_major_1_pixels,
+ jint tool_type);
virtual ~MotionEventAndroid();
// ui::MotionEvent methods.
@@ -66,9 +67,12 @@ class MotionEventAndroid : public ui::MotionEvent {
virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
- // Additional Android MotionEvent methods.
- float GetTouchMinor() const { return GetTouchMinor(0); }
- float GetTouchMinor(size_t pointer_index) const;
+ // Note that raw indicates values unadjusted by any min/max (the reported
+ // values are still in DIPs).
+ float GetRawTouchMajor() const { return GetRawTouchMajor(0); }
+ float GetRawTouchMajor(size_t pointer_index) const;
+ float GetRawTouchMinor() const { return GetRawTouchMinor(0); }
tdresser 2014/06/06 16:58:04 Hmmm, it's a little weird to have GetRawTouchMinor
jdduke (slow) 2014/06/06 17:18:13 There's never been a |MotionEvent::GetTouchMinor()
+ float GetRawTouchMinor(size_t pointer_index) const;
float GetOrientation() const;
base::TimeTicks GetDownTime() const;
@@ -85,7 +89,10 @@ class MotionEventAndroid : public ui::MotionEvent {
private:
MotionEventAndroid();
- MotionEventAndroid(float pix_to_dip, JNIEnv* env, jobject event);
+ MotionEventAndroid(float pix_to_dip,
+ float min_touch_major_dips,
+ JNIEnv* env,
+ jobject event);
MotionEventAndroid(const MotionEventAndroid&);
MotionEventAndroid& operator=(const MotionEventAndroid&);
@@ -113,6 +120,11 @@ class MotionEventAndroid : public ui::MotionEvent {
// DIP coordinates cached/returned by the MotionEventAndroid.
const float pix_to_dip_;
+ // Optional minimum used to report meaningful values for |GetTouchMajor()| on
+ // devices that otherwise report zero or inappropriatley small values. Note
tdresser 2014/06/06 16:58:04 s/inappropriatly/inappropriately
jdduke (slow) 2014/06/06 17:18:13 Done.
+ // that this is will be zero for stylus or mouse touch sources.
+ const float min_touch_major_dips_;
+
// Whether |event_| should be recycled on destruction. This will only be true
// for those events generated via |Obtain(...)|.
bool should_recycle_;
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/input/motion_event_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698