Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / events / gestures / gesture_recognizer_impl_mac.cc
blob4dfa311803c25a5eaff1ea73c9f8787416b531e4
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/macros.h"
6 #include "ui/events/gestures/gesture_recognizer.h"
8 namespace ui {
10 namespace {
12 // Stub implementation of GestureRecognizer for Mac. Currently only serves to
13 // provide a no-op implementation of TransferEventsTo().
14 class GestureRecognizerImplMac : public GestureRecognizer {
15 public:
16 GestureRecognizerImplMac() {}
17 virtual ~GestureRecognizerImplMac() {}
19 private:
20 virtual bool ProcessTouchEventPreDispatch(
21 const TouchEvent& event,
22 GestureConsumer* consumer) OVERRIDE {
23 return false;
26 virtual Gestures* ProcessTouchEventPostDispatch(
27 const TouchEvent& event,
28 ui::EventResult result,
29 GestureConsumer* consumer) OVERRIDE {
30 return NULL;
32 virtual Gestures* ProcessTouchEventOnAsyncAck(
33 const TouchEvent& event,
34 ui::EventResult result,
35 GestureConsumer* consumer) OVERRIDE {
36 return NULL;
38 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) OVERRIDE {
39 return false;
41 virtual GestureConsumer* GetTouchLockedTarget(
42 const TouchEvent& event) OVERRIDE {
43 return NULL;
45 virtual GestureConsumer* GetTargetForGestureEvent(
46 const GestureEvent& event) OVERRIDE {
47 return NULL;
49 virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location,
50 int source_device_id) OVERRIDE {
51 return NULL;
53 virtual void TransferEventsTo(GestureConsumer* current_consumer,
54 GestureConsumer* new_consumer) OVERRIDE {}
55 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer,
56 gfx::PointF* point) OVERRIDE {
57 return false;
59 virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE {
60 return false;
62 virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
63 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE {}
65 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac);
68 } // namespace
70 // static
71 GestureRecognizer* GestureRecognizer::Get() {
72 CR_DEFINE_STATIC_LOCAL(GestureRecognizerImplMac, instance, ());
73 return &instance;
76 } // namespace ui