diff options
author | mohsen@chromium.org <mohsen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-28 23:05:58 +0000 |
---|---|---|
committer | mohsen@chromium.org <mohsen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-28 23:05:58 +0000 |
commit | fcd28cd122d13bd2c54934483ec5b6139679e64e (patch) | |
tree | 9e5194bd81d5c07f7b1e4c14b083dc4d3bbe56f0 | |
parent | adac331e5b8422f96ccec8976ddab2fef318b77e (diff) | |
download | chromium_src-fcd28cd122d13bd2c54934483ec5b6139679e64e.zip chromium_src-fcd28cd122d13bd2c54934483ec5b6139679e64e.tar.gz chromium_src-fcd28cd122d13bd2c54934483ec5b6139679e64e.tar.bz2 |
Ignore all non-gesture events in TouchEditableImplAura
Currently, in TouchEditableImplAura, touch events are ignored and all
other non-gesture events deactivate touch editing. Since, this
deactivation is now handled properly in TouchSelectionControllerImpl as
an ENV pre-target handler, we can safely ignore all non-gesture events
in TouchEditableImplAura.
BUG=377596
Review URL: https://codereview.chromium.org/304503010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273388 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/web_contents/touch_editable_impl_aura.cc | 8 | ||||
-rw-r--r-- | content/browser/web_contents/touch_editable_impl_aura_browsertest.cc | 31 |
2 files changed, 5 insertions, 34 deletions
diff --git a/content/browser/web_contents/touch_editable_impl_aura.cc b/content/browser/web_contents/touch_editable_impl_aura.cc index b161773..648d888 100644 --- a/content/browser/web_contents/touch_editable_impl_aura.cc +++ b/content/browser/web_contents/touch_editable_impl_aura.cc @@ -104,6 +104,7 @@ void TouchEditableImplAura::EndTouchEditing(bool quick) { if (touch_selection_controller_->IsHandleDragInProgress()) { touch_selection_controller_->SelectionChanged(); } else { + selection_gesture_in_process_ = false; touch_selection_controller_->HideHandles(quick); touch_selection_controller_.reset(); } @@ -135,12 +136,9 @@ void TouchEditableImplAura::OnTextInputTypeChanged(ui::TextInputType type) { bool TouchEditableImplAura::HandleInputEvent(const ui::Event* event) { DCHECK(rwhva_); - if (event->IsTouchEvent()) - return false; - if (!event->IsGestureEvent()) { - selection_gesture_in_process_ = false; - EndTouchEditing(false); + // Ignore all non-gesture events. Non-gesture events that can deactivate + // touch editing are handled in TouchSelectionControllerImpl. return false; } diff --git a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc index 0479984..ce1f602 100644 --- a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc +++ b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc @@ -91,31 +91,6 @@ class TestTouchEditableImplAura : public TouchEditableImplAura { DISALLOW_COPY_AND_ASSIGN(TestTouchEditableImplAura); }; -// This class ignores mouse-moved, mouse-entered and mouse-exited events -// without passing them to TouchEditableImplAura. Normally, we should not -// receive these events; but, sometimes we receive them which breaks the tests -// and makes them flaky: crbug.com/276992. -class TestTouchEditableImplAuraIgnoreMouseMovement - : public TestTouchEditableImplAura { - public: - TestTouchEditableImplAuraIgnoreMouseMovement() {} - - virtual bool HandleInputEvent(const ui::Event* event) OVERRIDE { - if (event->type() == ui::ET_MOUSE_ENTERED || - event->type() == ui::ET_MOUSE_MOVED || - event->type() == ui::ET_MOUSE_EXITED) { - return false; - } - return TestTouchEditableImplAura::HandleInputEvent(event); - } - - protected: - virtual ~TestTouchEditableImplAuraIgnoreMouseMovement() {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestTouchEditableImplAuraIgnoreMouseMovement); -}; - class TouchEditableImplAuraTest : public ContentBrowserTest { public: TouchEditableImplAuraTest() {} @@ -169,8 +144,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, RenderFrameHost* main_frame = web_contents->GetMainFrame(); WebContentsViewAura* view_aura = static_cast<WebContentsViewAura*>( web_contents->GetView()); - TestTouchEditableImplAura* touch_editable = - new TestTouchEditableImplAuraIgnoreMouseMovement; + TestTouchEditableImplAura* touch_editable = new TestTouchEditableImplAura; view_aura->SetTouchEditableForTest(touch_editable); RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( web_contents->GetRenderWidgetHostView()); @@ -355,8 +329,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, RenderFrameHost* main_frame = web_contents->GetMainFrame(); WebContentsViewAura* view_aura = static_cast<WebContentsViewAura*>( web_contents->GetView()); - TestTouchEditableImplAura* touch_editable = - new TestTouchEditableImplAuraIgnoreMouseMovement; + TestTouchEditableImplAura* touch_editable = new TestTouchEditableImplAura; view_aura->SetTouchEditableForTest(touch_editable); RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( web_contents->GetRenderWidgetHostView()); |