| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "ui/events/gestures/gesture_recognizer.h" | 6 #include "ui/events/gestures/gesture_recognizer.h" |
| 7 | 7 |
| 8 namespace ui { | 8 namespace ui { |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 // Stub implementation of GestureRecognizer for Mac. Currently only serves to | 12 // Stub implementation of GestureRecognizer for Mac. Currently only serves to |
| 13 // provide a no-op implementation of TransferEventsTo(). | 13 // provide a no-op implementation of TransferEventsTo(). |
| 14 class GestureRecognizerImplMac : public GestureRecognizer { | 14 class GestureRecognizerImplMac : public GestureRecognizer { |
| 15 public: | 15 public: |
| 16 GestureRecognizerImplMac() {} | 16 GestureRecognizerImplMac() {} |
| 17 virtual ~GestureRecognizerImplMac() {} | 17 virtual ~GestureRecognizerImplMac() {} |
| 18 | 18 |
| 19 private: | 19 private: |
| 20 virtual bool ProcessTouchEventPreDispatch( | 20 virtual bool ProcessTouchEventPreDispatch( |
| 21 const TouchEvent& event, | 21 const TouchEvent& event, |
| 22 GestureConsumer* consumer) OVERRIDE { | 22 GestureConsumer* consumer) override { |
| 23 return false; | 23 return false; |
| 24 } | 24 } |
| 25 | 25 |
| 26 virtual Gestures* ProcessTouchEventPostDispatch( | 26 virtual Gestures* ProcessTouchEventPostDispatch( |
| 27 const TouchEvent& event, | 27 const TouchEvent& event, |
| 28 ui::EventResult result, | 28 ui::EventResult result, |
| 29 GestureConsumer* consumer) OVERRIDE { | 29 GestureConsumer* consumer) override { |
| 30 return NULL; | 30 return NULL; |
| 31 } | 31 } |
| 32 virtual Gestures* ProcessTouchEventOnAsyncAck( | 32 virtual Gestures* ProcessTouchEventOnAsyncAck( |
| 33 const TouchEvent& event, | 33 const TouchEvent& event, |
| 34 ui::EventResult result, | 34 ui::EventResult result, |
| 35 GestureConsumer* consumer) OVERRIDE { | 35 GestureConsumer* consumer) override { |
| 36 return NULL; | 36 return NULL; |
| 37 }; | 37 }; |
| 38 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) OVERRIDE { | 38 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) override { |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 virtual GestureConsumer* GetTouchLockedTarget( | 41 virtual GestureConsumer* GetTouchLockedTarget( |
| 42 const TouchEvent& event) OVERRIDE { | 42 const TouchEvent& event) override { |
| 43 return NULL; | 43 return NULL; |
| 44 } | 44 } |
| 45 virtual GestureConsumer* GetTargetForGestureEvent( | 45 virtual GestureConsumer* GetTargetForGestureEvent( |
| 46 const GestureEvent& event) OVERRIDE { | 46 const GestureEvent& event) override { |
| 47 return NULL; | 47 return NULL; |
| 48 } | 48 } |
| 49 virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location, | 49 virtual GestureConsumer* GetTargetForLocation(const gfx::PointF& location, |
| 50 int source_device_id) OVERRIDE { | 50 int source_device_id) override { |
| 51 return NULL; | 51 return NULL; |
| 52 } | 52 } |
| 53 virtual void TransferEventsTo(GestureConsumer* current_consumer, | 53 virtual void TransferEventsTo(GestureConsumer* current_consumer, |
| 54 GestureConsumer* new_consumer) OVERRIDE {} | 54 GestureConsumer* new_consumer) override {} |
| 55 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, | 55 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, |
| 56 gfx::PointF* point) OVERRIDE { | 56 gfx::PointF* point) override { |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 virtual bool CancelActiveTouches(GestureConsumer* consumer) OVERRIDE { | 59 virtual bool CancelActiveTouches(GestureConsumer* consumer) override { |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 virtual void AddGestureEventHelper(GestureEventHelper* helper) OVERRIDE {} | 62 virtual void AddGestureEventHelper(GestureEventHelper* helper) override {} |
| 63 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) OVERRIDE {} | 63 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) override {} |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac); | 65 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImplMac); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 // static | 70 // static |
| 71 GestureRecognizer* GestureRecognizer::Get() { | 71 GestureRecognizer* GestureRecognizer::Get() { |
| 72 CR_DEFINE_STATIC_LOCAL(GestureRecognizerImplMac, instance, ()); | 72 CR_DEFINE_STATIC_LOCAL(GestureRecognizerImplMac, instance, ()); |
| 73 return &instance; | 73 return &instance; |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace ui | 76 } // namespace ui |
| OLD | NEW |