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

Unified Diff: ash/pointer_watcher_delegate_aura.h

Issue 2235363003: Wires up WmShellMus::Add/RemovePointerWatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pointer_watcher_capture
Patch Set: merge to tot again Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/window_manager.cc ('k') | ash/pointer_watcher_delegate_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/pointer_watcher_delegate_aura.h
diff --git a/ash/pointer_watcher_delegate_aura.h b/ash/pointer_watcher_delegate_aura.h
index 1bea01d1b57409a73407ccc832ee7f94883d03d7..2c47e20ed72cf1d40c71f6284897a36e5c0b26a9 100644
--- a/ash/pointer_watcher_delegate_aura.h
+++ b/ash/pointer_watcher_delegate_aura.h
@@ -14,6 +14,7 @@ class Point;
namespace ui {
class LocatedEvent;
+class PointerEvent;
}
namespace views {
@@ -31,7 +32,8 @@ class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate,
~PointerWatcherDelegateAura() override;
// PointerWatcherDelegate:
- void AddPointerWatcher(views::PointerWatcher* watcher) override;
+ void AddPointerWatcher(views::PointerWatcher* watcher,
+ bool wants_moves) override;
void RemovePointerWatcher(views::PointerWatcher* watcher) override;
// ui::EventHandler:
@@ -42,8 +44,19 @@ class ASH_EXPORT PointerWatcherDelegateAura : public PointerWatcherDelegate,
gfx::Point GetLocationInScreen(const ui::LocatedEvent& event) const;
views::Widget* GetTargetWidget(const ui::LocatedEvent& event) const;
- // Must be empty on destruction.
- base::ObserverList<views::PointerWatcher, true> pointer_watchers_;
+ // Calls OnPointerEventObserved() on the appropriate set of watchers as
+ // determined by the type of event. |original_event| is the original
+ // event supplied to OnMouseEvent()/OnTouchEvent(), |pointer_event| is
+ // |original_event| converted to a PointerEvent.
+ void NotifyWatchers(const ui::PointerEvent& pointer_event,
+ const ui::LocatedEvent& original_event);
+
+ // The true parameter to ObserverList indicates the list must be empty on
+ // destruction. Two sets of observers are maintained, one for observers not
+ // needing moves |non_move_watchers_| and |move_watchers_| for those
+ // observers wanting moves too.
+ base::ObserverList<views::PointerWatcher, true> non_move_watchers_;
+ base::ObserverList<views::PointerWatcher, true> move_watchers_;
DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura);
};
« no previous file with comments | « ash/mus/window_manager.cc ('k') | ash/pointer_watcher_delegate_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698