| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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 #ifndef UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_ANDROID_H_ |
| 6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_ANDROID_H_ |
| 7 |
| 8 #include "ui/gfx/geometry/point_f.h" |
| 9 #include "ui/touch_selection/selection_event_type.h" |
| 10 #include "ui/touch_selection/touch_selection_controller.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 // Interface through which |TouchSelectionControllerAndroid| issues |
| 15 // selection-related commands, notifications and requests. |
| 16 class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerAndroidClient |
| 17 : public TouchSelectionControllerClient { |
| 18 public: |
| 19 ~TouchSelectionControllerAndroidClient() override {} |
| 20 |
| 21 virtual bool SupportsAnimation() const = 0; |
| 22 virtual void SetNeedsAnimate() = 0; |
| 23 virtual void OnSelectionEvent(SelectionEventType event, |
| 24 const gfx::PointF& position) = 0; |
| 25 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; |
| 26 }; |
| 27 |
| 28 // Android implementation of |TouchSelectionController|. |
| 29 class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerAndroid |
| 30 : public TouchSelectionController { |
| 31 public: |
| 32 TouchSelectionControllerAndroid(TouchSelectionControllerAndroidClient* client, |
| 33 base::TimeDelta tap_timeout, |
| 34 float tap_slop); |
| 35 ~TouchSelectionControllerAndroid() override; |
| 36 |
| 37 private: |
| 38 // TouchSelectionController: |
| 39 void OnSelectionEvent(SelectionEventType event, |
| 40 const gfx::PointF& position) override; |
| 41 bool SupportsAnimation() const override; |
| 42 void SetNeedsAnimate() override; |
| 43 scoped_ptr<TouchHandleDrawable> CreateDrawable() override; |
| 44 |
| 45 TouchSelectionControllerAndroidClient* const client_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerAndroid); |
| 48 }; |
| 49 |
| 50 } // namespace ui |
| 51 |
| 52 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_ANDROID_H_ |
| OLD | NEW |