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

Unified Diff: ash/pointer_watcher_delegate_aura.cc

Issue 2183163002: mus: Change PointerWatcher to observe all pointer events, with moves optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to use PointerEvent. Created 4 years, 5 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.cc
diff --git a/ash/pointer_watcher_delegate_aura.cc b/ash/pointer_watcher_delegate_aura.cc
index d70720d5a1932395559a707fb2e3defc33ac896f..c2707c47fbeab333d4f482ef139210895547ef23 100644
--- a/ash/pointer_watcher_delegate_aura.cc
+++ b/ash/pointer_watcher_delegate_aura.cc
@@ -34,17 +34,25 @@ void PointerWatcherDelegateAura::RemovePointerWatcher(
}
void PointerWatcherDelegateAura::OnMouseEvent(ui::MouseEvent* event) {
- if (event->type() == ui::ET_MOUSE_PRESSED)
- FOR_EACH_OBSERVER(views::PointerWatcher, pointer_watchers_,
- OnMousePressed(*event, GetLocationInScreen(*event),
- GetTargetWidget(*event)));
+ // For compatibility with the mus version, don't send moves.
+ if (event->type() == ui::ET_MOUSE_MOVED)
+ return;
+ ui::PointerEvent mouse_pointer_event(*event);
+ FOR_EACH_OBSERVER(
+ views::PointerWatcher, pointer_watchers_,
+ OnPointerWatcherEvent(mouse_pointer_event, GetLocationInScreen(*event),
+ GetTargetWidget(*event)));
}
void PointerWatcherDelegateAura::OnTouchEvent(ui::TouchEvent* event) {
- if (event->type() == ui::ET_TOUCH_PRESSED)
- FOR_EACH_OBSERVER(views::PointerWatcher, pointer_watchers_,
- OnTouchPressed(*event, GetLocationInScreen(*event),
- GetTargetWidget(*event)));
+ // For compatibility with the mus version, don't send moves.
+ if (event->type() == ui::ET_TOUCH_MOVED)
+ return;
+ ui::PointerEvent touch_pointer_event(*event);
+ FOR_EACH_OBSERVER(
+ views::PointerWatcher, pointer_watchers_,
+ OnPointerWatcherEvent(touch_pointer_event, GetLocationInScreen(*event),
+ GetTargetWidget(*event)));
}
gfx::Point PointerWatcherDelegateAura::GetLocationInScreen(

Powered by Google App Engine
This is Rietveld 408576698