| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "cc/output/viewport_selection_bound.h" | 8 #include "cc/output/viewport_selection_bound.h" |
| 9 #include "content/browser/renderer_host/input/selection_event_type.h" | 9 #include "content/browser/renderer_host/input/selection_event_type.h" |
| 10 #include "content/browser/renderer_host/input/touch_handle.h" | 10 #include "content/browser/renderer_host/input/touch_handle.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // To be called when the editability of the focused region changes. | 75 // To be called when the editability of the focused region changes. |
| 76 void OnSelectionEditable(bool editable); | 76 void OnSelectionEditable(bool editable); |
| 77 | 77 |
| 78 // To be called when the contents of the focused region changes. | 78 // To be called when the contents of the focused region changes. |
| 79 void OnSelectionEmpty(bool empty); | 79 void OnSelectionEmpty(bool empty); |
| 80 | 80 |
| 81 // Ticks an active animation, as requested to the client by |SetNeedsAnimate|. | 81 // Ticks an active animation, as requested to the client by |SetNeedsAnimate|. |
| 82 // Returns true if an animation is active and requires further ticking. | 82 // Returns true if an animation is active and requires further ticking. |
| 83 bool Animate(base::TimeTicks animate_time); | 83 bool Animate(base::TimeTicks animate_time); |
| 84 | 84 |
| 85 void ActivateSelection(const cc::ViewportSelectionBound& start, |
| 86 const cc::ViewportSelectionBound& end); |
| 87 |
| 88 bool is_insertion_active() const { return is_insertion_active_; } |
| 89 bool is_selection_active() const { return is_selection_active_; } |
| 90 |
| 85 private: | 91 private: |
| 86 enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; | 92 enum InputEventType { TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; |
| 87 | 93 |
| 88 // TouchHandleClient implementation. | 94 // TouchHandleClient implementation. |
| 89 void OnHandleDragBegin(const TouchHandle& handle) override; | 95 void OnHandleDragBegin(const TouchHandle& handle) override; |
| 90 void OnHandleDragUpdate(const TouchHandle& handle, | 96 void OnHandleDragUpdate(const TouchHandle& handle, |
| 91 const gfx::PointF& new_position) override; | 97 const gfx::PointF& new_position) override; |
| 92 void OnHandleDragEnd(const TouchHandle& handle) override; | 98 void OnHandleDragEnd(const TouchHandle& handle) override; |
| 93 void OnHandleTapped(const TouchHandle& handle) override; | 99 void OnHandleTapped(const TouchHandle& handle) override; |
| 94 void SetNeedsAnimate() override; | 100 void SetNeedsAnimate() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool selection_editable_; | 147 bool selection_editable_; |
| 142 | 148 |
| 143 bool temporarily_hidden_; | 149 bool temporarily_hidden_; |
| 144 | 150 |
| 145 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 151 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
| 146 }; | 152 }; |
| 147 | 153 |
| 148 } // namespace content | 154 } // namespace content |
| 149 | 155 |
| 150 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ | 156 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_SELECTION_CONTROLLER_H_ |
| OLD | NEW |