Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: ash/pointer_watcher_delegate_aura.h

Issue 1949823002: WIP: Eliminate event.target() usage from TrayEventFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: container delegate Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | ash/pointer_watcher_delegate_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 { 11 namespace gfx {
12 class Point; 12 class Point;
13 } 13 }
14 14
15 namespace ui { 15 namespace ui {
16 class LocatedEvent; 16 class LocatedEvent;
17 } 17 }
18 18
19 namespace views {
20 class Widget;
21 }
22
19 namespace ash { 23 namespace ash {
20 24
21 // Support for PointerWatchers in non-mus ash, implemented with a pre-target 25 // Support for PointerWatchers in non-mus ash, implemented with a pre-target
22 // EventHandler on the Shell. 26 // EventHandler on the Shell.
23 class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate, 27 class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate,
24 public ui::EventHandler { 28 public ui::EventHandler {
25 public: 29 public:
26 PointerWatcherDelegateAura(); 30 PointerWatcherDelegateAura();
27 ~PointerWatcherDelegateAura() override; 31 ~PointerWatcherDelegateAura() override;
28 32
29 // PointerWatcherDelegate: 33 // PointerWatcherDelegate:
30 void AddPointerWatcher(views::PointerWatcher* watcher) override; 34 void AddPointerWatcher(views::PointerWatcher* watcher) override;
31 void RemovePointerWatcher(views::PointerWatcher* watcher) override; 35 void RemovePointerWatcher(views::PointerWatcher* watcher) override;
32 36
33 // ui::EventHandler: 37 // ui::EventHandler:
34 void OnMouseEvent(ui::MouseEvent* event) override; 38 void OnMouseEvent(ui::MouseEvent* event) override;
35 void OnTouchEvent(ui::TouchEvent* event) override; 39 void OnTouchEvent(ui::TouchEvent* event) override;
36 40
37 private: 41 private:
42 views::Widget* GetTargetWidget(const ui::LocatedEvent& event) const;
38 gfx::Point GetLocationInScreen(const ui::LocatedEvent& event) const; 43 gfx::Point GetLocationInScreen(const ui::LocatedEvent& event) const;
39 44
40 // Must be empty on destruction. 45 // Must be empty on destruction.
41 base::ObserverList<views::PointerWatcher, true> pointer_watchers_; 46 base::ObserverList<views::PointerWatcher, true> pointer_watchers_;
42 47
43 DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura); 48 DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura);
44 }; 49 };
45 50
46 } // namespace ash 51 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/shell_delegate_mus.cc ('k') | ash/pointer_watcher_delegate_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698