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

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: cleanup 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
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..e2899ba408925d393e644615533ae05a7f6b9ece 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,20 @@ 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.
+ // 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
James Cook 2016/08/12 16:08:53 nit: Must -> must and rewrap lines Thanks for the
sky 2016/08/12 17:59:37 Done.
+ // destruction.
+ // Two sets of observers are maintained, one for observers not needing
+ // moves |pointer_watchers_| and |move_pointer_watchers_| for those observers
+ // wanting moves too.
base::ObserverList<views::PointerWatcher, true> pointer_watchers_;
James Cook 2016/08/12 16:08:53 optional: Maybe non_move_pointer_watchers_? If th
sky 2016/08/12 17:59:37 I like non_move_watchers_ and move_watchers_. Done
+ base::ObserverList<views::PointerWatcher, true> move_pointer_watchers_;
James Cook 2016/08/12 16:08:53 Or maybe this one should be called |pointer_watche
DISALLOW_COPY_AND_ASSIGN(PointerWatcherDelegateAura);
};

Powered by Google App Engine
This is Rietveld 408576698