| 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 UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ | 5 #ifndef UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ |
| 6 #define UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ | 6 #define UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void SetOrientation(TouchHandleOrientation orientation); | 77 void SetOrientation(TouchHandleOrientation orientation); |
| 78 | 78 |
| 79 // Allows touch-dragging of the handle. Returns true if the event was | 79 // Allows touch-dragging of the handle. Returns true if the event was |
| 80 // consumed, in which case the caller should cease further handling. | 80 // consumed, in which case the caller should cease further handling. |
| 81 bool WillHandleTouchEvent(const MotionEvent& event); | 81 bool WillHandleTouchEvent(const MotionEvent& event); |
| 82 | 82 |
| 83 // Ticks an active animation, as requested to the client by |SetNeedsAnimate|. | 83 // Ticks an active animation, as requested to the client by |SetNeedsAnimate|. |
| 84 // Returns true if an animation is active and requires further ticking. | 84 // Returns true if an animation is active and requires further ticking. |
| 85 bool Animate(base::TimeTicks frame_time); | 85 bool Animate(base::TimeTicks frame_time); |
| 86 | 86 |
| 87 // Get the visible bounds of the handle, based on the current position and |
| 88 // the drawable's size/orientation. If the handle is invisible or disabled, |
| 89 // the bounds will be empty. |
| 90 gfx::RectF GetVisibleBounds() const; |
| 91 |
| 87 bool is_dragging() const { return is_dragging_; } | 92 bool is_dragging() const { return is_dragging_; } |
| 88 const gfx::PointF& position() const { return position_; } | 93 const gfx::PointF& position() const { return position_; } |
| 89 TouchHandleOrientation orientation() const { return orientation_; } | 94 TouchHandleOrientation orientation() const { return orientation_; } |
| 90 | 95 |
| 91 private: | 96 private: |
| 92 void BeginDrag(); | 97 void BeginDrag(); |
| 93 void EndDrag(); | 98 void EndDrag(); |
| 94 void BeginFade(); | 99 void BeginFade(); |
| 95 void EndFade(); | 100 void EndFade(); |
| 96 void SetAlpha(float alpha); | 101 void SetAlpha(float alpha); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 119 bool is_visible_; | 124 bool is_visible_; |
| 120 bool is_dragging_; | 125 bool is_dragging_; |
| 121 bool is_drag_within_tap_region_; | 126 bool is_drag_within_tap_region_; |
| 122 | 127 |
| 123 DISALLOW_COPY_AND_ASSIGN(TouchHandle); | 128 DISALLOW_COPY_AND_ASSIGN(TouchHandle); |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 } // namespace ui | 131 } // namespace ui |
| 127 | 132 |
| 128 #endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ | 133 #endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_H_ |
| OLD | NEW |