diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 19:30:35 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 19:30:35 +0000 |
commit | ce6b543d7d95aec9902d0e4e881b017bdf2b9889 (patch) | |
tree | 122f3b17ae1888b87f6d999688a3b577470ccba7 /ui | |
parent | 5e49f09a97908422258fa8a9426d0b9614a1806d (diff) | |
download | chromium_src-ce6b543d7d95aec9902d0e4e881b017bdf2b9889.zip chromium_src-ce6b543d7d95aec9902d0e4e881b017bdf2b9889.tar.gz chromium_src-ce6b543d7d95aec9902d0e4e881b017bdf2b9889.tar.bz2 |
Revert 118853 because TransformGesture fails on win_aura
"""
aura: Make sure gesture events don't get transformed erroneously.
The touch-event that create gestures already gets transformed for the
RootWindow's layer, so the gesture-event that gets created should not be
transformed again.
BUG=none
TEST=aura_unittests:WindowTest.TransformGesture
Review URL: https://chromiumcodereview.appspot.com/9129025
TBR=sadrul@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9212056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/root_window.cc | 1 | ||||
-rw-r--r-- | ui/aura/window_unittest.cc | 40 |
2 files changed, 1 insertions, 40 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index 6dc9b4c..dd84728 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -245,6 +245,7 @@ bool RootWindow::DispatchTouchEvent(TouchEvent* event) { } bool RootWindow::DispatchGestureEvent(GestureEvent* event) { + event->UpdateForTransform(layer()->transform()); Window* target = gesture_handler_ ? gesture_handler_ : capture_window_; if (!target) target = GetEventHandlerForPoint(event->location()); diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 76a70ca..3ef60ff 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -146,24 +146,6 @@ class CaptureWindowDelegateImpl : public TestWindowDelegate { DISALLOW_COPY_AND_ASSIGN(CaptureWindowDelegateImpl); }; -// Keeps track of the location of the gesture. -class GestureTrackPositionDelegate : public TestWindowDelegate { - public: - GestureTrackPositionDelegate() {} - - virtual ui::GestureStatus OnGestureEvent(GestureEvent* event) OVERRIDE { - position_ = event->location(); - return ui::GESTURE_STATUS_CONSUMED; - } - - const gfx::Point& position() const { return position_; } - - private: - gfx::Point position_; - - DISALLOW_COPY_AND_ASSIGN(GestureTrackPositionDelegate); -}; - } // namespace TEST_F(WindowTest, GetChildById) { @@ -795,28 +777,6 @@ TEST_F(WindowTest, Transform) { gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()).ToString()); } -// Tests that gesture events are transformed correctly. -TEST_F(WindowTest, TransformGesture) { - RootWindow* root_window = RootWindow::GetInstance(); - gfx::Size size = root_window->GetHostSize(); - - scoped_ptr<GestureTrackPositionDelegate> delegate( - new GestureTrackPositionDelegate); - scoped_ptr<Window> window(CreateTestWindowWithDelegate(delegate.get(), -1234, - gfx::Rect(0, 0, 20, 20), NULL)); - - // Rotate the root-window clock-wise 90 degrees. - ui::Transform transform; - transform.SetRotate(90.0f); - transform.ConcatTranslate(size.width(), 0); - root_window->SetTransform(transform); - - TouchEvent press(ui::ET_TOUCH_PRESSED, - gfx::Point(size.height() - 10, 10), 0); - root_window->DispatchTouchEvent(&press); - EXPECT_EQ(gfx::Point(10, 10).ToString(), delegate->position().ToString()); -} - // Various assertions for transient children. TEST_F(WindowTest, TransientChildren) { scoped_ptr<Window> parent(CreateTestWindowWithId(0, NULL)); |