| 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 16 matching lines...) Expand all Loading... |
| 27 last_touch_id_(-1), | 27 last_touch_id_(-1), |
| 28 last_touch_location_(0, 0) { | 28 last_touch_location_(0, 0) { |
| 29 target_->AddPreTargetHandler(this); | 29 target_->AddPreTargetHandler(this); |
| 30 } | 30 } |
| 31 virtual ~RootWindowEventHandler() { target_->RemovePreTargetHandler(this); } | 31 virtual ~RootWindowEventHandler() { target_->RemovePreTargetHandler(this); } |
| 32 | 32 |
| 33 // ui::EventHandler: | 33 // ui::EventHandler: |
| 34 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE { | 34 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE { |
| 35 last_touch_id_ = event->touch_id(); | 35 last_touch_id_ = event->touch_id(); |
| 36 last_touch_type_ = event->type(); | 36 last_touch_type_ = event->type(); |
| 37 last_touch_location_ = event->location(); | 37 last_touch_location_ = gfx::ToFlooredPoint(event->location()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 ui::EventType last_touch_type() { return last_touch_type_; } | 40 ui::EventType last_touch_type() { return last_touch_type_; } |
| 41 | 41 |
| 42 int last_touch_id() { return last_touch_id_; } | 42 int last_touch_id() { return last_touch_id_; } |
| 43 | 43 |
| 44 gfx::Point last_touch_location() { return last_touch_location_; } | 44 gfx::Point last_touch_location() { return last_touch_location_; } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 ui::EventTarget* target_; | 47 ui::EventTarget* target_; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 handler2.reset(); | 228 handler2.reset(); |
| 229 | 229 |
| 230 // Revert the CrOS testing env otherwise the following non-CrOS aura | 230 // Revert the CrOS testing env otherwise the following non-CrOS aura |
| 231 // tests will fail. | 231 // tests will fail. |
| 232 // Fake a ChromeOS running env. | 232 // Fake a ChromeOS running env. |
| 233 kLsbRelease = ""; | 233 kLsbRelease = ""; |
| 234 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); | 234 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time()); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace aura | 237 } // namespace aura |
| OLD | NEW |