| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/host/ash_window_tree_host_x11.h" | 5 #include "ash/host/ash_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #undef None | 7 #undef None |
| 8 #undef Bool | 8 #undef Bool |
| 9 | 9 |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 : target_(host->window()), | 26 : target_(host->window()), |
| 27 last_touch_type_(ui::ET_UNKNOWN), | 27 last_touch_type_(ui::ET_UNKNOWN), |
| 28 last_touch_id_(-1), | 28 last_touch_id_(-1), |
| 29 last_touch_location_(0, 0) { | 29 last_touch_location_(0, 0) { |
| 30 target_->AddPreTargetHandler(this); | 30 target_->AddPreTargetHandler(this); |
| 31 } | 31 } |
| 32 ~RootWindowEventHandler() override { target_->RemovePreTargetHandler(this); } | 32 ~RootWindowEventHandler() override { target_->RemovePreTargetHandler(this); } |
| 33 | 33 |
| 34 // ui::EventHandler: | 34 // ui::EventHandler: |
| 35 void OnTouchEvent(ui::TouchEvent* event) override { | 35 void OnTouchEvent(ui::TouchEvent* event) override { |
| 36 last_touch_id_ = event->touch_id(); | 36 last_touch_id_ = event->pointer_details().id; |
| 37 last_touch_type_ = event->type(); | 37 last_touch_type_ = event->type(); |
| 38 last_touch_location_ = event->location(); | 38 last_touch_location_ = event->location(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ui::EventType last_touch_type() { return last_touch_type_; } | 41 ui::EventType last_touch_type() { return last_touch_type_; } |
| 42 | 42 |
| 43 int last_touch_id() { return last_touch_id_; } | 43 int last_touch_id() { return last_touch_id_; } |
| 44 | 44 |
| 45 gfx::Point last_touch_location() { return last_touch_location_; } | 45 gfx::Point last_touch_location() { return last_touch_location_; } |
| 46 | 46 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 EXPECT_EQ(gfx::Point(0, 0), handler1->last_touch_location()); | 255 EXPECT_EQ(gfx::Point(0, 0), handler1->last_touch_location()); |
| 256 EXPECT_EQ(ui::ET_TOUCH_RELEASED, handler2->last_touch_type()); | 256 EXPECT_EQ(ui::ET_TOUCH_RELEASED, handler2->last_touch_type()); |
| 257 EXPECT_EQ(1, handler2->last_touch_id()); | 257 EXPECT_EQ(1, handler2->last_touch_id()); |
| 258 EXPECT_EQ(gfx::Point(1600, 2650), handler2->last_touch_location()); | 258 EXPECT_EQ(gfx::Point(1600, 2650), handler2->last_touch_location()); |
| 259 | 259 |
| 260 handler1.reset(); | 260 handler1.reset(); |
| 261 handler2.reset(); | 261 handler2.reset(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace aura | 264 } // namespace aura |
| OLD | NEW |