Commit 62f932ad authored by r.ghatage@samsung.com's avatar r.ghatage@samsung.com

Do not hide the selection handles on tap event

Currently selection handles are being hidden on tap event. But in case
of tapping on image, the selection doesnt get cleared and we dont
receive any bounds changed message from blink, hence selection stays
but the handles are hidden. Hiding the handles on tap event is not
necessary as it is already handled when the selection bounds change

BUG=404625

Review URL: https://codereview.chromium.org/482723002

Cr-Commit-Position: refs/heads/master@{#290814}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290814 0039d316-1c4b-4281-b951-d872f2087c98
parent 3b2dba9f
......@@ -137,8 +137,6 @@ void TouchSelectionController::OnLongPressEvent() {
void TouchSelectionController::OnTapEvent() {
response_pending_input_event_ = TAP;
activate_selection_automatically_ = false;
DeactivateSelection();
ShowInsertionHandleAutomatically();
if (selection_empty_)
DeactivateInsertion();
......
......@@ -652,4 +652,23 @@ TEST_F(TouchSelectionControllerTest, TemporarilyHidden) {
EXPECT_TRUE(GetAndResetNeedsAnimate());
}
TEST_F(TouchSelectionControllerTest, SelectionClearOnTap) {
gfx::RectF start_rect(5, 5, 0, 10);
gfx::RectF end_rect(50, 5, 0, 10);
bool visible = true;
controller().OnLongPressEvent();
ChangeSelection(start_rect, visible, end_rect, visible);
// Selection should not be cleared if the selection bounds have not changed.
controller().OnTapEvent();
EXPECT_EQ(SELECTION_SHOWN, GetLastEventType());
EXPECT_EQ(start_rect.bottom_left(), GetLastEventAnchor());
controller().OnTapEvent();
ClearSelection();
EXPECT_EQ(SELECTION_CLEARED, GetLastEventType());
EXPECT_EQ(gfx::PointF(), GetLastEventAnchor());
}
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment