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

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

Issue 128613003: [Tracking Patch] Unified gesture detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address tdresser@ comments and run clang-format on everything Created 6 years, 10 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/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_

Powered by Google App Engine
This is Rietveld 408576698