diff options
author | danakj <danakj@chromium.org> | 2015-10-22 12:15:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-22 19:16:40 +0000 |
commit | 2a2fd4be5ecda00404baa3ef00badbd1bc8ef332 (patch) | |
tree | 9d75ca646fb46babc63cd91e6a4b0882512a4b61 /ui | |
parent | d20c3c7e931ee9c59347d019e5bfdd156050d5ad (diff) | |
download | chromium_src-2a2fd4be5ecda00404baa3ef00badbd1bc8ef332.zip chromium_src-2a2fd4be5ecda00404baa3ef00badbd1bc8ef332.tar.gz chromium_src-2a2fd4be5ecda00404baa3ef00badbd1bc8ef332.tar.bz2 |
ui: Remove some implicit Point to PointF conversions.
The implicit conversion operator is going away.
R=sky@chromium.org
BUG=342848
Review URL: https://codereview.chromium.org/1415163003
Cr-Commit-Position: refs/heads/master@{#355601}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/dragdrop/drop_target_event.cc | 7 | ||||
-rw-r--r-- | ui/base/dragdrop/drop_target_event.h | 4 | ||||
-rw-r--r-- | ui/events/test/event_generator.cc | 14 | ||||
-rw-r--r-- | ui/events/test/event_generator.h | 4 | ||||
-rw-r--r-- | ui/events/test/events_test_utils.h | 2 | ||||
-rw-r--r-- | ui/views/view.cc | 4 |
6 files changed, 22 insertions, 13 deletions
diff --git a/ui/base/dragdrop/drop_target_event.cc b/ui/base/dragdrop/drop_target_event.cc index bbbf84a..8ae61d4f 100644 --- a/ui/base/dragdrop/drop_target_event.cc +++ b/ui/base/dragdrop/drop_target_event.cc @@ -12,8 +12,8 @@ namespace ui { // DropTargetEvent DropTargetEvent::DropTargetEvent(const OSExchangeData& data, - const gfx::Point& location, - const gfx::Point& root_location, + const gfx::PointF& location, + const gfx::PointF& root_location, int source_operations) : LocatedEvent(ET_DROP_TARGET_EVENT, location, @@ -21,8 +21,7 @@ DropTargetEvent::DropTargetEvent(const OSExchangeData& data, EventTimeForNow(), 0), data_(data), - source_operations_(source_operations) { -} + source_operations_(source_operations) {} } // namespace ui diff --git a/ui/base/dragdrop/drop_target_event.h b/ui/base/dragdrop/drop_target_event.h index 18c0630..27aabcd 100644 --- a/ui/base/dragdrop/drop_target_event.h +++ b/ui/base/dragdrop/drop_target_event.h @@ -13,8 +13,8 @@ namespace ui { class UI_BASE_EXPORT DropTargetEvent : public LocatedEvent { public: DropTargetEvent(const OSExchangeData& data, - const gfx::Point& location, - const gfx::Point& root_location, + const gfx::PointF& location, + const gfx::PointF& root_location, int source_operations); const OSExchangeData& data() const { return data_; } diff --git a/ui/events/test/event_generator.cc b/ui/events/test/event_generator.cc index 9eef75b..84b53ab 100644 --- a/ui/events/test/event_generator.cc +++ b/ui/events/test/event_generator.cc @@ -62,9 +62,15 @@ class TestTouchEvent : public ui::TouchEvent { int touch_id, int flags, base::TimeDelta timestamp) - : TouchEvent(type, root_location, flags, touch_id, timestamp, - 1.0f, 1.0f, 0.0f, 0.0f) { - } + : TouchEvent(type, + gfx::PointF(root_location), + flags, + touch_id, + timestamp, + 1.0f, + 1.0f, + 0.0f, + 0.0f) {} private: DISALLOW_COPY_AND_ASSIGN(TestTouchEvent); @@ -158,7 +164,7 @@ void EventGenerator::ReleaseRightButton() { } void EventGenerator::MoveMouseWheel(int delta_x, int delta_y) { - gfx::Point location = GetLocationInCurrentRoot(); + auto location = gfx::PointF(GetLocationInCurrentRoot()); ui::MouseEvent mouseev(ui::ET_MOUSEWHEEL, location, location, ui::EventTimeForNow(), flags_, 0); ui::MouseWheelEvent wheelev(mouseev, delta_x, delta_y); diff --git a/ui/events/test/event_generator.h b/ui/events/test/event_generator.h index 6f84e80..9a72695 100644 --- a/ui/events/test/event_generator.h +++ b/ui/events/test/event_generator.h @@ -21,6 +21,10 @@ namespace base { class TickClock; } +namespace gfx { +class PointF; +} + namespace ui { class Event; class EventProcessor; diff --git a/ui/events/test/events_test_utils.h b/ui/events/test/events_test_utils.h index d4b704a..c9bd55d 100644 --- a/ui/events/test/events_test_utils.h +++ b/ui/events/test/events_test_utils.h @@ -39,7 +39,7 @@ class LocatedEventTestApi : public EventTestApi { explicit LocatedEventTestApi(LocatedEvent* located_event); ~LocatedEventTestApi() override; - void set_location(const gfx::Point& location) { + void set_location(const gfx::PointF& location) { located_event_->location_ = location; } diff --git a/ui/views/view.cc b/ui/views/view.cc index 8ae740a..6378432 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -1987,7 +1987,7 @@ bool View::ConvertPointForAncestor(const View* ancestor, gfx::Transform trans; // TODO(sad): Have some way of caching the transformation results. bool result = GetTransformRelativeTo(ancestor, &trans); - gfx::Point3F p(*point); + auto p = gfx::Point3F(gfx::PointF(*point)); trans.TransformPoint(&p); *point = gfx::ToFlooredPoint(p.AsPointF()); return result; @@ -1997,7 +1997,7 @@ bool View::ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const { gfx::Transform trans; bool result = GetTransformRelativeTo(ancestor, &trans); - gfx::Point3F p(*point); + auto p = gfx::Point3F(gfx::PointF(*point)); trans.TransformPointReverse(&p); *point = gfx::ToFlooredPoint(p.AsPointF()); return result; |