| 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 #include "ui/touch_selection/touch_handle.h" | 5 #include "ui/touch_selection/touch_handle.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 closest_point_in_rect.SetToMax(rect.origin()); | 39 closest_point_in_rect.SetToMax(rect.origin()); |
| 40 closest_point_in_rect.SetToMin(rect.bottom_right()); | 40 closest_point_in_rect.SetToMin(rect.bottom_right()); |
| 41 | 41 |
| 42 gfx::Vector2dF distance = circle_center - closest_point_in_rect; | 42 gfx::Vector2dF distance = circle_center - closest_point_in_rect; |
| 43 return distance.LengthSquared() < (circle_radius * circle_radius); | 43 return distance.LengthSquared() < (circle_radius * circle_radius); |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 // TODO(AviD): Remove this once logging(DCHECK) supports enum class. | 48 // TODO(AviD): Remove this once logging(DCHECK) supports enum class. |
| 49 static std::ostream& operator<<(std::ostream& os, | 49 std::ostream& operator<<(std::ostream& os, |
| 50 const TouchHandleOrientation& orientation) { | 50 const TouchHandleOrientation& orientation) { |
| 51 switch (orientation) { | 51 switch (orientation) { |
| 52 case TouchHandleOrientation::LEFT: | 52 case TouchHandleOrientation::LEFT: |
| 53 return os << "LEFT"; | 53 return os << "LEFT"; |
| 54 case TouchHandleOrientation::RIGHT: | 54 case TouchHandleOrientation::RIGHT: |
| 55 return os << "RIGHT"; | 55 return os << "RIGHT"; |
| 56 case TouchHandleOrientation::CENTER: | 56 case TouchHandleOrientation::CENTER: |
| 57 return os << "CENTER"; | 57 return os << "CENTER"; |
| 58 case TouchHandleOrientation::UNDEFINED: | 58 case TouchHandleOrientation::UNDEFINED: |
| 59 return os << "UNDEFINED"; | 59 return os << "UNDEFINED"; |
| 60 default: | 60 default: |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 drawable_->SetAlpha(alpha); | 400 drawable_->SetAlpha(alpha); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void TouchHandle::SetUpdateLayoutRequired() { | 403 void TouchHandle::SetUpdateLayoutRequired() { |
| 404 // TODO(AviD): Make the layout call explicit to the caller by adding this in | 404 // TODO(AviD): Make the layout call explicit to the caller by adding this in |
| 405 // TouchHandleClient. | 405 // TouchHandleClient. |
| 406 is_handle_layout_update_required_ = true; | 406 is_handle_layout_update_required_ = true; |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace ui | 409 } // namespace ui |
| OLD | NEW |