Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: ui/touch_selection/touch_handle.h

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null check Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/touch_selection/selection_event_type.h ('k') | ui/touch_selection/touch_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ui/touch_selection/selection_event_type.h ('k') | ui/touch_selection/touch_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698