diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 16:38:23 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 16:38:23 +0000 |
commit | 590a634e603055831bc0aa75480cfa917c8420c1 (patch) | |
tree | 49e7e7f7edea31fd95d22511aa28a08e51b02931 /ui | |
parent | 7175fb1aa0ce9af46b557a8e59930f244df4cdb2 (diff) | |
download | chromium_src-590a634e603055831bc0aa75480cfa917c8420c1.zip chromium_src-590a634e603055831bc0aa75480cfa917c8420c1.tar.gz chromium_src-590a634e603055831bc0aa75480cfa917c8420c1.tar.bz2 |
instant: Fix crash from gesture events on instant preview.
The main changes include:
* Rename WebContentsDelegate::HandleMouseActivate to HandlePointerEventActivate
so that it can be used for both mouse and touch events.
* Rename RenderWidgetHostImpl::OnMouseActivate to OnPointerEventActivate.
* Add HandleGestureBegin/HandleGestureEnd to RenderViewHostDelegate and
WebContentsDelegate.
* Process both mouse-press and gesture-begin events in
RenderWidgetHostViewAura::ShouldActivate.
* Activate an aura window from a BEGIN gesture-event instead of a PRESS
touch-event.
BUG=136961
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10810003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/shared/compound_event_filter.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc index d3d0993..f32d480 100644 --- a/ui/aura/shared/compound_event_filter.cc +++ b/ui/aura/shared/compound_event_filter.cc @@ -125,17 +125,7 @@ bool CompoundEventFilter::PreHandleMouseEvent(aura::Window* target, ui::TouchStatus CompoundEventFilter::PreHandleTouchEvent( aura::Window* target, aura::TouchEvent* event) { - ui::TouchStatus status = FilterTouchEvent(target, event); - if (status != ui::TOUCH_STATUS_UNKNOWN) - return status; - - if (event->type() == ui::ET_TOUCH_PRESSED) { - SetVisibilityOnEvent(event, false); - target->GetFocusManager()->SetFocusedWindow( - FindFocusableWindowFor(target), event); - } - - return ui::TOUCH_STATUS_UNKNOWN; + return FilterTouchEvent(target, event); } ui::GestureStatus CompoundEventFilter::PreHandleGestureEvent( @@ -150,6 +140,16 @@ ui::GestureStatus CompoundEventFilter::PreHandleGestureEvent( status = filter->PreHandleGestureEvent(target, event); } } + + if (event->type() == ui::ET_GESTURE_BEGIN && + event->details().touch_points() == 1 && + target->GetRootWindow() && + GetActiveWindow(target) != target) { + SetVisibilityOnEvent(event, false); + target->GetFocusManager()->SetFocusedWindow( + FindFocusableWindowFor(target), event); + } + return status; } |