OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/event_monitor_aura.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/aura/env.h" |
| 9 |
| 10 namespace views { |
| 11 |
| 12 // static |
| 13 EventMonitor* EventMonitor::Create(ui::EventHandler* event_handler) { |
| 14 return new EventMonitorAura(event_handler); |
| 15 } |
| 16 |
| 17 // static |
| 18 gfx::Point EventMonitor::GetLastMouseLocation() { |
| 19 return aura::Env::last_mouse_location(); |
| 20 } |
| 21 |
| 22 EventMonitorAura::EventMonitorAura(ui::EventHandler* event_handler) |
| 23 : event_handler_(event_handler) { |
| 24 DCHECK(event_handler_); |
| 25 aura::Env::GetInstance()->AddPreTargetHandler(event_handler_); |
| 26 } |
| 27 |
| 28 EventMonitorAura::~EventMonitorAura() { |
| 29 aura::Env::GetInstance()->RemovePreTargetHandler(event_handler_); |
| 30 } |
| 31 |
| 32 } // namespace views |
OLD | NEW |