diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 01:41:51 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 01:41:51 +0000 |
commit | 8520ebd2d0fad750b0841f4d8dae1e517f0c400f (patch) | |
tree | 0d95131d2dd9ee39aa931034484e0a89797d591b /ui/aura | |
parent | f0c4809951a377e88d6b0c19a97cd50dab5d1f10 (diff) | |
download | chromium_src-8520ebd2d0fad750b0841f4d8dae1e517f0c400f.zip chromium_src-8520ebd2d0fad750b0841f4d8dae1e517f0c400f.tar.gz chromium_src-8520ebd2d0fad750b0841f4d8dae1e517f0c400f.tar.bz2 |
Revert 236048 "Rename RootWindowHost* to WindowTreeHost*"
> Rename RootWindowHost* to WindowTreeHost*
>
> TBR=sky@chromium.org
> http://crbug.com/308843
>
> Review URL: https://codereview.chromium.org/76583003
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/77203002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/env.h | 2 | ||||
-rw-r--r-- | ui/aura/gestures/gesture_recognizer_unittest.cc | 336 | ||||
-rw-r--r-- | ui/aura/remote_root_window_host_win.cc | 140 | ||||
-rw-r--r-- | ui/aura/remote_root_window_host_win.h | 20 | ||||
-rw-r--r-- | ui/aura/root_window.cc | 18 | ||||
-rw-r--r-- | ui/aura/root_window.h | 28 | ||||
-rw-r--r-- | ui/aura/root_window_host_ozone.cc | 54 | ||||
-rw-r--r-- | ui/aura/root_window_host_ozone.h | 10 | ||||
-rw-r--r-- | ui/aura/root_window_host_win.cc | 68 | ||||
-rw-r--r-- | ui/aura/root_window_host_win.h | 14 | ||||
-rw-r--r-- | ui/aura/root_window_host_x11.cc | 82 | ||||
-rw-r--r-- | ui/aura/root_window_host_x11.h | 14 | ||||
-rw-r--r-- | ui/aura/root_window_host_x11_unittest.cc | 46 | ||||
-rw-r--r-- | ui/aura/root_window_observer.h | 6 | ||||
-rw-r--r-- | ui/aura/root_window_unittest.cc | 74 | ||||
-rw-r--r-- | ui/aura/test/event_generator.cc | 4 | ||||
-rw-r--r-- | ui/aura/test/event_generator.h | 2 | ||||
-rw-r--r-- | ui/aura/test/test_screen.cc | 2 | ||||
-rw-r--r-- | ui/aura/window_tree_host.cc | 38 | ||||
-rw-r--r-- | ui/aura/window_tree_host.h | 26 | ||||
-rw-r--r-- | ui/aura/window_tree_host_delegate.h | 6 | ||||
-rw-r--r-- | ui/aura/window_unittest.cc | 38 |
22 files changed, 514 insertions, 514 deletions
diff --git a/ui/aura/env.h b/ui/aura/env.h index 035f8274..ec52005 100644 --- a/ui/aura/env.h +++ b/ui/aura/env.h @@ -79,7 +79,7 @@ class AURA_EXPORT Env : public ui::EventTarget { private: friend class test::EnvTestHelper; friend class Window; - friend class WindowTreeHost; + friend class RootWindowHost; void Init(); diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index 09e40ad..7fb6c60 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -574,7 +574,7 @@ class TimedEvents { ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), touch_id, base::TimeDelta::FromMilliseconds(simulated_now_)); - root_window->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); simulated_now_ += time_step; } } @@ -588,7 +588,7 @@ class TimedEvents { ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), touch_id, base::TimeDelta::FromMilliseconds(simulated_now_)); - root_window->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); simulated_now_++; } }; @@ -699,7 +699,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->show_press()); EXPECT_TRUE(delegate->tap_down()); @@ -721,7 +721,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -754,7 +754,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.Now()); press.set_radius_x(5); press.set_radius_y(12); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -772,7 +772,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { release.set_radius_x(5); release.set_radius_y(12); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -797,7 +797,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.Now()); press.set_radius_x(8); press.set_radius_y(14); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -813,7 +813,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { release.set_radius_x(20); release.set_radius_y(13); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -838,7 +838,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.Now()); press.set_radius_x(6); press.set_radius_y(10); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -854,7 +854,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.LeapForward(50)); move.set_radius_x(8); move.set_radius_y(12); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -870,7 +870,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { release.set_radius_x(4); release.set_radius_y(8); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -895,7 +895,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.Now()); press.set_radius_x(7); press.set_radius_y(10); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -910,7 +910,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.LeapForward(50)); move.set_radius_x(13); move.set_radius_y(12); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -925,7 +925,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.LeapForward(50)); move1.set_radius_x(16); move1.set_radius_y(16); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -940,7 +940,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { kTouchId, tes.LeapForward(50)); move2.set_radius_x(14); move2.set_radius_y(10); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -956,7 +956,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) { release.set_radius_x(8); release.set_radius_y(9); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -990,7 +990,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN); @@ -1031,7 +1031,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_2_EVENTS(delegate->events(), ui::ET_SCROLL_FLING_START, ui::ET_GESTURE_END); @@ -1058,7 +1058,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { gfx::Vector2dF total_scroll; ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN); @@ -1108,7 +1108,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); } // Check that the bounding box during a scroll event is correct. @@ -1132,7 +1132,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { gfx::Point(kPositionX, kPositionY), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_EQ(gfx::Rect(kPositionX - radius, kPositionY - radius, radius * 2, @@ -1157,7 +1157,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollBoundingBox) { kPositionY + kScrollAmount), kTouchId, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_EQ(gfx::Rect(kPositionX + kScrollAmount - radius, kPositionY + kScrollAmount - radius, radius * 2, @@ -1180,7 +1180,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Move the touch-point horizontally enough that it is considered a // horizontal scroll. @@ -1203,7 +1203,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->fling()); EXPECT_FALSE(delegate->scroll_end()); @@ -1224,7 +1224,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Move the touch-point vertically enough that it is considered a // vertical scroll. @@ -1247,7 +1247,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->fling()); EXPECT_FALSE(delegate->scroll_end()); @@ -1268,7 +1268,7 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Move the touch-point such that a non-rail scroll begins tes.SendScrollEvent(dispatcher(), 20, 20, kTouchId, delegate.get()); @@ -1283,7 +1283,7 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->fling()); EXPECT_FALSE(delegate->scroll_end()); @@ -1312,7 +1312,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->begin()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1329,7 +1329,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); // Note the tap down isn't cancelled until the release @@ -1361,7 +1361,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a long press to occur @@ -1378,7 +1378,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(10)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); EXPECT_FALSE(delegate->tap_cancel()); } @@ -1404,7 +1404,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongTap) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->begin()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1421,7 +1421,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongTap) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); EXPECT_TRUE(delegate->long_tap()); @@ -1454,7 +1454,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->begin()); @@ -1465,7 +1465,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. EXPECT_TRUE(delegate->tap_cancel()); EXPECT_TRUE(delegate->begin()); @@ -1479,7 +1479,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); EXPECT_TRUE(delegate->two_finger_tap()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1498,7 +1498,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Move the touch-point horizontally enough that it is considered a // horizontal scroll. @@ -1545,7 +1545,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Move the touch-point vertically enough that it is considered a // vertical scroll. @@ -1593,7 +1593,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1606,7 +1606,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1619,7 +1619,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.LeapForward(1000)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1634,7 +1634,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_TRUE(delegate->tap_cancel()); @@ -1648,7 +1648,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1661,7 +1661,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1675,7 +1675,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1702,7 +1702,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { queued_delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(queued_delegate->tap()); EXPECT_FALSE(queued_delegate->tap_down()); EXPECT_FALSE(queued_delegate->tap_cancel()); @@ -1717,7 +1717,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, press.time_stamp() + base::TimeDelta::FromMilliseconds(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(queued_delegate->tap()); EXPECT_FALSE(queued_delegate->tap_down()); EXPECT_FALSE(queued_delegate->tap_cancel()); @@ -1736,7 +1736,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), kTouchId2, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1748,7 +1748,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), kTouchId2, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); // Process the first queued event. queued_delegate->Reset(); @@ -1779,7 +1779,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { queued_delegate->Reset(); ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); EXPECT_FALSE(queued_delegate->tap()); EXPECT_FALSE(queued_delegate->tap_down()); EXPECT_FALSE(queued_delegate->tap_cancel()); @@ -1795,7 +1795,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { delegate->Reset(); ui::TouchEvent press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), kTouchId2, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press4); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press4); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1820,7 +1820,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) { int x_move = ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203), kTouchId2, GetTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -1894,7 +1894,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN); @@ -1904,7 +1904,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_3_EVENTS(delegate->events(), ui::ET_GESTURE_TAP_CANCEL, ui::ET_GESTURE_SCROLL_BEGIN, @@ -1915,7 +1915,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_PINCH_BEGIN); @@ -1926,7 +1926,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move3); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_UPDATE, ui::ET_GESTURE_SCROLL_UPDATE); @@ -1937,7 +1937,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move4); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_UPDATE, ui::ET_GESTURE_SCROLL_UPDATE); @@ -1948,7 +1948,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_END, ui::ET_GESTURE_END); @@ -1959,7 +1959,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) { delegate->Reset(); ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move5); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); EXPECT_TRUE(delegate->bounding_box().IsEmpty()); } @@ -1978,11 +1978,11 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->pinch_begin()); // Touch move triggers pinch begin. @@ -1999,7 +1999,7 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_TRUE(delegate->pinch_end()); tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId2, delegate.get()); @@ -2009,12 +2009,12 @@ scoped_ptr<GestureEventConsumeDelegate> delegate( delegate->Reset(); ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); // Now the touch points are close. So we will go into two finger tap. // Move the touch-point enough to break two-finger-tap and enter pinch. ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_TRUE(delegate->pinch_begin()); tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); @@ -2038,7 +2038,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN); @@ -2048,7 +2048,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_TAP_CANCEL, ui::ET_GESTURE_BEGIN); @@ -2059,7 +2059,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201), kTouchId1, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move3); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_BEGIN, ui::ET_GESTURE_SCROLL_BEGIN); @@ -2070,7 +2070,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move4); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_UPDATE, ui::ET_GESTURE_SCROLL_UPDATE); @@ -2081,7 +2081,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.LeapForward(10)); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_PINCH_END, ui::ET_GESTURE_END); @@ -2092,7 +2092,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) { delegate->Reset(); ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), kTouchId2, tes.Now()); - root->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move5); + root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE); EXPECT_TRUE(delegate->bounding_box().IsEmpty()); } @@ -2104,7 +2104,7 @@ TEST_F(GestureRecognizerTest, GestureEventIgnoresDisconnectedEvents) { ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), 6, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); } @@ -2142,7 +2142,7 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { windows[i]->set_id(i); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i].origin(), i, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); } // Touches should now be associated with the closest touch within @@ -2159,10 +2159,10 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { // Add a touch in the middle associated with windows[2] ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500), kNumWindows, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250), kNumWindows, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250)); EXPECT_EQ("2", WindowIDAsString(target)); @@ -2183,7 +2183,7 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { // Move a touch associated with windows[2] to 1000, 1000 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000), kNumWindows, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000)); EXPECT_EQ("2", WindowIDAsString(target)); @@ -2214,11 +2214,11 @@ TEST_F(GestureRecognizerTest, GestureEventOutsideRootWindowTap) { gfx::Point pos1(-10, -10); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, pos1, 0, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); gfx::Point pos2(1000, 1000); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, pos2, 1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // As these presses were outside the root window, they should be // associated with the root window. @@ -2239,10 +2239,10 @@ TEST_F(GestureRecognizerTest, NoTapWithPreventDefaultedRelease) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); delegate->Reset(); delegate->ReceivedAck(); @@ -2272,9 +2272,9 @@ TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) { tes.LeapForward(200)); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(15, 25), kTouchId1, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); delegate->Reset(); // Ack the press event. @@ -2308,12 +2308,12 @@ TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) { tes.LeapForward(14)); // Do a pinch. - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); // Ack the press and move events. delegate->Reset(); @@ -2442,14 +2442,14 @@ TEST_F(GestureRecognizerTest, PressDoesNotCrash) { ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(45, 45), 7, tes.Now()); press.set_radius_x(40); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_TRUE(delegate->tap_down()); EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), delegate->bounding_box().ToString()); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // This new press should not generate a tap-down. EXPECT_FALSE(delegate->begin()); @@ -2473,7 +2473,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2486,7 +2486,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. EXPECT_TRUE(delegate->tap_cancel()); @@ -2500,10 +2500,10 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { delegate->Reset(); ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2519,7 +2519,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2535,7 +2535,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) { ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2561,19 +2561,19 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); // Send release event after sufficient delay so that two finger time expires. delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.LeapForward(1000)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->two_finger_tap()); // Lift second finger. @@ -2583,7 +2583,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) { ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_FALSE(delegate->two_finger_tap()); } @@ -2605,12 +2605,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); EXPECT_FALSE(delegate->two_finger_tap()); @@ -2622,7 +2622,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->two_finger_tap()); EXPECT_TRUE(delegate->pinch_end()); } @@ -2636,12 +2636,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); tes.SendScrollEvent(dispatcher(), 101, 230, kTouchId2, delegate.get()); EXPECT_FALSE(delegate->two_finger_tap()); @@ -2653,7 +2653,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->two_finger_tap()); EXPECT_TRUE(delegate->pinch_end()); } @@ -2675,13 +2675,13 @@ TEST_F(GestureRecognizerTest, NoTwoFingerTapWhenFirstFingerHasScrolled) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId1, delegate.get()); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_TRUE(delegate->pinch_begin()); @@ -2691,7 +2691,7 @@ TEST_F(GestureRecognizerTest, NoTwoFingerTapWhenFirstFingerHasScrolled) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->two_finger_tap()); EXPECT_TRUE(delegate->pinch_end()); } @@ -2754,17 +2754,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); delegate->Reset(); ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&cancel); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); EXPECT_FALSE(delegate->two_finger_tap()); // Make sure there is enough delay before the touch is released so that it @@ -2773,7 +2773,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->two_finger_tap()); } @@ -2786,17 +2786,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); delegate->Reset(); ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&cancel); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); EXPECT_FALSE(delegate->two_finger_tap()); // Make sure there is enough delay before the touch is released so that it @@ -2805,7 +2805,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) { ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId1, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->two_finger_tap()); } } @@ -2825,7 +2825,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2838,7 +2838,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) { delegate->Reset(); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. EXPECT_TRUE(delegate->tap_cancel()); @@ -2852,7 +2852,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) { delegate->Reset(); ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(530, 301), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2879,10 +2879,10 @@ TEST_F(GestureRecognizerTest, FlushAllOnHide) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); window->Hide(); EXPECT_EQ(NULL, ui::GestureRecognizer::Get()->GetTouchLockedTarget(&press1)); @@ -2911,7 +2911,7 @@ TEST_F(GestureRecognizerTest, LongPressTimerStopsOnPreventDefaultedTouchMoves) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // Scroll around, to cancel the long press tes.SendScrollEvent(dispatcher(), 130, 230, kTouchId, delegate.get()); @@ -2964,7 +2964,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -2990,7 +2990,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(130, 230), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3018,7 +3018,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { delegate->Reset(); ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); tes.SendScrollEvent(dispatcher(), 131, 231, kTouchId1, delegate.get()); // First finger touches down and moves. @@ -3031,7 +3031,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { // Second finger touches down and moves. ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), kTouchId2, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); tes.SendScrollEvent(dispatcher(), 161, 231, kTouchId2, delegate.get()); // PinchBegin & ScrollBegin were not sent if the touch-move events were @@ -3088,8 +3088,8 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) { kTouchId1, tes.Now()); ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), kTouchId2, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_FALSE(delegate->tap()); // Touch release is not consumed, so we still see two finger tap. @@ -3122,7 +3122,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { delegate->Reset(); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3189,7 +3189,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) { delegate->Reset(); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_down()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3216,19 +3216,19 @@ TEST_F(GestureRecognizerTest, GestureEventDoubleTap) { // First tap (tested in GestureEventTap) ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), kTouchId, tes.LeapForward(200)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_TRUE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); @@ -3257,10 +3257,10 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) { // First tap (tested in GestureEventTap) ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_EQ(1, delegate->tap_count()); delegate->Reset(); @@ -3268,10 +3268,10 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) { // Second tap (tested in GestureEventDoubleTap) ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), kTouchId, tes.LeapForward(200)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_EQ(2, delegate->tap_count()); delegate->Reset(); @@ -3279,10 +3279,10 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) { // Third tap ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(102, 206), kTouchId, tes.LeapForward(200)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); ui::TouchEvent release3(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release3); EXPECT_TRUE(delegate->tap()); @@ -3312,19 +3312,19 @@ TEST_F(GestureRecognizerTest, TwoTapsFarApart) { // First tap (tested in GestureEventTap) ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap, close in time but far in distance ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId, tes.LeapForward(200)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_TRUE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); @@ -3354,19 +3354,19 @@ TEST_F(GestureRecognizerTest, TwoTapsWithDelayBetween) { // First tap (tested in GestureEventTap) ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); delegate->Reset(); // Second tap, close in distance but after some delay ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.LeapForward(2000)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); EXPECT_TRUE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); @@ -3396,7 +3396,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { ui::TouchEvent press1( ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->bounding_box().IsEmpty()); delegate->Reset(); @@ -3405,7 +3405,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId2, tes.LeapForward(400)); press2.set_radius_x(5); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_FALSE(delegate->pinch_begin()); EXPECT_EQ(gfx::Rect(101, 201, 100, 0).ToString(), delegate->bounding_box().ToString()); @@ -3414,7 +3414,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(141, 201), kTouchId, tes.LeapForward(40)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_TRUE(delegate->pinch_begin()); EXPECT_EQ(gfx::Rect(141, 201, 60, 0).ToString(), delegate->bounding_box().ToString()); @@ -3426,7 +3426,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) { tes.LeapForward(40)); move2.set_radius_x(50); move2.set_radius_y(60); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_FALSE(delegate->tap()); EXPECT_FALSE(delegate->tap_cancel()); EXPECT_FALSE(delegate->scroll_update()); @@ -3452,21 +3452,21 @@ TEST_F(GestureRecognizerTest, NoDriftInScroll) { ui::TouchEvent press1( ui::ET_TOUCH_PRESSED, gfx::Point(101, 208), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->begin()); delegate->Reset(); ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(101, 206), kTouchId, tes.LeapForward(40)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); EXPECT_FALSE(delegate->scroll_begin()); delegate->Reset(); ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 204), kTouchId, tes.LeapForward(40)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_TRUE(delegate->tap_cancel()); EXPECT_TRUE(delegate->scroll_begin()); EXPECT_TRUE(delegate->scroll_update()); @@ -3476,14 +3476,14 @@ TEST_F(GestureRecognizerTest, NoDriftInScroll) { ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(101, 204), kTouchId, tes.LeapForward(40)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); EXPECT_FALSE(delegate->scroll_update()); delegate->Reset(); ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(101, 203), kTouchId, tes.LeapForward(40)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move4); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); EXPECT_TRUE(delegate->scroll_update()); EXPECT_EQ(-1, delegate->scroll_y()); @@ -3507,7 +3507,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveCanFireTapCancel) { kTouchId, tes.Now()); delegate->set_consume_touch_move(false); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); delegate->set_consume_touch_move(true); delegate->Reset(); // Move the touch-point enough so that it would normally be considered a @@ -3544,8 +3544,8 @@ TEST_F(GestureRecognizerTest, ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 1, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&p2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p2); EXPECT_FALSE(delegate->tap()); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->tap_cancel()); @@ -3586,7 +3586,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPress) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); EXPECT_TRUE(delegate->begin()); EXPECT_FALSE(delegate->tap_cancel()); @@ -3602,7 +3602,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPress) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->long_press()); // Note the tap down isn't cancelled until the release @@ -3634,7 +3634,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressCancelledByScroll) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a show press to occur @@ -3651,7 +3651,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressCancelledByScroll) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(10)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_FALSE(delegate->show_press()); EXPECT_FALSE(delegate->tap_cancel()); } @@ -3672,7 +3672,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressSentOnTap) { ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); EXPECT_TRUE(delegate->tap_down()); // We haven't pressed long enough for a show press to occur @@ -3682,7 +3682,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressSentOnTap) { delegate->Reset(); ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId, tes.LeapForward(50)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); EXPECT_TRUE(delegate->show_press()); EXPECT_FALSE(delegate->tap_cancel()); EXPECT_TRUE(delegate->tap()); diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc index 0c28bca..9043e0a 100644 --- a/ui/aura/remote_root_window_host_win.cc +++ b/ui/aura/remote_root_window_host_win.cc @@ -24,7 +24,7 @@ namespace aura { namespace { -const char* kWindowTreeHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; +const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; // Sets the keystate for the virtual key passed in to down or up. void SetKeyState(uint8* key_states, bool key_down, uint32 virtual_key_code) { @@ -61,8 +61,8 @@ void HandleOpenFile(const base::string16& title, const base::string16& filter, const OpenFileCompletion& on_success, const FileSelectionCanceled& on_failure) { - DCHECK(aura::RemoteWindowTreeHostWin::Instance()); - aura::RemoteWindowTreeHostWin::Instance()->HandleOpenFile(title, + DCHECK(aura::RemoteRootWindowHostWin::Instance()); + aura::RemoteRootWindowHostWin::Instance()->HandleOpenFile(title, default_path, filter, on_success, @@ -74,8 +74,8 @@ void HandleOpenMultipleFiles(const base::string16& title, const base::string16& filter, const OpenMultipleFilesCompletion& on_success, const FileSelectionCanceled& on_failure) { - DCHECK(aura::RemoteWindowTreeHostWin::Instance()); - aura::RemoteWindowTreeHostWin::Instance()->HandleOpenMultipleFiles( + DCHECK(aura::RemoteRootWindowHostWin::Instance()); + aura::RemoteRootWindowHostWin::Instance()->HandleOpenMultipleFiles( title, default_path, filter, @@ -90,8 +90,8 @@ void HandleSaveFile(const base::string16& title, const base::string16& default_extension, const SaveFileCompletion& on_success, const FileSelectionCanceled& on_failure) { - DCHECK(aura::RemoteWindowTreeHostWin::Instance()); - aura::RemoteWindowTreeHostWin::Instance()->HandleSaveFile(title, + DCHECK(aura::RemoteRootWindowHostWin::Instance()); + aura::RemoteRootWindowHostWin::Instance()->HandleSaveFile(title, default_path, filter, filter_index, @@ -103,62 +103,62 @@ void HandleSaveFile(const base::string16& title, void HandleSelectFolder(const base::string16& title, const SelectFolderCompletion& on_success, const FileSelectionCanceled& on_failure) { - DCHECK(aura::RemoteWindowTreeHostWin::Instance()); - aura::RemoteWindowTreeHostWin::Instance()->HandleSelectFolder(title, + DCHECK(aura::RemoteRootWindowHostWin::Instance()); + aura::RemoteRootWindowHostWin::Instance()->HandleSelectFolder(title, on_success, on_failure); } void HandleActivateDesktop(const base::FilePath& shortcut, const ActivateDesktopCompleted& on_success) { - DCHECK(aura::RemoteWindowTreeHostWin::Instance()); - aura::RemoteWindowTreeHostWin::Instance()->HandleActivateDesktop(shortcut, + DCHECK(aura::RemoteRootWindowHostWin::Instance()); + aura::RemoteRootWindowHostWin::Instance()->HandleActivateDesktop(shortcut, on_success); } -RemoteWindowTreeHostWin* g_instance = NULL; +RemoteRootWindowHostWin* g_instance = NULL; -RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { +RemoteRootWindowHostWin* RemoteRootWindowHostWin::Instance() { if (g_instance) return g_instance; return Create(gfx::Rect()); } -RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Create( +RemoteRootWindowHostWin* RemoteRootWindowHostWin::Create( const gfx::Rect& bounds) { - g_instance = g_instance ? g_instance : new RemoteWindowTreeHostWin(bounds); + g_instance = g_instance ? g_instance : new RemoteRootWindowHostWin(bounds); return g_instance; } -RemoteWindowTreeHostWin::RemoteWindowTreeHostWin(const gfx::Rect& bounds) +RemoteRootWindowHostWin::RemoteRootWindowHostWin(const gfx::Rect& bounds) : remote_window_(NULL), host_(NULL), ignore_mouse_moves_until_set_cursor_ack_(false), event_flags_(0) { - prop_.reset(new ui::ViewProp(NULL, kWindowTreeHostWinKey, this)); + prop_.reset(new ui::ViewProp(NULL, kRootWindowHostWinKey, this)); CreateCompositor(GetAcceleratedWidget()); } -RemoteWindowTreeHostWin::~RemoteWindowTreeHostWin() { +RemoteRootWindowHostWin::~RemoteRootWindowHostWin() { g_instance = NULL; } -void RemoteWindowTreeHostWin::Connected(IPC::Sender* host, HWND remote_window) { +void RemoteRootWindowHostWin::Connected(IPC::Sender* host, HWND remote_window) { CHECK(host_ == NULL); host_ = host; remote_window_ = remote_window; } -void RemoteWindowTreeHostWin::Disconnected() { +void RemoteRootWindowHostWin::Disconnected() { // Don't CHECK here, Disconnected is called on a channel error which can // happen before we're successfully Connected. host_ = NULL; remote_window_ = NULL; } -bool RemoteWindowTreeHostWin::OnMessageReceived(const IPC::Message& message) { +bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { bool handled = true; - IPC_BEGIN_MESSAGE_MAP(RemoteWindowTreeHostWin, message) + IPC_BEGIN_MESSAGE_MAP(RemoteRootWindowHostWin, message) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) @@ -191,7 +191,7 @@ bool RemoteWindowTreeHostWin::OnMessageReceived(const IPC::Message& message) { return handled; } -void RemoteWindowTreeHostWin::HandleOpenURLOnDesktop( +void RemoteRootWindowHostWin::HandleOpenURLOnDesktop( const base::FilePath& shortcut, const base::string16& url) { if (!host_) @@ -199,7 +199,7 @@ void RemoteWindowTreeHostWin::HandleOpenURLOnDesktop( host_->Send(new MetroViewerHostMsg_OpenURLOnDesktop(shortcut, url)); } -void RemoteWindowTreeHostWin::HandleActivateDesktop( +void RemoteRootWindowHostWin::HandleActivateDesktop( const base::FilePath& shortcut, const ActivateDesktopCompleted& on_success) { if (!host_) @@ -209,7 +209,7 @@ void RemoteWindowTreeHostWin::HandleActivateDesktop( host_->Send(new MetroViewerHostMsg_ActivateDesktop(shortcut)); } -void RemoteWindowTreeHostWin::HandleOpenFile( +void RemoteRootWindowHostWin::HandleOpenFile( const base::string16& title, const base::FilePath& default_path, const base::string16& filter, @@ -231,7 +231,7 @@ void RemoteWindowTreeHostWin::HandleOpenFile( false)); } -void RemoteWindowTreeHostWin::HandleOpenMultipleFiles( +void RemoteRootWindowHostWin::HandleOpenMultipleFiles( const base::string16& title, const base::FilePath& default_path, const base::string16& filter, @@ -252,7 +252,7 @@ void RemoteWindowTreeHostWin::HandleOpenMultipleFiles( true)); } -void RemoteWindowTreeHostWin::HandleSaveFile( +void RemoteRootWindowHostWin::HandleSaveFile( const base::string16& title, const base::FilePath& default_path, const base::string16& filter, @@ -279,7 +279,7 @@ void RemoteWindowTreeHostWin::HandleSaveFile( host_->Send(new MetroViewerHostMsg_DisplayFileSaveAs(params)); } -void RemoteWindowTreeHostWin::HandleSelectFolder( +void RemoteRootWindowHostWin::HandleSelectFolder( const base::string16& title, const SelectFolderCompletion& on_success, const FileSelectionCanceled& on_failure) { @@ -295,69 +295,69 @@ void RemoteWindowTreeHostWin::HandleSelectFolder( host_->Send(new MetroViewerHostMsg_DisplaySelectFolder(title)); } -bool RemoteWindowTreeHostWin::IsForegroundWindow() { +bool RemoteRootWindowHostWin::IsForegroundWindow() { return ::GetForegroundWindow() == remote_window_; } -Window* RemoteWindowTreeHostWin::GetAshWindow() { +Window* RemoteRootWindowHostWin::GetAshWindow() { return GetRootWindow()->window(); } -RootWindow* RemoteWindowTreeHostWin::GetRootWindow() { +RootWindow* RemoteRootWindowHostWin::GetRootWindow() { return delegate_->AsRootWindow(); } -gfx::AcceleratedWidget RemoteWindowTreeHostWin::GetAcceleratedWidget() { +gfx::AcceleratedWidget RemoteRootWindowHostWin::GetAcceleratedWidget() { if (remote_window_) return remote_window_; // Getting here should only happen for ash_unittests.exe and related code. return ::GetDesktopWindow(); } -void RemoteWindowTreeHostWin::Show() { +void RemoteRootWindowHostWin::Show() { } -void RemoteWindowTreeHostWin::Hide() { +void RemoteRootWindowHostWin::Hide() { NOTIMPLEMENTED(); } -void RemoteWindowTreeHostWin::ToggleFullScreen() { +void RemoteRootWindowHostWin::ToggleFullScreen() { } -gfx::Rect RemoteWindowTreeHostWin::GetBounds() const { - gfx::Rect r(gfx::Point(0, 0), aura::WindowTreeHost::GetNativeScreenSize()); +gfx::Rect RemoteRootWindowHostWin::GetBounds() const { + gfx::Rect r(gfx::Point(0, 0), aura::RootWindowHost::GetNativeScreenSize()); return r; } -void RemoteWindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { +void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { NotifyHostResized(bounds.size()); } -gfx::Insets RemoteWindowTreeHostWin::GetInsets() const { +gfx::Insets RemoteRootWindowHostWin::GetInsets() const { return gfx::Insets(); } -void RemoteWindowTreeHostWin::SetInsets(const gfx::Insets& insets) { +void RemoteRootWindowHostWin::SetInsets(const gfx::Insets& insets) { } -gfx::Point RemoteWindowTreeHostWin::GetLocationOnNativeScreen() const { +gfx::Point RemoteRootWindowHostWin::GetLocationOnNativeScreen() const { return gfx::Point(0, 0); } -void RemoteWindowTreeHostWin::SetCursor(gfx::NativeCursor native_cursor) { +void RemoteRootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) { if (!host_) return; host_->Send( new MetroViewerHostMsg_SetCursor(uint64(native_cursor.platform()))); } -void RemoteWindowTreeHostWin::SetCapture() { +void RemoteRootWindowHostWin::SetCapture() { } -void RemoteWindowTreeHostWin::ReleaseCapture() { +void RemoteRootWindowHostWin::ReleaseCapture() { } -bool RemoteWindowTreeHostWin::QueryMouseLocation(gfx::Point* location_return) { +bool RemoteRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(GetRootWindow()->window()); if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { @@ -371,18 +371,18 @@ bool RemoteWindowTreeHostWin::QueryMouseLocation(gfx::Point* location_return) { return true; } -bool RemoteWindowTreeHostWin::ConfineCursorToRootWindow() { +bool RemoteRootWindowHostWin::ConfineCursorToRootWindow() { return true; } -void RemoteWindowTreeHostWin::UnConfineCursor() { +void RemoteRootWindowHostWin::UnConfineCursor() { } -void RemoteWindowTreeHostWin::OnCursorVisibilityChanged(bool show) { +void RemoteRootWindowHostWin::OnCursorVisibilityChanged(bool show) { NOTIMPLEMENTED(); } -void RemoteWindowTreeHostWin::MoveCursorTo(const gfx::Point& location) { +void RemoteRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { VLOG(1) << "In MoveCursorTo: " << location.x() << ", " << location.y(); if (!host_) return; @@ -407,19 +407,19 @@ void RemoteWindowTreeHostWin::MoveCursorTo(const gfx::Point& location) { host_->Send(new MetroViewerHostMsg_SetCursorPos(location.x(), location.y())); } -void RemoteWindowTreeHostWin::PostNativeEvent( +void RemoteRootWindowHostWin::PostNativeEvent( const base::NativeEvent& native_event) { } -void RemoteWindowTreeHostWin::OnDeviceScaleFactorChanged( +void RemoteRootWindowHostWin::OnDeviceScaleFactorChanged( float device_scale_factor) { NOTIMPLEMENTED(); } -void RemoteWindowTreeHostWin::PrepareForShutdown() { +void RemoteRootWindowHostWin::PrepareForShutdown() { } -void RemoteWindowTreeHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { +void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { if (ignore_mouse_moves_until_set_cursor_ack_) return; @@ -428,7 +428,7 @@ void RemoteWindowTreeHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { delegate_->OnHostMouseEvent(&event); } -void RemoteWindowTreeHostWin::OnMouseButton( +void RemoteRootWindowHostWin::OnMouseButton( int32 x, int32 y, int32 extra, @@ -462,7 +462,7 @@ void RemoteWindowTreeHostWin::OnMouseButton( } } -void RemoteWindowTreeHostWin::OnKeyDown(uint32 vkey, +void RemoteRootWindowHostWin::OnKeyDown(uint32 vkey, uint32 repeat_count, uint32 scan_code, uint32 flags) { @@ -470,7 +470,7 @@ void RemoteWindowTreeHostWin::OnKeyDown(uint32 vkey, flags, false); } -void RemoteWindowTreeHostWin::OnKeyUp(uint32 vkey, +void RemoteRootWindowHostWin::OnKeyUp(uint32 vkey, uint32 repeat_count, uint32 scan_code, uint32 flags) { @@ -478,7 +478,7 @@ void RemoteWindowTreeHostWin::OnKeyUp(uint32 vkey, flags, false); } -void RemoteWindowTreeHostWin::OnChar(uint32 key_code, +void RemoteRootWindowHostWin::OnChar(uint32 key_code, uint32 repeat_count, uint32 scan_code, uint32 flags) { @@ -486,11 +486,11 @@ void RemoteWindowTreeHostWin::OnChar(uint32 key_code, scan_code, flags, true); } -void RemoteWindowTreeHostWin::OnWindowActivated() { +void RemoteRootWindowHostWin::OnWindowActivated() { delegate_->OnHostActivated(); } -void RemoteWindowTreeHostWin::OnTouchDown(int32 x, +void RemoteRootWindowHostWin::OnTouchDown(int32 x, int32 y, uint64 timestamp, uint32 pointer_id) { @@ -501,7 +501,7 @@ void RemoteWindowTreeHostWin::OnTouchDown(int32 x, delegate_->OnHostTouchEvent(&event); } -void RemoteWindowTreeHostWin::OnTouchUp(int32 x, +void RemoteRootWindowHostWin::OnTouchUp(int32 x, int32 y, uint64 timestamp, uint32 pointer_id) { @@ -512,7 +512,7 @@ void RemoteWindowTreeHostWin::OnTouchUp(int32 x, delegate_->OnHostTouchEvent(&event); } -void RemoteWindowTreeHostWin::OnTouchMoved(int32 x, +void RemoteRootWindowHostWin::OnTouchMoved(int32 x, int32 y, uint64 timestamp, uint32 pointer_id) { @@ -523,7 +523,7 @@ void RemoteWindowTreeHostWin::OnTouchMoved(int32 x, delegate_->OnHostTouchEvent(&event); } -void RemoteWindowTreeHostWin::OnFileSaveAsDone(bool success, +void RemoteRootWindowHostWin::OnFileSaveAsDone(bool success, const base::FilePath& filename, int filter_index) { if (success) @@ -535,7 +535,7 @@ void RemoteWindowTreeHostWin::OnFileSaveAsDone(bool success, } -void RemoteWindowTreeHostWin::OnFileOpenDone(bool success, +void RemoteRootWindowHostWin::OnFileOpenDone(bool success, const base::FilePath& filename) { if (success) file_open_completion_callback_.Run(base::FilePath(filename), 0, NULL); @@ -545,7 +545,7 @@ void RemoteWindowTreeHostWin::OnFileOpenDone(bool success, failure_callback_.Reset(); } -void RemoteWindowTreeHostWin::OnMultiFileOpenDone( +void RemoteRootWindowHostWin::OnMultiFileOpenDone( bool success, const std::vector<base::FilePath>& files) { if (success) @@ -556,7 +556,7 @@ void RemoteWindowTreeHostWin::OnMultiFileOpenDone( failure_callback_.Reset(); } -void RemoteWindowTreeHostWin::OnSelectFolderDone( +void RemoteRootWindowHostWin::OnSelectFolderDone( bool success, const base::FilePath& folder) { if (success) @@ -567,22 +567,22 @@ void RemoteWindowTreeHostWin::OnSelectFolderDone( failure_callback_.Reset(); } -void RemoteWindowTreeHostWin::OnSetCursorPosAck() { +void RemoteRootWindowHostWin::OnSetCursorPosAck() { DCHECK(ignore_mouse_moves_until_set_cursor_ack_); ignore_mouse_moves_until_set_cursor_ack_ = false; } -void RemoteWindowTreeHostWin::OnWindowSizeChanged(uint32 width, uint32 height) { +void RemoteRootWindowHostWin::OnWindowSizeChanged(uint32 width, uint32 height) { SetBounds(gfx::Rect(0, 0, width, height)); } -void RemoteWindowTreeHostWin::OnDesktopActivated() { +void RemoteRootWindowHostWin::OnDesktopActivated() { ActivateDesktopCompleted temp = activate_completed_callback_; activate_completed_callback_.Reset(); temp.Run(); } -void RemoteWindowTreeHostWin::DispatchKeyboardMessage(ui::EventType type, +void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type, uint32 vkey, uint32 repeat_count, uint32 scan_code, @@ -605,7 +605,7 @@ void RemoteWindowTreeHostWin::DispatchKeyboardMessage(ui::EventType type, } } -void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { +void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { if (flags == event_flags_) return; event_flags_ = flags; diff --git a/ui/aura/remote_root_window_host_win.h b/ui/aura/remote_root_window_host_win.h index f9ea9e1..ed974d3 100644 --- a/ui/aura/remote_root_window_host_win.h +++ b/ui/aura/remote_root_window_host_win.h @@ -89,15 +89,15 @@ AURA_EXPORT void HandleActivateDesktop( const base::FilePath& shortcut, const ActivateDesktopCompleted& on_success); -// WindowTreeHost implementaton that receives events from a different +// RootWindowHost implementaton that receives events from a different // process. In the case of Windows this is the Windows 8 (aka Metro) // frontend process, which forwards input events to this class. -class AURA_EXPORT RemoteWindowTreeHostWin : public WindowTreeHost { +class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { public: - // Returns the only RemoteWindowTreeHostWin, if this is the first time + // Returns the only RemoteRootWindowHostWin, if this is the first time // this function is called, it will call Create() wiht empty bounds. - static RemoteWindowTreeHostWin* Instance(); - static RemoteWindowTreeHostWin* Create(const gfx::Rect& bounds); + static RemoteRootWindowHostWin* Instance(); + static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); // Called when the remote process has established its IPC connection. // The |host| can be used when we need to send a message to it and @@ -147,8 +147,8 @@ class AURA_EXPORT RemoteWindowTreeHostWin : public WindowTreeHost { bool IsForegroundWindow(); private: - explicit RemoteWindowTreeHostWin(const gfx::Rect& bounds); - virtual ~RemoteWindowTreeHostWin(); + explicit RemoteRootWindowHostWin(const gfx::Rect& bounds); + virtual ~RemoteRootWindowHostWin(); // IPC message handing methods: void OnMouseMoved(int32 x, int32 y, int32 flags); @@ -184,7 +184,7 @@ class AURA_EXPORT RemoteWindowTreeHostWin : public WindowTreeHost { void OnWindowSizeChanged(uint32 width, uint32 height); void OnDesktopActivated(); - // WindowTreeHost overrides: + // RootWindowHost overrides: virtual RootWindow* GetRootWindow() OVERRIDE; virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual void Show() OVERRIDE; @@ -208,7 +208,7 @@ class AURA_EXPORT RemoteWindowTreeHostWin : public WindowTreeHost { virtual void PrepareForShutdown() OVERRIDE; // Helper function to dispatch a keyboard message to the desired target. - // The default target is the WindowTreeHostDelegate. For nested message loop + // The default target is the RootWindowHostDelegate. For nested message loop // invocations we post a synthetic keyboard message directly into the message // loop. The dispatcher for the nested loop would then decide how this // message is routed. @@ -262,7 +262,7 @@ class AURA_EXPORT RemoteWindowTreeHostWin : public WindowTreeHost { // description of SetEventFlags(). uint32 event_flags_; - DISALLOW_COPY_AND_ASSIGN(RemoteWindowTreeHostWin); + DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); }; } // namespace aura diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc index 01d5f25..ee2bc4f 100644 --- a/ui/aura/root_window.cc +++ b/ui/aura/root_window.cc @@ -69,10 +69,10 @@ void SetLastMouseLocation(const Window* root_window, } } -WindowTreeHost* CreateHost(RootWindow* root_window, +RootWindowHost* CreateHost(RootWindow* root_window, const RootWindow::CreateParams& params) { - WindowTreeHost* host = params.host ? - params.host : WindowTreeHost::Create(params.initial_bounds); + RootWindowHost* host = params.host ? + params.host : RootWindowHost::Create(params.initial_bounds); host->set_delegate(root_window); return host; } @@ -169,7 +169,7 @@ void RootWindow::RepostEvent(const ui::LocatedEvent& event) { } } -WindowTreeHostDelegate* RootWindow::AsWindowTreeHostDelegate() { +RootWindowHostDelegate* RootWindow::AsRootWindowHostDelegate() { return this; } @@ -321,9 +321,9 @@ void RootWindow::OnKeyboardMappingChanged() { OnKeyboardMappingChanged(this)); } -void RootWindow::OnWindowTreeHostCloseRequested() { +void RootWindow::OnRootWindowHostCloseRequested() { FOR_EACH_OBSERVER(RootWindowObserver, observers_, - OnWindowTreeHostCloseRequested(this)); + OnRootWindowHostCloseRequested(this)); } void RootWindow::AddRootWindowObserver(RootWindowObserver* observer) { @@ -589,7 +589,7 @@ void RootWindow::OnLayerAnimationAborted( } //////////////////////////////////////////////////////////////////////////////// -// RootWindow, WindowTreeHostDelegate implementation: +// RootWindow, RootWindowHostDelegate implementation: bool RootWindow::OnHostKeyEvent(ui::KeyEvent* event) { DispatchDetails details = DispatchHeldEvents(); @@ -696,7 +696,7 @@ void RootWindow::OnHostMoved(const gfx::Point& origin) { "origin", origin.ToString()); FOR_EACH_OBSERVER(RootWindowObserver, observers_, - OnWindowTreeHostMoved(this, origin)); + OnRootWindowHostMoved(this, origin)); } void RootWindow::OnHostResized(const gfx::Size& size) { @@ -708,7 +708,7 @@ void RootWindow::OnHostResized(const gfx::Size& size) { return; FOR_EACH_OBSERVER(RootWindowObserver, observers_, - OnWindowTreeHostResized(this)); + OnRootWindowHostResized(this)); } RootWindow* RootWindow::AsRootWindow() { diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h index f9a17af..7f8d0b1 100644 --- a/ui/aura/root_window.h +++ b/ui/aura/root_window.h @@ -45,7 +45,7 @@ class ViewProp; namespace aura { class RootWindow; -class WindowTreeHost; +class RootWindowHost; class RootWindowObserver; class TestScreen; @@ -54,7 +54,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, public ui::GestureEventHelper, public ui::LayerAnimationObserver, public aura::client::CaptureDelegate, - public aura::WindowTreeHostDelegate { + public aura::RootWindowHostDelegate { public: struct AURA_EXPORT CreateParams { // CreateParams with initial_bounds and default host in pixel. @@ -65,13 +65,13 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // A host to use in place of the default one that RootWindow will create. // NULL by default. - WindowTreeHost* host; + RootWindowHost* host; }; explicit RootWindow(const CreateParams& params); virtual ~RootWindow(); - // Returns the WindowTreeHost for the specified accelerated widget, or NULL + // Returns the RootWindowHost for the specified accelerated widget, or NULL // if there is none associated. static RootWindow* GetForAcceleratedWidget(gfx::AcceleratedWidget widget); @@ -79,11 +79,11 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, return const_cast<Window*>(const_cast<const RootWindow*>(this)->window()); } const Window* window() const { return window_.get(); } - WindowTreeHost* host() { - return const_cast<WindowTreeHost*>( + RootWindowHost* host() { + return const_cast<RootWindowHost*>( const_cast<const RootWindow*>(this)->host()); } - const WindowTreeHost* host() const { return host_.get(); } + const RootWindowHost* host() const { return host_.get(); } gfx::NativeCursor last_cursor() const { return last_cursor_; } Window* mouse_pressed_handler() { return mouse_pressed_handler_; } Window* mouse_moved_handler() { return mouse_moved_handler_; } @@ -99,7 +99,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // types (although the latter is currently a no-op). void RepostEvent(const ui::LocatedEvent& event); - WindowTreeHostDelegate* AsWindowTreeHostDelegate(); + RootWindowHostDelegate* AsRootWindowHostDelegate(); // Gets/sets the size of the host window. void SetHostSize(const gfx::Size& size_in_pixel); @@ -130,7 +130,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // Handles a gesture event. Returns true if handled. Unlike the other // event-dispatching function (e.g. for touch/mouse/keyboard events), gesture - // events are dispatched from GestureRecognizer instead of WindowTreeHost. + // events are dispatched from GestureRecognizer instead of RootWindowHost. void DispatchGestureEvent(ui::GestureEvent* event); // Invoked when |window| is being destroyed. @@ -159,7 +159,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, void OnKeyboardMappingChanged(); // The system windowing system has sent a request that we close our window. - void OnWindowTreeHostCloseRequested(); + void OnRootWindowHostCloseRequested(); // Add/remove observer. There is no need to remove the observer if // the root window is being deleted. In particular, you SHOULD NOT remove @@ -208,7 +208,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, }; // Updates the event with the appropriate transform for the device scale - // factor. The WindowTreeHostDelegate dispatches events in the physical pixel + // factor. The RootWindowHostDelegate dispatches events in the physical pixel // coordinate. But the event processing from RootWindow onwards happen in // device-independent pixel coordinate. So it is necessary to update the event // received from the host. @@ -264,7 +264,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, virtual void OnLayerAnimationAborted( ui::LayerAnimationSequence* animation) OVERRIDE; - // Overridden from aura::WindowTreeHostDelegate: + // Overridden from aura::RootWindowHostDelegate: virtual bool OnHostKeyEvent(ui::KeyEvent* event) OVERRIDE; virtual bool OnHostMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual bool OnHostScrollEvent(ui::ScrollEvent* event) OVERRIDE; @@ -286,7 +286,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // dispatch held and newly incoming mouse and touch events, typically when an // event other than one of these needs dispatching or a matching // ReleaseMouseMoves()/ReleaseTouchMoves() is called. NOTE: because these - // methods dispatch events from WindowTreeHost the coordinates are in terms of + // methods dispatch events from RootWindowHost the coordinates are in terms of // the root. ui::EventDispatchDetails DispatchMouseEventImpl(ui::MouseEvent* event) WARN_UNUSED_RESULT; @@ -312,7 +312,7 @@ class AURA_EXPORT RootWindow : public ui::EventDispatcherDelegate, // TODO(beng): evaluate the ideal ownership model. scoped_ptr<Window> window_; - scoped_ptr<WindowTreeHost> host_; + scoped_ptr<RootWindowHost> host_; // Touch ids that are currently down. uint32 touch_ids_down_; diff --git a/ui/aura/root_window_host_ozone.cc b/ui/aura/root_window_host_ozone.cc index 9bb2a2b..9f324c2 100644 --- a/ui/aura/root_window_host_ozone.cc +++ b/ui/aura/root_window_host_ozone.cc @@ -11,7 +11,7 @@ namespace aura { -WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) +RootWindowHostOzone::RootWindowHostOzone(const gfx::Rect& bounds) : widget_(0), bounds_(bounds) { ui::OzonePlatform::Initialize(); @@ -31,11 +31,11 @@ WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) CreateCompositor(GetAcceleratedWidget()); } -WindowTreeHostOzone::~WindowTreeHostOzone() { +RootWindowHostOzone::~RootWindowHostOzone() { base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); } -bool WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) { +bool RootWindowHostOzone::Dispatch(const base::NativeEvent& ne) { ui::Event* event = static_cast<ui::Event*>(ne); if (event->IsTouchEvent()) { ui::TouchEvent* touchev = static_cast<ui::TouchEvent*>(ne); @@ -50,83 +50,83 @@ bool WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) { return true; } -RootWindow* WindowTreeHostOzone::GetRootWindow() { +RootWindow* RootWindowHostOzone::GetRootWindow() { return delegate_->AsRootWindow(); } -gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() { +gfx::AcceleratedWidget RootWindowHostOzone::GetAcceleratedWidget() { return widget_; } -void WindowTreeHostOzone::Show() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::Show() { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::Hide() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::Hide() { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::ToggleFullScreen() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::ToggleFullScreen() { NOTIMPLEMENTED(); } -gfx::Rect WindowTreeHostOzone::GetBounds() const { return bounds_; } +gfx::Rect RootWindowHostOzone::GetBounds() const { return bounds_; } -void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { +void RootWindowHostOzone::SetBounds(const gfx::Rect& bounds) { NOTIMPLEMENTED(); } -gfx::Insets WindowTreeHostOzone::GetInsets() const { return gfx::Insets(); } +gfx::Insets RootWindowHostOzone::GetInsets() const { return gfx::Insets(); } -void WindowTreeHostOzone::SetInsets(const gfx::Insets& insets) { +void RootWindowHostOzone::SetInsets(const gfx::Insets& insets) { NOTIMPLEMENTED(); } -gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { +gfx::Point RootWindowHostOzone::GetLocationOnNativeScreen() const { return bounds_.origin(); } -void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::SetCapture() { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::SetCursor(gfx::NativeCursor cursor) { +void RootWindowHostOzone::SetCursor(gfx::NativeCursor cursor) { NOTIMPLEMENTED(); } -bool WindowTreeHostOzone::QueryMouseLocation(gfx::Point* location_return) { +bool RootWindowHostOzone::QueryMouseLocation(gfx::Point* location_return) { NOTIMPLEMENTED(); return false; } -bool WindowTreeHostOzone::ConfineCursorToRootWindow() { +bool RootWindowHostOzone::ConfineCursorToRootWindow() { NOTIMPLEMENTED(); return false; } -void WindowTreeHostOzone::UnConfineCursor() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::UnConfineCursor() { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::OnCursorVisibilityChanged(bool show) { +void RootWindowHostOzone::OnCursorVisibilityChanged(bool show) { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::MoveCursorTo(const gfx::Point& location) { +void RootWindowHostOzone::MoveCursorTo(const gfx::Point& location) { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::PostNativeEvent( +void RootWindowHostOzone::PostNativeEvent( const base::NativeEvent& native_event) { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::OnDeviceScaleFactorChanged( +void RootWindowHostOzone::OnDeviceScaleFactorChanged( float device_scale_factor) { NOTIMPLEMENTED(); } -void WindowTreeHostOzone::PrepareForShutdown() { NOTIMPLEMENTED(); } +void RootWindowHostOzone::PrepareForShutdown() { NOTIMPLEMENTED(); } // static -WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { - return new WindowTreeHostOzone(bounds); +RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { + return new RootWindowHostOzone(bounds); } // static -gfx::Size WindowTreeHost::GetNativeScreenSize() { +gfx::Size RootWindowHost::GetNativeScreenSize() { NOTIMPLEMENTED(); return gfx::Size(); } diff --git a/ui/aura/root_window_host_ozone.h b/ui/aura/root_window_host_ozone.h index a026994..41f6a8e 100644 --- a/ui/aura/root_window_host_ozone.h +++ b/ui/aura/root_window_host_ozone.h @@ -15,17 +15,17 @@ namespace aura { -class WindowTreeHostOzone : public WindowTreeHost, +class RootWindowHostOzone : public RootWindowHost, public base::MessageLoop::Dispatcher { public: - explicit WindowTreeHostOzone(const gfx::Rect& bounds); - virtual ~WindowTreeHostOzone(); + explicit RootWindowHostOzone(const gfx::Rect& bounds); + virtual ~RootWindowHostOzone(); private: // Overridden from Dispatcher overrides: virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; - // WindowTreeHost Overrides. + // RootWindowHost Overrides. virtual RootWindow* GetRootWindow() OVERRIDE; virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual void Show() OVERRIDE; @@ -51,7 +51,7 @@ class WindowTreeHostOzone : public WindowTreeHost, gfx::AcceleratedWidget widget_; gfx::Rect bounds_; - DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); + DISALLOW_COPY_AND_ASSIGN(RootWindowHostOzone); }; } // namespace aura diff --git a/ui/aura/root_window_host_win.cc b/ui/aura/root_window_host_win.cc index e4ae7f6..7bf4284 100644 --- a/ui/aura/root_window_host_win.cc +++ b/ui/aura/root_window_host_win.cc @@ -29,17 +29,17 @@ bool use_popup_as_root_window_for_test = false; } // namespace // static -WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { - return new WindowTreeHostWin(bounds); +RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { + return new RootWindowHostWin(bounds); } // static -gfx::Size WindowTreeHost::GetNativeScreenSize() { +gfx::Size RootWindowHost::GetNativeScreenSize() { return gfx::Size(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); } -WindowTreeHostWin::WindowTreeHostWin(const gfx::Rect& bounds) +RootWindowHostWin::RootWindowHostWin(const gfx::Rect& bounds) : fullscreen_(false), has_capture_(false), saved_window_style_(0), @@ -51,27 +51,27 @@ WindowTreeHostWin::WindowTreeHostWin(const gfx::Rect& bounds) CreateCompositor(GetAcceleratedWidget()); } -WindowTreeHostWin::~WindowTreeHostWin() { +RootWindowHostWin::~RootWindowHostWin() { DestroyWindow(hwnd()); } -RootWindow* WindowTreeHostWin::GetRootWindow() { +RootWindow* RootWindowHostWin::GetRootWindow() { return delegate_->AsRootWindow(); } -gfx::AcceleratedWidget WindowTreeHostWin::GetAcceleratedWidget() { +gfx::AcceleratedWidget RootWindowHostWin::GetAcceleratedWidget() { return hwnd(); } -void WindowTreeHostWin::Show() { +void RootWindowHostWin::Show() { ShowWindow(hwnd(), SW_SHOWNORMAL); } -void WindowTreeHostWin::Hide() { +void RootWindowHostWin::Hide() { NOTIMPLEMENTED(); } -void WindowTreeHostWin::ToggleFullScreen() { +void RootWindowHostWin::ToggleFullScreen() { gfx::Rect target_rect; if (!fullscreen_) { fullscreen_ = true; @@ -103,13 +103,13 @@ void WindowTreeHostWin::ToggleFullScreen() { SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); } -gfx::Rect WindowTreeHostWin::GetBounds() const { +gfx::Rect RootWindowHostWin::GetBounds() const { RECT r; GetClientRect(hwnd(), &r); return gfx::Rect(r); } -void WindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { +void RootWindowHostWin::SetBounds(const gfx::Rect& bounds) { if (fullscreen_) { saved_window_rect_.right = saved_window_rect_.left + bounds.width(); saved_window_rect_.bottom = saved_window_rect_.top + bounds.height(); @@ -143,21 +143,21 @@ void WindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { NotifyHostResized(bounds.size()); } -gfx::Insets WindowTreeHostWin::GetInsets() const { +gfx::Insets RootWindowHostWin::GetInsets() const { return gfx::Insets(); } -void WindowTreeHostWin::SetInsets(const gfx::Insets& insets) { +void RootWindowHostWin::SetInsets(const gfx::Insets& insets) { } -gfx::Point WindowTreeHostWin::GetLocationOnNativeScreen() const { +gfx::Point RootWindowHostWin::GetLocationOnNativeScreen() const { RECT r; GetClientRect(hwnd(), &r); return gfx::Point(r.left, r.top); } -void WindowTreeHostWin::SetCursor(gfx::NativeCursor native_cursor) { +void RootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) { // Custom web cursors are handled directly. if (native_cursor == ui::kCursorCustom) return; @@ -167,21 +167,21 @@ void WindowTreeHostWin::SetCursor(gfx::NativeCursor native_cursor) { ::SetCursor(native_cursor.platform()); } -void WindowTreeHostWin::SetCapture() { +void RootWindowHostWin::SetCapture() { if (!has_capture_) { has_capture_ = true; ::SetCapture(hwnd()); } } -void WindowTreeHostWin::ReleaseCapture() { +void RootWindowHostWin::ReleaseCapture() { if (has_capture_) { has_capture_ = false; ::ReleaseCapture(); } } -bool WindowTreeHostWin::QueryMouseLocation(gfx::Point* location_return) { +bool RootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { client::CursorClient* cursor_client = client::GetCursorClient(GetRootWindow()->window()); if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { @@ -200,44 +200,44 @@ bool WindowTreeHostWin::QueryMouseLocation(gfx::Point* location_return) { pt.y >= 0 && static_cast<int>(pt.y) < size.height()); } -bool WindowTreeHostWin::ConfineCursorToRootWindow() { +bool RootWindowHostWin::ConfineCursorToRootWindow() { RECT window_rect; GetWindowRect(hwnd(), &window_rect); return ClipCursor(&window_rect) != 0; } -void WindowTreeHostWin::UnConfineCursor() { +void RootWindowHostWin::UnConfineCursor() { ClipCursor(NULL); } -void WindowTreeHostWin::OnCursorVisibilityChanged(bool show) { +void RootWindowHostWin::OnCursorVisibilityChanged(bool show) { NOTIMPLEMENTED(); } -void WindowTreeHostWin::MoveCursorTo(const gfx::Point& location) { +void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) { // Deliberately not implemented. } -void WindowTreeHostWin::PostNativeEvent(const base::NativeEvent& native_event) { +void RootWindowHostWin::PostNativeEvent(const base::NativeEvent& native_event) { ::PostMessage( hwnd(), native_event.message, native_event.wParam, native_event.lParam); } -void WindowTreeHostWin::OnDeviceScaleFactorChanged( +void RootWindowHostWin::OnDeviceScaleFactorChanged( float device_scale_factor) { NOTIMPLEMENTED(); } -void WindowTreeHostWin::PrepareForShutdown() { +void RootWindowHostWin::PrepareForShutdown() { NOTIMPLEMENTED(); } -void WindowTreeHostWin::OnClose() { +void RootWindowHostWin::OnClose() { // TODO: this obviously shouldn't be here. base::MessageLoopForUI::current()->Quit(); } -LRESULT WindowTreeHostWin::OnKeyEvent(UINT message, +LRESULT RootWindowHostWin::OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param) { MSG msg = { hwnd(), message, w_param, l_param }; @@ -246,7 +246,7 @@ LRESULT WindowTreeHostWin::OnKeyEvent(UINT message, return 0; } -LRESULT WindowTreeHostWin::OnMouseRange(UINT message, +LRESULT RootWindowHostWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { MSG msg = { hwnd(), message, w_param, l_param, 0, @@ -259,7 +259,7 @@ LRESULT WindowTreeHostWin::OnMouseRange(UINT message, return 0; } -LRESULT WindowTreeHostWin::OnCaptureChanged(UINT message, +LRESULT RootWindowHostWin::OnCaptureChanged(UINT message, WPARAM w_param, LPARAM l_param) { if (has_capture_) { @@ -269,7 +269,7 @@ LRESULT WindowTreeHostWin::OnCaptureChanged(UINT message, return 0; } -LRESULT WindowTreeHostWin::OnNCActivate(UINT message, +LRESULT RootWindowHostWin::OnNCActivate(UINT message, WPARAM w_param, LPARAM l_param) { if (!!w_param) @@ -277,12 +277,12 @@ LRESULT WindowTreeHostWin::OnNCActivate(UINT message, return DefWindowProc(hwnd(), message, w_param, l_param); } -void WindowTreeHostWin::OnMove(const CPoint& point) { +void RootWindowHostWin::OnMove(const CPoint& point) { if (delegate_) delegate_->OnHostMoved(gfx::Point(point.x, point.y)); } -void WindowTreeHostWin::OnPaint(HDC dc) { +void RootWindowHostWin::OnPaint(HDC dc) { gfx::Rect damage_rect; RECT update_rect = {0}; if (GetUpdateRect(hwnd(), &update_rect, FALSE)) @@ -291,7 +291,7 @@ void WindowTreeHostWin::OnPaint(HDC dc) { ValidateRect(hwnd(), NULL); } -void WindowTreeHostWin::OnSize(UINT param, const CSize& size) { +void RootWindowHostWin::OnSize(UINT param, const CSize& size) { // Minimizing resizes the window to 0x0 which causes our layout to go all // screwy, so we just ignore it. if (delegate_ && param != SIZE_MINIMIZED) diff --git a/ui/aura/root_window_host_win.h b/ui/aura/root_window_host_win.h index 1330625..64215a7 100644 --- a/ui/aura/root_window_host_win.h +++ b/ui/aura/root_window_host_win.h @@ -12,11 +12,11 @@ namespace aura { -class WindowTreeHostWin : public WindowTreeHost, public gfx::WindowImpl { +class RootWindowHostWin : public RootWindowHost, public gfx::WindowImpl { public: - WindowTreeHostWin(const gfx::Rect& bounds); - virtual ~WindowTreeHostWin(); - // WindowTreeHost: + RootWindowHostWin(const gfx::Rect& bounds); + virtual ~RootWindowHostWin(); + // RootWindowHost: virtual RootWindow* GetRootWindow() OVERRIDE; virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual void Show() OVERRIDE; @@ -40,7 +40,7 @@ class WindowTreeHostWin : public WindowTreeHost, public gfx::WindowImpl { virtual void PrepareForShutdown() OVERRIDE; private: - BEGIN_MSG_MAP_EX(WindowTreeHostWin) + BEGIN_MSG_MAP_EX(RootWindowHostWin) // Range handlers must go first! MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) MESSAGE_RANGE_HANDLER_EX(WM_NCMOUSEMOVE, WM_NCXBUTTONDBLCLK, OnMouseRange) @@ -79,12 +79,12 @@ class WindowTreeHostWin : public WindowTreeHost, public gfx::WindowImpl { DWORD saved_window_style_; DWORD saved_window_ex_style_; - DISALLOW_COPY_AND_ASSIGN(WindowTreeHostWin); + DISALLOW_COPY_AND_ASSIGN(RootWindowHostWin); }; namespace test { -// Set true to let WindowTreeHostWin use a popup window +// Set true to let RootWindowHostWin use a popup window // with no frame/title so that the window size and test's // expectations matches. AURA_EXPORT void SetUsePopupAsRootWindowForTest(bool use); diff --git a/ui/aura/root_window_host_x11.cc b/ui/aura/root_window_host_x11.cc index f20acde..55c21c6 100644 --- a/ui/aura/root_window_host_x11.cc +++ b/ui/aura/root_window_host_x11.cc @@ -276,7 +276,7 @@ class TouchEventCalibrate : public base::MessagePumpObserver { } // namespace internal //////////////////////////////////////////////////////////////////////////////// -// WindowTreeHostX11::MouseMoveFilter filters out the move events that +// RootWindowHostX11::MouseMoveFilter filters out the move events that // jump back and forth between two points. This happens when sub pixel mouse // move is enabled and mouse move events could be jumping between two neighbor // pixels, e.g. move(0,0), move(1,0), move(0,0), move(1,0) and on and on. @@ -284,7 +284,7 @@ class TouchEventCalibrate : public base::MessagePumpObserver { // provides a Filter method to find out whether a mouse event is in a different // location and should be processed. -class WindowTreeHostX11::MouseMoveFilter { +class RootWindowHostX11::MouseMoveFilter { public: MouseMoveFilter() : insert_index_(0) { for (size_t i = 0; i < kMaxEvents; ++i) { @@ -317,9 +317,9 @@ class WindowTreeHostX11::MouseMoveFilter { }; //////////////////////////////////////////////////////////////////////////////// -// WindowTreeHostX11 +// RootWindowHostX11 -WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds) +RootWindowHostX11::RootWindowHostX11(const gfx::Rect& bounds) : xdisplay_(gfx::GetXDisplay()), xwindow_(0), x_root_window_(DefaultRootWindow(xdisplay_)), @@ -398,7 +398,7 @@ WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds) CreateCompositor(GetAcceleratedWidget()); } -WindowTreeHostX11::~WindowTreeHostX11() { +RootWindowHostX11::~RootWindowHostX11() { Env::GetInstance()->RemoveObserver(this); base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(this); base::MessagePumpX11::Current()->RemoveDispatcherForWindow(xwindow_); @@ -408,7 +408,7 @@ WindowTreeHostX11::~WindowTreeHostX11() { XDestroyWindow(xdisplay_, xwindow_); } -bool WindowTreeHostX11::Dispatch(const base::NativeEvent& event) { +bool RootWindowHostX11::Dispatch(const base::NativeEvent& event) { XEvent* xev = event; if (FindEventTarget(event) == x_root_window_) @@ -529,7 +529,7 @@ bool WindowTreeHostX11::Dispatch(const base::NativeEvent& event) { Atom message_type = static_cast<Atom>(xev->xclient.data.l[0]); if (message_type == atom_cache_.GetAtom("WM_DELETE_WINDOW")) { // We have received a close message from the window manager. - delegate_->AsRootWindow()->OnWindowTreeHostCloseRequested(); + delegate_->AsRootWindow()->OnRootWindowHostCloseRequested(); } else if (message_type == atom_cache_.GetAtom("_NET_WM_PING")) { XEvent reply_event = *xev; reply_event.xclient.window = x_root_window_; @@ -584,15 +584,15 @@ bool WindowTreeHostX11::Dispatch(const base::NativeEvent& event) { return true; } -RootWindow* WindowTreeHostX11::GetRootWindow() { +RootWindow* RootWindowHostX11::GetRootWindow() { return delegate_->AsRootWindow(); } -gfx::AcceleratedWidget WindowTreeHostX11::GetAcceleratedWidget() { +gfx::AcceleratedWidget RootWindowHostX11::GetAcceleratedWidget() { return xwindow_; } -void WindowTreeHostX11::Show() { +void RootWindowHostX11::Show() { if (!window_mapped_) { // Before we map the window, set size hints. Otherwise, some window managers // will ignore toplevel XMoveWindow commands. @@ -615,22 +615,22 @@ void WindowTreeHostX11::Show() { } } -void WindowTreeHostX11::Hide() { +void RootWindowHostX11::Hide() { if (window_mapped_) { XWithdrawWindow(xdisplay_, xwindow_, 0); window_mapped_ = false; } } -void WindowTreeHostX11::ToggleFullScreen() { +void RootWindowHostX11::ToggleFullScreen() { NOTIMPLEMENTED(); } -gfx::Rect WindowTreeHostX11::GetBounds() const { +gfx::Rect RootWindowHostX11::GetBounds() const { return bounds_; } -void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { +void RootWindowHostX11::SetBounds(const gfx::Rect& bounds) { // Even if the host window's size doesn't change, aura's root window // size, which is in DIP, changes when the scale changes. float current_scale = compositor()->device_scale_factor(); @@ -673,11 +673,11 @@ void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { } } -gfx::Insets WindowTreeHostX11::GetInsets() const { +gfx::Insets RootWindowHostX11::GetInsets() const { return insets_; } -void WindowTreeHostX11::SetInsets(const gfx::Insets& insets) { +void RootWindowHostX11::SetInsets(const gfx::Insets& insets) { insets_ = insets; if (pointer_barriers_) { UnConfineCursor(); @@ -685,26 +685,26 @@ void WindowTreeHostX11::SetInsets(const gfx::Insets& insets) { } } -gfx::Point WindowTreeHostX11::GetLocationOnNativeScreen() const { +gfx::Point RootWindowHostX11::GetLocationOnNativeScreen() const { return bounds_.origin(); } -void WindowTreeHostX11::SetCapture() { +void RootWindowHostX11::SetCapture() { // TODO(oshima): Grab x input. } -void WindowTreeHostX11::ReleaseCapture() { +void RootWindowHostX11::ReleaseCapture() { // TODO(oshima): Release x input. } -void WindowTreeHostX11::SetCursor(gfx::NativeCursor cursor) { +void RootWindowHostX11::SetCursor(gfx::NativeCursor cursor) { if (cursor == current_cursor_) return; current_cursor_ = cursor; SetCursorInternal(cursor); } -bool WindowTreeHostX11::QueryMouseLocation(gfx::Point* location_return) { +bool RootWindowHostX11::QueryMouseLocation(gfx::Point* location_return) { client::CursorClient* cursor_client = client::GetCursorClient(GetRootWindow()->window()); if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { @@ -728,7 +728,7 @@ bool WindowTreeHostX11::QueryMouseLocation(gfx::Point* location_return) { win_y_return >= 0 && win_y_return < bounds_.height()); } -bool WindowTreeHostX11::ConfineCursorToRootWindow() { +bool RootWindowHostX11::ConfineCursorToRootWindow() { #if XFIXES_MAJOR >= 5 DCHECK(!pointer_barriers_.get()); if (pointer_barriers_) @@ -764,7 +764,7 @@ bool WindowTreeHostX11::ConfineCursorToRootWindow() { return true; } -void WindowTreeHostX11::UnConfineCursor() { +void RootWindowHostX11::UnConfineCursor() { #if XFIXES_MAJOR >= 5 if (pointer_barriers_) { XFixesDestroyPointerBarrier(xdisplay_, pointer_barriers_[0]); @@ -776,17 +776,17 @@ void WindowTreeHostX11::UnConfineCursor() { #endif } -void WindowTreeHostX11::OnCursorVisibilityChanged(bool show) { +void RootWindowHostX11::OnCursorVisibilityChanged(bool show) { SetCrOSTapPaused(!show); } -void WindowTreeHostX11::MoveCursorTo(const gfx::Point& location) { +void RootWindowHostX11::MoveCursorTo(const gfx::Point& location) { XWarpPointer(xdisplay_, None, x_root_window_, 0, 0, 0, 0, bounds_.x() + location.x(), bounds_.y() + location.y()); } -void WindowTreeHostX11::PostNativeEvent( +void RootWindowHostX11::PostNativeEvent( const base::NativeEvent& native_event) { DCHECK(xwindow_); DCHECK(xdisplay_); @@ -819,18 +819,18 @@ void WindowTreeHostX11::PostNativeEvent( XSendEvent(xdisplay_, xwindow_, False, 0, &xevent); } -void WindowTreeHostX11::OnDeviceScaleFactorChanged( +void RootWindowHostX11::OnDeviceScaleFactorChanged( float device_scale_factor) { } -void WindowTreeHostX11::PrepareForShutdown() { +void RootWindowHostX11::PrepareForShutdown() { base::MessagePumpX11::Current()->RemoveDispatcherForWindow(xwindow_); } -void WindowTreeHostX11::OnWindowInitialized(Window* window) { +void RootWindowHostX11::OnWindowInitialized(Window* window) { } -void WindowTreeHostX11::OnRootWindowInitialized(RootWindow* root_window) { +void RootWindowHostX11::OnRootWindowInitialized(RootWindow* root_window) { // UpdateIsInternalDisplay relies on: // 1. delegate_ pointing to RootWindow - available after SetDelegate. // 2. RootWindow's kDisplayIdKey property set - available by the time @@ -846,7 +846,7 @@ void WindowTreeHostX11::OnRootWindowInitialized(RootWindow* root_window) { SetCrOSTapPaused(false); } -bool WindowTreeHostX11::DispatchEventForRootWindow( +bool RootWindowHostX11::DispatchEventForRootWindow( const base::NativeEvent& event) { switch (event->type) { case ConfigureNotify: @@ -863,13 +863,13 @@ bool WindowTreeHostX11::DispatchEventForRootWindow( return true; } -void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) { +void RootWindowHostX11::DispatchXI2Event(const base::NativeEvent& event) { ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); XEvent* xev = event; if (!factory->ShouldProcessXI2Event(xev)) return; - TRACE_EVENT1("input", "WindowTreeHostX11::DispatchXI2Event", + TRACE_EVENT1("input", "RootWindowHostX11::DispatchXI2Event", "event_latency_us", (ui::EventTimeForNow() - ui::EventTimeFromNative(event)). InMicroseconds()); @@ -995,18 +995,18 @@ void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) { XFreeEventData(xev->xgeneric.display, &last_event.xcookie); } -bool WindowTreeHostX11::IsWindowManagerPresent() { +bool RootWindowHostX11::IsWindowManagerPresent() { // Per ICCCM 2.8, "Manager Selections", window managers should take ownership // of WM_Sn selections (where n is a screen number). return XGetSelectionOwner( xdisplay_, atom_cache_.GetAtom("WM_S0")) != None; } -void WindowTreeHostX11::SetCursorInternal(gfx::NativeCursor cursor) { +void RootWindowHostX11::SetCursorInternal(gfx::NativeCursor cursor) { XDefineCursor(xdisplay_, xwindow_, cursor.platform()); } -void WindowTreeHostX11::TranslateAndDispatchMouseEvent( +void RootWindowHostX11::TranslateAndDispatchMouseEvent( ui::MouseEvent* event) { Window* root_window = GetRootWindow()->window(); client::ScreenPositionClient* screen_position_client = @@ -1028,14 +1028,14 @@ void WindowTreeHostX11::TranslateAndDispatchMouseEvent( delegate_->OnHostMouseEvent(event); } -void WindowTreeHostX11::UpdateIsInternalDisplay() { +void RootWindowHostX11::UpdateIsInternalDisplay() { Window* root_window = GetRootWindow()->window(); gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window); gfx::Display display = screen->GetDisplayNearestWindow(root_window); is_internal_display_ = display.IsInternal(); } -void WindowTreeHostX11::SetCrOSTapPaused(bool state) { +void RootWindowHostX11::SetCrOSTapPaused(bool state) { #if defined(OS_CHROMEOS) if (!ui::IsXInput2Available()) return; @@ -1066,12 +1066,12 @@ void WindowTreeHostX11::SetCrOSTapPaused(bool state) { } // static -WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { - return new WindowTreeHostX11(bounds); +RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { + return new RootWindowHostX11(bounds); } // static -gfx::Size WindowTreeHost::GetNativeScreenSize() { +gfx::Size RootWindowHost::GetNativeScreenSize() { ::XDisplay* xdisplay = gfx::GetXDisplay(); return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); } diff --git a/ui/aura/root_window_host_x11.h b/ui/aura/root_window_host_x11.h index c53476a..e8593e6 100644 --- a/ui/aura/root_window_host_x11.h +++ b/ui/aura/root_window_host_x11.h @@ -32,17 +32,17 @@ namespace internal { class TouchEventCalibrate; } -class AURA_EXPORT WindowTreeHostX11 : public WindowTreeHost, +class AURA_EXPORT RootWindowHostX11 : public RootWindowHost, public base::MessageLoop::Dispatcher, public EnvObserver { public: - explicit WindowTreeHostX11(const gfx::Rect& bounds); - virtual ~WindowTreeHostX11(); + explicit RootWindowHostX11(const gfx::Rect& bounds); + virtual ~RootWindowHostX11(); // Overridden from Dispatcher overrides: virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; - // WindowTreeHost Overrides. + // RootWindowHost Overrides. virtual RootWindow* GetRootWindow() OVERRIDE; virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual void Show() OVERRIDE; @@ -88,7 +88,7 @@ class AURA_EXPORT WindowTreeHostX11 : public WindowTreeHost, void SetCursorInternal(gfx::NativeCursor cursor); // Translates the native mouse location into screen coordinates and and - // dispatches the event to WindowTreeHostDelegate. + // dispatches the event to RootWindowHostDelegate. void TranslateAndDispatchMouseEvent(ui::MouseEvent* event); // Update is_internal_display_ based on delegate_ state @@ -137,13 +137,13 @@ class AURA_EXPORT WindowTreeHostX11 : public WindowTreeHost, // Touch ids of which the touch press happens at side bezel region. uint32 bezel_tracking_ids_; - DISALLOW_COPY_AND_ASSIGN(WindowTreeHostX11); + DISALLOW_COPY_AND_ASSIGN(RootWindowHostX11); }; namespace test { // Set the default value of the override redirect flag used to -// create a X window for WindowTreeHostX11. +// create a X window for RootWindowHostX11. AURA_EXPORT void SetUseOverrideRedirectWindowByDefault(bool override_redirect); } // namespace test diff --git a/ui/aura/root_window_host_x11_unittest.cc b/ui/aura/root_window_host_x11_unittest.cc index a7dfa14..bdf1104 100644 --- a/ui/aura/root_window_host_x11_unittest.cc +++ b/ui/aura/root_window_host_x11_unittest.cc @@ -12,13 +12,13 @@ #include "ui/events/x/events_x_utils.h" namespace { -class TestWindowTreeHostDelegate : public aura::WindowTreeHostDelegate { +class TestRootWindowHostDelegate : public aura::RootWindowHostDelegate { public: - TestWindowTreeHostDelegate() : last_touch_type_(ui::ET_UNKNOWN), + TestRootWindowHostDelegate() : last_touch_type_(ui::ET_UNKNOWN), last_touch_id_(-1), last_touch_location_(0, 0) { } - virtual ~TestWindowTreeHostDelegate() {} + virtual ~TestRootWindowHostDelegate() {} virtual bool OnHostKeyEvent(ui::KeyEvent* event) OVERRIDE { return true; @@ -77,29 +77,29 @@ class TestWindowTreeHostDelegate : public aura::WindowTreeHostDelegate { int last_touch_id_; gfx::Point last_touch_location_; - DISALLOW_COPY_AND_ASSIGN(TestWindowTreeHostDelegate); + DISALLOW_COPY_AND_ASSIGN(TestRootWindowHostDelegate); }; } // namespace namespace aura { -typedef test::AuraTestBase WindowTreeHostX11Test; +typedef test::AuraTestBase RootWindowHostX11Test; -// Send X touch events to one WindowTreeHost. The WindowTreeHost's +// Send X touch events to one RootWindowHost. The RootWindowHost's // delegate will get corresponding ui::TouchEvent if the touch events -// are winthin the bound of the WindowTreeHost. -TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) { +// are winthin the bound of the RootWindowHost. +TEST_F(RootWindowHostX11Test, DispatchTouchEventToOneRootWindow) { #if defined(OS_CHROMEOS) // Fake a ChromeOS running env. const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n"; base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); #endif // defined(OS_CHROMEOS) - scoped_ptr<WindowTreeHostX11> root_window_host( - new WindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700))); - scoped_ptr<TestWindowTreeHostDelegate> delegate( - new TestWindowTreeHostDelegate()); + scoped_ptr<RootWindowHostX11> root_window_host( + new RootWindowHostX11(gfx::Rect(0, 0, 2560, 1700))); + scoped_ptr<TestRootWindowHostDelegate> delegate( + new TestRootWindowHostDelegate()); root_window_host->set_delegate(delegate.get()); std::vector<unsigned int> devices; @@ -151,26 +151,26 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) { #endif // defined(OS_CHROMEOS) } -// Send X touch events to two WindowTreeHost. The WindowTreeHost which is +// Send X touch events to two RootWindowHost. The RootWindowHost which is // the event target of the X touch events should generate the corresponding // ui::TouchEvent for its delegate. #if defined(OS_CHROMEOS) -TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) { +TEST_F(RootWindowHostX11Test, DispatchTouchEventToTwoRootWindow) { // Fake a ChromeOS running env. const char* kLsbRelease = "CHROMEOS_RELEASE_NAME=Chromium OS\n"; base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); - scoped_ptr<WindowTreeHostX11> root_window_host1( - new WindowTreeHostX11(gfx::Rect(0, 0, 2560, 1700))); - scoped_ptr<TestWindowTreeHostDelegate> delegate1( - new TestWindowTreeHostDelegate()); + scoped_ptr<RootWindowHostX11> root_window_host1( + new RootWindowHostX11(gfx::Rect(0, 0, 2560, 1700))); + scoped_ptr<TestRootWindowHostDelegate> delegate1( + new TestRootWindowHostDelegate()); root_window_host1->set_delegate(delegate1.get()); int host2_y_offset = 1700; - scoped_ptr<WindowTreeHostX11> root_window_host2( - new WindowTreeHostX11(gfx::Rect(0, host2_y_offset, 1920, 1080))); - scoped_ptr<TestWindowTreeHostDelegate> delegate2( - new TestWindowTreeHostDelegate()); + scoped_ptr<RootWindowHostX11> root_window_host2( + new RootWindowHostX11(gfx::Rect(0, host2_y_offset, 1920, 1080))); + scoped_ptr<TestRootWindowHostDelegate> delegate2( + new TestRootWindowHostDelegate()); root_window_host2->set_delegate(delegate2.get()); std::vector<unsigned int> devices; @@ -183,7 +183,7 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) { EXPECT_EQ(ui::ET_UNKNOWN, delegate2->last_touch_type()); EXPECT_EQ(-1, delegate2->last_touch_id()); - // 2 Touch events are targeted at the second WindowTreeHost. + // 2 Touch events are targeted at the second RootWindowHost. ui::XScopedTouchEvent touch1_begin(ui::CreateTouchEvent( 0, XI_TouchBegin, 5, gfx::Point(1500, 2500), valuators)); root_window_host1->Dispatch(touch1_begin); diff --git a/ui/aura/root_window_observer.h b/ui/aura/root_window_observer.h index 0ef86e1..bfb8e65 100644 --- a/ui/aura/root_window_observer.h +++ b/ui/aura/root_window_observer.h @@ -19,15 +19,15 @@ class Window; class AURA_EXPORT RootWindowObserver { public: // Invoked after the RootWindow's host has been resized. - virtual void OnWindowTreeHostResized(const RootWindow* root) {} + virtual void OnRootWindowHostResized(const RootWindow* root) {} // Invoked after the RootWindow's host has been moved on screen. - virtual void OnWindowTreeHostMoved(const RootWindow* root, + virtual void OnRootWindowHostMoved(const RootWindow* root, const gfx::Point& new_origin) {} // Invoked when the native windowing system sends us a request to close our // window. - virtual void OnWindowTreeHostCloseRequested(const RootWindow* root) {} + virtual void OnRootWindowHostCloseRequested(const RootWindow* root) {} // Invoked when the keyboard mapping has changed. virtual void OnKeyboardMappingChanged(const RootWindow* root) {} diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc index f985903..eccc3e8 100644 --- a/ui/aura/root_window_unittest.cc +++ b/ui/aura/root_window_unittest.cc @@ -113,7 +113,7 @@ TEST_F(RootWindowTest, OnHostMouseEvent) { gfx::Point point(101, 201); ui::MouseEvent event1( ui::ET_MOUSE_PRESSED, point, point, ui::EF_LEFT_MOUSE_BUTTON); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&event1); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&event1); // Event was tested for non-client area for the target window. EXPECT_EQ(1, delegate1->non_client_count()); @@ -154,7 +154,7 @@ TEST_F(RootWindowTest, MouseButtonState) { location, location, ui::EF_LEFT_MOUSE_BUTTON)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get()); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get()); EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); // Additionally press the right. @@ -163,7 +163,7 @@ TEST_F(RootWindowTest, MouseButtonState) { location, location, ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get()); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get()); EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); // Release the left button. @@ -172,7 +172,7 @@ TEST_F(RootWindowTest, MouseButtonState) { location, location, ui::EF_RIGHT_MOUSE_BUTTON)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get()); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get()); EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); // Release the right button. We should ignore the Shift-is-down flag. @@ -181,7 +181,7 @@ TEST_F(RootWindowTest, MouseButtonState) { location, location, ui::EF_SHIFT_DOWN)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get()); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get()); EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); // Press the middle button. @@ -190,7 +190,7 @@ TEST_F(RootWindowTest, MouseButtonState) { location, location, ui::EF_MIDDLE_MOUSE_BUTTON)); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get()); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get()); EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); } @@ -334,12 +334,12 @@ TEST_F(RootWindowTest, IgnoreUnknownKeys) { root_window()->SetEventFilter(filter); // passes ownership ui::KeyEvent unknown_event(ui::ET_KEY_PRESSED, ui::VKEY_UNKNOWN, 0, false); - EXPECT_FALSE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent( + EXPECT_FALSE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent( &unknown_event)); EXPECT_EQ(0, filter->num_key_events()); ui::KeyEvent known_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false); - EXPECT_TRUE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent( + EXPECT_TRUE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent( &known_event)); EXPECT_EQ(1, filter->num_key_events()); } @@ -352,7 +352,7 @@ TEST_F(RootWindowTest, NoDelegateWindowReceivesKeyEvents) { test::TestEventHandler handler; w1->AddPreTargetHandler(&handler); ui::KeyEvent key_press(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false); - EXPECT_TRUE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent( + EXPECT_TRUE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent( &key_press)); EXPECT_EQ(1, handler.num_key_events()); @@ -368,14 +368,14 @@ TEST_F(RootWindowTest, TouchEventsOutsideBounds) { gfx::Point position = root_window()->bounds().origin(); position.Offset(-10, -10); ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position, 0, base::TimeDelta()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_EQ(1, filter->num_touch_events()); position = root_window()->bounds().origin(); position.Offset(root_window()->bounds().width() + 10, root_window()->bounds().height() + 10); ui::TouchEvent release(ui::ET_TOUCH_RELEASED, position, 0, base::TimeDelta()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_EQ(2, filter->num_touch_events()); } @@ -397,7 +397,7 @@ TEST_F(RootWindowTest, ScrollEventDispatch) { 0, -10, 0, -10, 2); - dispatcher()->AsWindowTreeHostDelegate()->OnHostScrollEvent(&scroll1); + dispatcher()->AsRootWindowHostDelegate()->OnHostScrollEvent(&scroll1); EXPECT_EQ(1, filter->num_scroll_events()); // Scroll event on a window should be dispatched properly. @@ -408,7 +408,7 @@ TEST_F(RootWindowTest, ScrollEventDispatch) { -10, 0, -10, 0, 2); - dispatcher()->AsWindowTreeHostDelegate()->OnHostScrollEvent(&scroll2); + dispatcher()->AsRootWindowHostDelegate()->OnHostScrollEvent(&scroll2); EXPECT_EQ(2, filter->num_scroll_events()); } @@ -557,7 +557,7 @@ TEST_F(RootWindowTest, MouseMovesHeld) { ui::MouseEvent mouse_move_event(ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_move_event); // Discard MOUSE_ENTER. filter->events().clear(); @@ -567,7 +567,7 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // Check that we don't immediately dispatch the MOUSE_DRAGGED event. ui::MouseEvent mouse_dragged_event(ui::ET_MOUSE_DRAGGED, gfx::Point(0, 0), gfx::Point(0, 0), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event); EXPECT_TRUE(filter->events().empty()); @@ -575,7 +575,7 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // of event. ui::MouseEvent mouse_pressed_event(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_pressed_event); EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED", EventTypesToString(filter->events())); @@ -584,12 +584,12 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // Check that we coalesce held MOUSE_DRAGGED events. ui::MouseEvent mouse_dragged_event2(ui::ET_MOUSE_DRAGGED, gfx::Point(1, 1), gfx::Point(1, 1), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event2); EXPECT_TRUE(filter->events().empty()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_pressed_event); EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED", EventTypesToString(filter->events())); @@ -597,7 +597,7 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // Check that on ReleasePointerMoves, held events are not dispatched // immediately, but posted instead. - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event); dispatcher()->ReleasePointerMoves(); EXPECT_TRUE(filter->events().empty()); @@ -609,10 +609,10 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // the Check that on ReleasePointerMoves, held events are not dispatched // immediately, but posted instead. dispatcher()->HoldPointerMoves(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event); dispatcher()->ReleasePointerMoves(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_pressed_event); EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED", EventTypesToString(filter->events())); @@ -623,10 +623,10 @@ TEST_F(RootWindowTest, MouseMovesHeld) { // Check that if the other message is another MOUSE_DRAGGED, we still coalesce // them. dispatcher()->HoldPointerMoves(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event); dispatcher()->ReleasePointerMoves(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( &mouse_dragged_event2); EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); filter->events().clear(); @@ -647,7 +647,7 @@ TEST_F(RootWindowTest, TouchMovesHeld) { // test. ui::TouchEvent touch_pressed_event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, base::TimeDelta()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent( &touch_pressed_event); RunAllPendingInMessageLoop(); filter->events().clear(); @@ -657,13 +657,13 @@ TEST_F(RootWindowTest, TouchMovesHeld) { // Check that we don't immediately dispatch the TOUCH_MOVED event. ui::TouchEvent touch_moved_event(ui::ET_TOUCH_MOVED, gfx::Point(0, 0), 0, base::TimeDelta()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent( &touch_moved_event); EXPECT_TRUE(filter->events().empty()); // Check that on ReleasePointerMoves, held events are not dispatched // immediately, but posted instead. - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent( &touch_moved_event); dispatcher()->ReleasePointerMoves(); EXPECT_TRUE(filter->events().empty()); @@ -677,9 +677,9 @@ TEST_F(RootWindowTest, TouchMovesHeld) { 0, base::TimeDelta()); filter->events().clear(); dispatcher()->HoldPointerMoves(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent( &touch_moved_event); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent( + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent( &touch_released_event); EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_END", EventTypesToString(filter->events())); @@ -706,20 +706,20 @@ TEST_F(RootWindowTest, DispatchSyntheticMouseEvents) { // Dispatch a non-synthetic mouse event when mouse events are enabled. ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse1); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse1); EXPECT_FALSE(filter->events().empty()); filter->events().clear(); // Dispatch a synthetic mouse event when mouse events are enabled. ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10), ui::EF_IS_SYNTHESIZED); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse2); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse2); EXPECT_FALSE(filter->events().empty()); filter->events().clear(); // Dispatch a synthetic mouse event when mouse events are disabled. cursor_client.DisableMouseEvents(); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse2); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse2); EXPECT_TRUE(filter->events().empty()); } @@ -741,7 +741,7 @@ TEST_F(RootWindowTest, DispatchMouseExitWhenCursorHidden) { ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, mouse_location, mouse_location, 0); EXPECT_TRUE(filter->events().empty()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse1); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse1); EXPECT_FALSE(filter->events().empty()); filter->events().clear(); @@ -1182,7 +1182,7 @@ class ValidRootDuringDestructionWindowObserver : public aura::WindowObserver { } // namespace #if defined(USE_OZONE) -// Creating multiple WindowTreeHostOzone instances is broken. +// Creating multiple RootWindowHostOzone instances is broken. #define MAYBE_ValidRootDuringDestruction DISABLED_ValidRootDuringDestruction #else #define MAYBE_ValidRootDuringDestruction ValidRootDuringDestruction @@ -1246,8 +1246,8 @@ class DontResetHeldEventWindowDelegate : public test::TestWindowDelegate { TEST_F(RootWindowTest, DontResetHeldEvent) { DontResetHeldEventWindowDelegate delegate(root_window()); scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &delegate)); - WindowTreeHostDelegate* root_window_delegate = - static_cast<WindowTreeHostDelegate*>(root_window()->GetDispatcher()); + RootWindowHostDelegate* root_window_delegate = + static_cast<RootWindowHostDelegate*>(root_window()->GetDispatcher()); w1->SetBounds(gfx::Rect(0, 0, 40, 40)); ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), gfx::Point(10, 10), @@ -1302,7 +1302,7 @@ class DeleteRootFromHeldMouseEventDelegate : public test::TestWindowDelegate { } // namespace #if defined(USE_OZONE) -// Creating multiple WindowTreeHostOzone instances is broken. +// Creating multiple RootWindowHostOzone instances is broken. #define MAYBE_DeleteRootFromHeldMouseEvent DISABLED_DeleteRootFromHeldMouseEvent #else #define MAYBE_DeleteRootFromHeldMouseEvent DeleteRootFromHeldMouseEvent diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc index dd73933..ada197c 100644 --- a/ui/aura/test/event_generator.cc +++ b/ui/aura/test/event_generator.cc @@ -586,8 +586,8 @@ void EventGenerator::DoDispatchEvent(ui::Event* event, bool async) { } pending_events_.push_back(pending_event); } else { - WindowTreeHostDelegate* root_window_host_delegate = - current_root_window_->AsWindowTreeHostDelegate(); + RootWindowHostDelegate* root_window_host_delegate = + current_root_window_->AsRootWindowHostDelegate(); if (event->IsKeyEvent()) { root_window_host_delegate->OnHostKeyEvent( static_cast<ui::KeyEvent*>(event)); diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h index a914a20..ee9ebda 100644 --- a/ui/aura/test/event_generator.h +++ b/ui/aura/test/event_generator.h @@ -76,7 +76,7 @@ class EventGeneratorDelegate { // handled in the nested message loop. // 3) Similarly, |base::MessagePumpObserver| will not be invoked. // 4) Any other code that requires native events, such as -// tests for WindowTreeHostWin/WindowTreeHostX11. +// tests for RootWindowHostWin/RootWindowHostX11. // // If one of these applies to your test, please use |ui_controls| // package instead. diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc index 484a478..225e56e 100644 --- a/ui/aura/test/test_screen.cc +++ b/ui/aura/test/test_screen.cc @@ -24,7 +24,7 @@ TestScreen* TestScreen::Create() { // static TestScreen* TestScreen::CreateFullscreen() { - return new TestScreen(gfx::Rect(WindowTreeHost::GetNativeScreenSize())); + return new TestScreen(gfx::Rect(RootWindowHost::GetNativeScreenSize())); } TestScreen::~TestScreen() { diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc index 5d615ef..2702f2f 100644 --- a/ui/aura/window_tree_host.cc +++ b/ui/aura/window_tree_host.cc @@ -70,9 +70,9 @@ class SimpleRootWindowTransformer : public RootWindowTransformer { }; //////////////////////////////////////////////////////////////////////////////// -// WindowTreeHost, public: +// RootWindowHost, public: -WindowTreeHost::~WindowTreeHost() { +RootWindowHost::~RootWindowHost() { // TODO(beng): this represents an ordering change. In the old code, the // compositor was reset before the window hierarchy was destroyed. // verify that this has no adverse effects. @@ -81,7 +81,7 @@ WindowTreeHost::~WindowTreeHost() { compositor_.reset(); } -void WindowTreeHost::InitHost() { +void RootWindowHost::InitHost() { compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), GetBounds().size()); window()->Init(ui::LAYER_NOT_DRAWN); @@ -93,15 +93,15 @@ void WindowTreeHost::InitHost() { window()->Show(); } -aura::Window* WindowTreeHost::window() { - return const_cast<Window*>(const_cast<const WindowTreeHost*>(this)->window()); +aura::Window* RootWindowHost::window() { + return const_cast<Window*>(const_cast<const RootWindowHost*>(this)->window()); } -const aura::Window* WindowTreeHost::window() const { +const aura::Window* RootWindowHost::window() const { return delegate_->AsRootWindow()->window(); } -void WindowTreeHost::SetRootWindowTransformer( +void RootWindowHost::SetRootWindowTransformer( scoped_ptr<RootWindowTransformer> transformer) { transformer_ = transformer.Pass(); SetInsets(transformer_->GetHostInsets()); @@ -112,7 +112,7 @@ void WindowTreeHost::SetRootWindowTransformer( UpdateRootWindowSize(GetBounds().size()); } -gfx::Transform WindowTreeHost::GetRootTransform() const { +gfx::Transform RootWindowHost::GetRootTransform() const { float scale = ui::GetDeviceScaleFactor(window()->layer()); gfx::Transform transform; transform.Scale(scale, scale); @@ -120,61 +120,61 @@ gfx::Transform WindowTreeHost::GetRootTransform() const { return transform; } -void WindowTreeHost::SetTransform(const gfx::Transform& transform) { +void RootWindowHost::SetTransform(const gfx::Transform& transform) { scoped_ptr<RootWindowTransformer> transformer( new SimpleRootWindowTransformer(window(), transform)); SetRootWindowTransformer(transformer.Pass()); } -gfx::Transform WindowTreeHost::GetInverseRootTransform() const { +gfx::Transform RootWindowHost::GetInverseRootTransform() const { float scale = ui::GetDeviceScaleFactor(window()->layer()); gfx::Transform transform; transform.Scale(1.0f / scale, 1.0f / scale); return transformer_->GetInverseTransform() * transform; } -void WindowTreeHost::UpdateRootWindowSize(const gfx::Size& host_size) { +void RootWindowHost::UpdateRootWindowSize(const gfx::Size& host_size) { window()->SetBounds(transformer_->GetRootWindowBounds(host_size)); } -void WindowTreeHost::ConvertPointToNativeScreen(gfx::Point* point) const { +void RootWindowHost::ConvertPointToNativeScreen(gfx::Point* point) const { ConvertPointToHost(point); gfx::Point location = GetLocationOnNativeScreen(); point->Offset(location.x(), location.y()); } -void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const { +void RootWindowHost::ConvertPointFromNativeScreen(gfx::Point* point) const { gfx::Point location = GetLocationOnNativeScreen(); point->Offset(-location.x(), -location.y()); ConvertPointFromHost(point); } -void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const { +void RootWindowHost::ConvertPointToHost(gfx::Point* point) const { gfx::Point3F point_3f(*point); GetRootTransform().TransformPoint(&point_3f); *point = gfx::ToFlooredPoint(point_3f.AsPointF()); } -void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const { +void RootWindowHost::ConvertPointFromHost(gfx::Point* point) const { gfx::Point3F point_3f(*point); GetInverseRootTransform().TransformPoint(&point_3f); *point = gfx::ToFlooredPoint(point_3f.AsPointF()); } //////////////////////////////////////////////////////////////////////////////// -// WindowTreeHost, protected: +// RootWindowHost, protected: -WindowTreeHost::WindowTreeHost() +RootWindowHost::RootWindowHost() : delegate_(NULL) { } -void WindowTreeHost::CreateCompositor( +void RootWindowHost::CreateCompositor( gfx::AcceleratedWidget accelerated_widget) { compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); DCHECK(compositor_.get()); } -void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { +void RootWindowHost::NotifyHostResized(const gfx::Size& new_size) { // The compositor should have the same size as the native root window host. // Get the latest scale from display because it might have been changed. compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h index ba48000..8e1ddd0 100644 --- a/ui/aura/window_tree_host.h +++ b/ui/aura/window_tree_host.h @@ -27,18 +27,18 @@ class Compositor; namespace aura { class RootWindow; -class WindowTreeHostDelegate; +class RootWindowHostDelegate; class RootWindowTransformer; -// WindowTreeHost bridges between a native window and the embedded RootWindow. +// RootWindowHost bridges between a native window and the embedded RootWindow. // It provides the accelerated widget and maps events from the native os to // aura. -class AURA_EXPORT WindowTreeHost { +class AURA_EXPORT RootWindowHost { public: - virtual ~WindowTreeHost(); + virtual ~RootWindowHost(); - // Creates a new WindowTreeHost. The caller owns the returned value. - static WindowTreeHost* Create(const gfx::Rect& bounds); + // Creates a new RootWindowHost. The caller owns the returned value. + static RootWindowHost* Create(const gfx::Rect& bounds); void InitHost(); @@ -63,7 +63,7 @@ class AURA_EXPORT WindowTreeHost { // (gfx::Screen only reports on the virtual desktop exposed by Aura.) static gfx::Size GetNativeScreenSize(); - void set_delegate(WindowTreeHostDelegate* delegate) { + void set_delegate(RootWindowHostDelegate* delegate) { delegate_ = delegate; } @@ -87,16 +87,16 @@ class AURA_EXPORT WindowTreeHost { // Returns the accelerated widget. virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; - // Shows the WindowTreeHost. + // Shows the RootWindowHost. virtual void Show() = 0; - // Hides the WindowTreeHost. + // Hides the RootWindowHost. virtual void Hide() = 0; // Toggles the host's full screen state. virtual void ToggleFullScreen() = 0; - // Gets/Sets the size of the WindowTreeHost. + // Gets/Sets the size of the RootWindowHost. virtual gfx::Rect GetBounds() const = 0; virtual void SetBounds(const gfx::Rect& bounds) = 0; @@ -148,7 +148,7 @@ class AURA_EXPORT WindowTreeHost { protected: friend class TestScreen; // TODO(beng): see if we can remove/consolidate. - WindowTreeHost(); + RootWindowHost(); void CreateCompositor(gfx::AcceleratedWidget accelerated_widget); @@ -157,14 +157,14 @@ class AURA_EXPORT WindowTreeHost { void NotifyHostResized(const gfx::Size& new_size); - WindowTreeHostDelegate* delegate_; + RootWindowHostDelegate* delegate_; private: scoped_ptr<ui::Compositor> compositor_; scoped_ptr<RootWindowTransformer> transformer_; - DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); + DISALLOW_COPY_AND_ASSIGN(RootWindowHost); }; } // namespace aura diff --git a/ui/aura/window_tree_host_delegate.h b/ui/aura/window_tree_host_delegate.h index efdffc3..e99903b 100644 --- a/ui/aura/window_tree_host_delegate.h +++ b/ui/aura/window_tree_host_delegate.h @@ -25,9 +25,9 @@ namespace aura { class RootWindow; -// A private interface used by WindowTreeHost implementations to communicate +// A private interface used by RootWindowHost implementations to communicate // with their owning RootWindow. -class AURA_EXPORT WindowTreeHostDelegate { +class AURA_EXPORT RootWindowHostDelegate { public: virtual bool OnHostKeyEvent(ui::KeyEvent* event) = 0; virtual bool OnHostMouseEvent(ui::MouseEvent* event) = 0; @@ -52,7 +52,7 @@ class AURA_EXPORT WindowTreeHostDelegate { virtual const RootWindow* AsRootWindow() const = 0; protected: - virtual ~WindowTreeHostDelegate() {} + virtual ~RootWindowHostDelegate() {} }; } // namespace aura diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 4802716..a891825 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -488,13 +488,13 @@ TEST_F(WindowTest, HitTest) { ui::TouchEvent pressed( ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&pressed); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&pressed); EXPECT_TRUE(w1.HitTest(gfx::Point(-2, -2))); EXPECT_TRUE(w1.HitTest(gfx::Point(-5, -5))); EXPECT_FALSE(w1.HitTest(gfx::Point(-5, -6))); ui::TouchEvent released( ui::ET_TOUCH_RELEASED, gfx::Point(50, 50), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&released); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&released); EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2))); // TODO(beng): clip Window to parent. @@ -845,7 +845,7 @@ TEST_F(WindowTest, CaptureTests) { ui::TouchEvent touchev( ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&touchev); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev); EXPECT_EQ(1, delegate.touch_event_count()); delegate.ResetCounts(); @@ -861,7 +861,7 @@ TEST_F(WindowTest, CaptureTests) { ui::TouchEvent touchev2( ui::ET_TOUCH_PRESSED, gfx::Point(250, 250), 1, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&touchev2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2); EXPECT_EQ(0, delegate.touch_event_count()); // Removing the capture window from parent should reset the capture window @@ -884,7 +884,7 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { // Press on w1. ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. EXPECT_EQ(2, delegate1.gesture_event_count()); delegate1.ResetCounts(); @@ -898,7 +898,7 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { // Events now go to w2. ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_EQ(0, delegate1.gesture_event_count()); EXPECT_EQ(0, delegate1.touch_event_count()); EXPECT_EQ(0, delegate2.gesture_event_count()); @@ -906,14 +906,14 @@ TEST_F(WindowTest, TouchCaptureCancelsOtherTouches) { ui::TouchEvent release( ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_EQ(0, delegate1.gesture_event_count()); EXPECT_EQ(0, delegate2.gesture_event_count()); // A new press is captured by w2. ui::TouchEvent press2( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); EXPECT_EQ(0, delegate1.gesture_event_count()); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. EXPECT_EQ(2, delegate2.gesture_event_count()); @@ -935,7 +935,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. EXPECT_EQ(2, delegate.gesture_event_count()); @@ -950,7 +950,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { // On move We will get TOUCH_MOVED, GESTURE_TAP_CANCEL, // GESTURE_SCROLL_START and GESTURE_SCROLL_UPDATE. ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); EXPECT_EQ(1, delegate.touch_event_count()); EXPECT_EQ(3, delegate.gesture_event_count()); delegate.ResetCounts(); @@ -963,7 +963,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { // On move we still get TOUCH_MOVED and GESTURE_SCROLL_UPDATE. ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(10, 30), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); EXPECT_EQ(1, delegate.touch_event_count()); EXPECT_EQ(1, delegate.gesture_event_count()); delegate.ResetCounts(); @@ -971,7 +971,7 @@ TEST_F(WindowTest, TouchCaptureDoesntCancelCapturedTouches) { // And on release we get TOUCH_RELEASED, GESTURE_SCROLL_END, GESTURE_END ui::TouchEvent release( ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); EXPECT_EQ(1, delegate.touch_event_count()); EXPECT_EQ(2, delegate.gesture_event_count()); } @@ -984,7 +984,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { scoped_ptr<Window> w1(CreateTestWindowWithDelegate( &d1, 0, gfx::Rect(0, 0, 20, 20), root_window())); ui::TouchEvent p1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&p1); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p1); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN. EXPECT_EQ(1, d1.touch_event_count()); EXPECT_EQ(2, d1.gesture_event_count()); @@ -995,7 +995,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { scoped_ptr<Window> w2(CreateTestWindowWithDelegate( &d2, 0, gfx::Rect(40, 0, 40, 20), root_window())); ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), 1, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&p2); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p2); EXPECT_EQ(0, d1.touch_event_count()); EXPECT_EQ(0, d1.gesture_event_count()); // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN for new target window. @@ -1031,7 +1031,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { // Move touch id originally associated with |w2|. Since capture was transfered // from 2 to 3 only |w3| should get the event. ui::TouchEvent m3(ui::ET_TOUCH_MOVED, gfx::Point(110, 105), 1, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&m3); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&m3); EXPECT_EQ(0, d1.touch_event_count()); EXPECT_EQ(0, d1.gesture_event_count()); EXPECT_EQ(0, d2.touch_event_count()); @@ -1054,7 +1054,7 @@ TEST_F(WindowTest, TransferCaptureTouchEvents) { // And when we move the touch again, |w3| still gets the events. ui::TouchEvent m4(ui::ET_TOUCH_MOVED, gfx::Point(120, 105), 1, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&m4); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&m4); EXPECT_EQ(0, d1.touch_event_count()); EXPECT_EQ(0, d1.gesture_event_count()); EXPECT_EQ(0, d2.touch_event_count()); @@ -1205,7 +1205,7 @@ TEST_F(WindowTest, MouseEnterExit) { } // Verifies that the WindowDelegate receives MouseExit from ET_MOUSE_EXITED. -TEST_F(WindowTest, WindowTreeHostExit) { +TEST_F(WindowTest, RootWindowHostExit) { MouseEnterExitWindowDelegate d1; scoped_ptr<Window> w1( CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), @@ -1219,7 +1219,7 @@ TEST_F(WindowTest, WindowTreeHostExit) { ui::MouseEvent exit_event( ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), 0); - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&exit_event); + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&exit_event); EXPECT_FALSE(d1.entered()); EXPECT_TRUE(d1.exited()); } @@ -1576,7 +1576,7 @@ TEST_F(WindowTest, TransformGesture) { ui::TouchEvent press( ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime()); - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press); + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); EXPECT_EQ(gfx::Point(10, 10).ToString(), delegate->position().ToString()); } |