Index: content/browser/renderer_host/input/content_motion_event_impl.h |
diff --git a/content/browser/renderer_host/input/content_motion_event_impl.h b/content/browser/renderer_host/input/content_motion_event_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f429d28e23c95c4e7f6e0945259fbcf7efb3797e |
--- /dev/null |
+++ b/content/browser/renderer_host/input/content_motion_event_impl.h |
@@ -0,0 +1,58 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_MOTION_EVENT_IMPL_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_MOTION_EVENT_IMPL_H_ |
+ |
+#include "content/browser/renderer_host/input/native_web_touch_event.h" |
+#include "ui/events/gesture_detection/motion_event.h" |
+ |
+namespace content { |
+ |
+// Content implementation of ui::MotionEvent. |
+class ContentMotionEventImpl : public ui::MotionEvent { |
+ public: |
+#if defined(OS_ANDROID) |
+ ContentMotionEventImpl(jobject android_motion_event, |
+ bool should_recycle, |
+ float device_scale_factor); |
+#endif |
+ explicit ContentMotionEventImpl(const NativeWebTouchEvent& event); |
+ virtual ~ContentMotionEventImpl(); |
+ |
+ // ui::MotionEvent |
+ virtual Action GetAction() const OVERRIDE; |
+ virtual int GetActionIndex() const OVERRIDE; |
+ virtual size_t GetPointerCount() const OVERRIDE; |
+ virtual int GetPointerId(size_t pointer_index) const OVERRIDE; |
+ virtual float GetX(size_t pointer_index) const OVERRIDE; |
+ virtual float GetY(size_t pointer_index) const OVERRIDE; |
+ virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; |
+ virtual base::TimeTicks GetEventTime() const OVERRIDE; |
+ virtual size_t GetHistorySize() const OVERRIDE; |
+ virtual base::TimeTicks GetHistoricalEventTime( |
+ size_t historical_index) const OVERRIDE; |
+ virtual float GetHistoricalTouchMajor( |
+ size_t pointer_index, |
+ size_t historical_index) const OVERRIDE; |
+ virtual float GetHistoricalX( |
+ size_t pointer_index, |
+ size_t historical_index) const OVERRIDE; |
+ virtual float GetHistoricalY( |
+ size_t pointer_index, |
+ size_t historical_index) const OVERRIDE; |
+ virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; |
+ virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; |
+ |
+ private: |
+ NativeWebTouchEvent event_; |
+ Action cached_action_; |
+ int cached_action_index_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ContentMotionEventImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_MOTION_EVENT_IMPL_H_ |