summaryrefslogtreecommitdiffstats
path: root/ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff options
context:
space:
mode:
authormohsen <mohsen@chromium.org>2014-12-09 11:01:34 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-09 19:02:05 +0000
commitf837da7c7807d4dc84733b201ac74a6bab9ae3a5 (patch)
tree62e8951855fe6cd3a02c7f359f434053a66f421d /ui/views/touchui/touch_selection_controller_impl_unittest.cc
parent4893b519c849b1f548f6fb66e53c729d3d9484f8 (diff)
downloadchromium_src-f837da7c7807d4dc84733b201ac74a6bab9ae3a5.zip
chromium_src-f837da7c7807d4dc84733b201ac74a6bab9ae3a5.tar.gz
chromium_src-f837da7c7807d4dc84733b201ac74a6bab9ae3a5.tar.bz2
Reland: Move TouchSelectionController from content to ui
This patch is only moving new unified touch selection files from content/ to ui/touch_selection/. This is the first step to allow Aura use the new unified TouchSelectionController. The only change to TouchSelectionController needed for this move is replacing use of cc::ViewportSelectionBound with ui::SelectionBound. The actual use of the new touch selection for Aura will happen in future CL(s). After that, we can remove current touch selection code from ui/base/touch/. BUG=399721 Committed: https://crrev.com/29fd405ca491a6fcf0dde6277d92d44300cb2926 Cr-Commit-Position: refs/heads/master@{#307336} Review URL: https://codereview.chromium.org/759433002 Cr-Commit-Position: refs/heads/master@{#307514}
Diffstat (limited to 'ui/views/touchui/touch_selection_controller_impl_unittest.cc')
-rw-r--r--ui/views/touchui/touch_selection_controller_impl_unittest.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index 5d0c693..8f9d8a6 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -46,12 +46,13 @@ const int kMenuCommandCount = 3;
// the same location.
int CompareTextSelectionBounds(const ui::SelectionBound& b1,
const ui::SelectionBound& b2) {
- if ((b1.edge_top.y() < b2.edge_top.y()) || b1.edge_top.x() < b2.edge_top.x())
+ if (b1.edge_top().y() < b2.edge_top().y() ||
+ b1.edge_top().x() < b2.edge_top().x()) {
return -1;
- else if (b1 == b2)
+ }
+ if (b1 == b2)
return 0;
- else
- return 1;
+ return 1;
}
} // namespace
@@ -258,14 +259,14 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
}
if (check_direction) {
if (CompareTextSelectionBounds(anchor, focus) < 0) {
- EXPECT_EQ(ui::SelectionBound::LEFT, anchor.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::RIGHT, focus.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::LEFT, anchor.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::RIGHT, focus.type()) << from_str;
} else if (CompareTextSelectionBounds(anchor, focus) > 0) {
- EXPECT_EQ(ui::SelectionBound::LEFT, focus.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::RIGHT, anchor.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::LEFT, focus.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::RIGHT, anchor.type()) << from_str;
} else {
- EXPECT_EQ(ui::SelectionBound::CENTER, focus.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::CENTER, anchor.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::CENTER, focus.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::CENTER, anchor.type()) << from_str;
}
}
}
@@ -613,9 +614,8 @@ class TestTouchEditable : public ui::TouchEditable {
}
void set_cursor_rect(const gfx::Rect& cursor_rect) {
- cursor_bound_.edge_top = cursor_rect.origin();
- cursor_bound_.edge_bottom = cursor_rect.bottom_left();
- cursor_bound_.type = ui::SelectionBound::Type::CENTER;
+ cursor_bound_.SetEdge(cursor_rect.origin(), cursor_rect.bottom_left());
+ cursor_bound_.set_type(ui::SelectionBound::Type::CENTER);
}
~TestTouchEditable() override {}