| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ash_export.h" | 5 #include "ash/ash_export.h" |
| 6 #include "ash/pointer_watcher_delegate.h" | 6 #include "ash/pointer_watcher_delegate.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "ui/events/event_handler.h" | 9 #include "ui/events/event_handler.h" |
| 10 | 10 |
| 11 namespace gfx { |
| 12 class Point; |
| 13 } |
| 14 |
| 15 namespace ui { |
| 16 class LocatedEvent; |
| 17 } |
| 18 |
| 11 namespace ash { | 19 namespace ash { |
| 12 | 20 |
| 13 // Support for PointerWatchers in non-mus ash, implemented with a pre-target | 21 // Support for PointerWatchers in non-mus ash, implemented with a pre-target |
| 14 // EventHandler on the Shell. | 22 // EventHandler on the Shell. |
| 15 class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate, | 23 class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate, |
| 16 public ui::EventHandler { | 24 public ui::EventHandler { |
| 17 public: | 25 public: |
| 18 PointerWatcherDelegateAura(); | 26 PointerWatcherDelegateAura(); |
| 19 ~PointerWatcherDelegateAura() override; | 27 ~PointerWatcherDelegateAura() override; |
| 20 | 28 |
| 21 // PointerWatcherDelegate: | 29 // PointerWatcherDelegate: |
| 22 void AddPointerWatcher(views::PointerWatcher* watcher) override; | 30 void AddPointerWatcher(views::PointerWatcher* watcher) override; |
| 23 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | 31 void RemovePointerWatcher(views::PointerWatcher* watcher) override; |
| 24 | 32 |
| 25 // ui::EventHandler: | 33 // ui::EventHandler: |
| 26 void OnMouseEvent(ui::MouseEvent* event) override; | 34 void OnMouseEvent(ui::MouseEvent* event) override; |
| 27 void OnTouchEvent(ui::TouchEvent* event) override; | 35 void OnTouchEvent(ui::TouchEvent* event) override; |
| 28 | 36 |
| 29 private: | 37 private: |
| 38 gfx::Point GetLocationInScreen(const ui::LocatedEvent& event) const; |
| 39 |
| 30 // Must be empty on destruction. | 40 // Must be empty on destruction. |
| 31 base::ObserverList<views::PointerWatcher, true> pointer_watchers_; | 41 base::ObserverList<views::PointerWatcher, true> pointer_watchers_; |
| 32 | 42 |
| 33 DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura); | 43 DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura); |
| 34 }; | 44 }; |
| 35 | 45 |
| 36 } // namespace ash | 46 } // namespace ash |
| OLD | NEW |