Chromium Code Reviews| Index: ui/touch_selection/touch_handle.cc |
| diff --git a/ui/touch_selection/touch_handle.cc b/ui/touch_selection/touch_handle.cc |
| index 0680e6db8afeca5bbe649bf07992391810777efe..846e0558d8a376e74b2510960db7f7ab04a6b023 100644 |
| --- a/ui/touch_selection/touch_handle.cc |
| +++ b/ui/touch_selection/touch_handle.cc |
| @@ -44,20 +44,26 @@ bool RectIntersectsCircle(const gfx::RectF& rect, |
| } // namespace |
| +// TODO(AviD): Remove this once logging(DCHECK) supports enum class. |
| +std::ostream& operator<<(std::ostream& os, |
|
jdduke (slow)
2015/02/26 16:50:54
Thanks, let's make this static. Also, there's only
AviD
2015/02/27 10:02:27
Done.
|
| + const TouchHandleOrientation& orientation) { |
| + return os << static_cast<int>(orientation); |
| +} |
| + |
| // Responsible for rendering a selection or insertion handle for text editing. |
| TouchHandle::TouchHandle(TouchHandleClient* client, |
| TouchHandleOrientation orientation) |
| : drawable_(client->CreateDrawable()), |
| client_(client), |
| orientation_(orientation), |
| - deferred_orientation_(TOUCH_HANDLE_ORIENTATION_UNDEFINED), |
| + deferred_orientation_(TouchHandleOrientation::UNDEFINED), |
| alpha_(0.f), |
| animate_deferred_fade_(false), |
| enabled_(true), |
| is_visible_(false), |
| is_dragging_(false), |
| is_drag_within_tap_region_(false) { |
| - DCHECK_NE(orientation, TOUCH_HANDLE_ORIENTATION_UNDEFINED); |
| + DCHECK_NE(orientation, TouchHandleOrientation::UNDEFINED); |
| drawable_->SetEnabled(enabled_); |
| drawable_->SetOrientation(orientation_); |
| drawable_->SetAlpha(alpha_); |
| @@ -115,12 +121,12 @@ void TouchHandle::SetPosition(const gfx::PointF& position) { |
| void TouchHandle::SetOrientation(TouchHandleOrientation orientation) { |
| DCHECK(enabled_); |
| - DCHECK_NE(orientation, TOUCH_HANDLE_ORIENTATION_UNDEFINED); |
| + DCHECK_NE(orientation, TouchHandleOrientation::UNDEFINED); |
| if (is_dragging_) { |
| deferred_orientation_ = orientation; |
| return; |
| } |
| - DCHECK_EQ(deferred_orientation_, TOUCH_HANDLE_ORIENTATION_UNDEFINED); |
| + DCHECK_EQ(deferred_orientation_, TouchHandleOrientation::UNDEFINED); |
| if (orientation_ == orientation) |
| return; |
| @@ -230,9 +236,9 @@ void TouchHandle::EndDrag() { |
| is_drag_within_tap_region_ = false; |
| client_->OnHandleDragEnd(*this); |
| - if (deferred_orientation_ != TOUCH_HANDLE_ORIENTATION_UNDEFINED) { |
| + if (deferred_orientation_ != TouchHandleOrientation::UNDEFINED) { |
| TouchHandleOrientation deferred_orientation = deferred_orientation_; |
| - deferred_orientation_ = TOUCH_HANDLE_ORIENTATION_UNDEFINED; |
| + deferred_orientation_ = TouchHandleOrientation::UNDEFINED; |
| SetOrientation(deferred_orientation); |
| } |