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_selection_controller.h" | 5 #include "ui/touch_selection/touch_selection_controller.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/events/test/motion_event_test_utils.h" | 8 #include "ui/events/test/motion_event_test_utils.h" |
9 | 9 |
10 using ui::test::MockMotionEvent; | 10 using ui::test::MockMotionEvent; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 void SelectBetweenCoordinates(const gfx::PointF& base, | 73 void SelectBetweenCoordinates(const gfx::PointF& base, |
74 const gfx::PointF& extent) override { | 74 const gfx::PointF& extent) override { |
75 if (base == selection_end_ && extent == selection_start_) | 75 if (base == selection_end_ && extent == selection_start_) |
76 selection_points_swapped_ = true; | 76 selection_points_swapped_ = true; |
77 | 77 |
78 selection_start_ = base; | 78 selection_start_ = base; |
79 selection_end_ = extent; | 79 selection_end_ = extent; |
80 } | 80 } |
81 | 81 |
82 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override { | 82 void MoveRangeSelectionExtent(const gfx::PointF& extent) override { |
83 selection_moved_ = true; | 83 selection_moved_ = true; |
84 selection_end_ = extent; | 84 selection_end_ = extent; |
85 } | 85 } |
86 | 86 |
87 void OnSelectionEvent(SelectionEventType event, | 87 void OnSelectionEvent(SelectionEventType event, |
88 const gfx::PointF& end_position) override { | 88 const gfx::PointF& end_position) override { |
89 last_event_ = event; | 89 last_event_ = event; |
90 last_event_start_ = end_position; | 90 last_event_start_ = end_position; |
91 } | 91 } |
92 | 92 |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 controller().OnSelectionEmpty(false); | 834 controller().OnSelectionEmpty(false); |
835 controller().HideAndDisallowShowingAutomatically(); | 835 controller().HideAndDisallowShowingAutomatically(); |
836 gfx::RectF insertion_rect(5, 5, 0, 10); | 836 gfx::RectF insertion_rect(5, 5, 0, 10); |
837 ChangeInsertion(insertion_rect, visible); | 837 ChangeInsertion(insertion_rect, visible); |
838 controller().AllowShowingFromCurrentSelection(); | 838 controller().AllowShowingFromCurrentSelection(); |
839 EXPECT_EQ(INSERTION_SHOWN, GetLastEventType()); | 839 EXPECT_EQ(INSERTION_SHOWN, GetLastEventType()); |
840 EXPECT_EQ(insertion_rect.bottom_left(), GetLastEventAnchor()); | 840 EXPECT_EQ(insertion_rect.bottom_left(), GetLastEventAnchor()); |
841 } | 841 } |
842 | 842 |
843 } // namespace ui | 843 } // namespace ui |
OLD | NEW |