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

Unified Diff: ash/pointer_watcher_delegate_aura.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/pointer_watcher_delegate_aura.h ('k') | ash/shelf/overflow_bubble.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/pointer_watcher_delegate_aura.cc
diff --git a/ash/pointer_watcher_delegate_aura.cc b/ash/pointer_watcher_delegate_aura.cc
index 413ea71bb58bd019f77ac92646754bfb1207b0a6..67becb93e4bcc23e457d5e79ecbb03c7276087a5 100644
--- a/ash/pointer_watcher_delegate_aura.cc
+++ b/ash/pointer_watcher_delegate_aura.cc
@@ -11,6 +11,7 @@
#include "ui/events/event_constants.h"
#include "ui/gfx/geometry/point.h"
#include "ui/views/pointer_watcher.h"
+#include "ui/views/widget/widget.h"
namespace ash {
@@ -35,13 +36,21 @@ 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)));
+ OnMousePressed(*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)));
+ OnTouchPressed(*event, GetLocationInScreen(*event),
+ GetTargetWidget(*event)));
+}
+
+views::Widget* PointerWatcherDelegateAura::GetTargetWidget(
+ const ui::LocatedEvent& event) const {
+ aura::Window* window = static_cast<aura::Window*>(event.target());
+ return views::Widget::GetTopLevelWidgetForNativeView(window);
}
gfx::Point PointerWatcherDelegateAura::GetLocationInScreen(
« no previous file with comments | « ash/pointer_watcher_delegate_aura.h ('k') | ash/shelf/overflow_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698