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. 4 5 #include "base/macros.h" 6 #include "ui/events/gestures/gesture_recognizer.h" 7 8 namespace ui { 9 10 namespace { 11 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() {} 18 19 private: 20 virtual bool ProcessTouchEventPreDispatch( 21 const TouchEvent& event, 22 GestureConsumer* consumer) OVERRIDE { 23 return false; 24 } 25 26 virtual Gestures* ProcessTouchEventPostDispatch( 27 const TouchEvent& event, 28 ui::EventResult result, 29 GestureConsumer* consumer) OVERRIDE { 30 return NULL; 31 } 32 virtual Gestures* ProcessTouchEventOnAsyncAck( 33 const TouchEvent& event, 34 ui::EventResult result, 35 GestureConsumer* consumer) OVERRIDE { 36 return NULL; 37 }; 38 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) OVERRIDE { 39 return false; 40 } 41 virtual GestureConsumer* GetTouchLockedTarget( 42 const TouchEvent& event) OVERRIDE { 43 return NULL; 44 } 45 virtual GestureConsumer* GetTargetForGestureEvent( 46 const GestureEvent& event) OVERRIDE { 47 return NULL; 48 } 49 virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location, 50 int source_device_id) OVERRIDE { 51 return NULL; 52 } 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; 58 } 59 virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE { 60 return false; 61 } 62 virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE {} 63 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE {} 64 65 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac); 66 }; 67 68 } // namespace 69 70 // static 71 GestureRecognizer* GestureRecognizer::Get() { 72 CR_DEFINE_STATIC_LOCAL(GestureRecognizerImplMac, instance, ()); 73 return &instance; 74 } 75 76 } // namespace ui 77