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

Unified Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2291193003: arc: Fix mouse scroll on notification (Closed)
Patch Set: comment on why not forward touches 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_view.cc
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc
index b17c2344b27f5c27eac41b543205558d04edd53c..c9fe786ae25db61b62a90b1df94997dcaf5a2a7d 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -40,7 +40,33 @@ class ArcCustomNotificationView::EventForwarder : public ui::EventHandler {
return;
}
- owner_->OnEvent(event);
+ if (event->IsScrollEvent()) {
+ ForwardScrollEvent(event->AsScrollEvent());
+ } else if (event->IsMouseWheelEvent()) {
+ ForwardMouseWheelEvent(event->AsMouseWheelEvent());
+ } else if (!event->IsTouchEvent()) {
+ // Forward the rest events to |owner_| except touches because View
+ // should no longer receive touch events. See View::OnTouchEvent.
+ owner_->OnEvent(event);
+ }
+ }
+
+ void ForwardScrollEvent(ui::ScrollEvent* event) {
+ views::Widget* widget = owner_->GetWidget();
+ if (!widget)
+ return;
+
+ event->target()->ConvertEventToTarget(widget->GetNativeWindow(), event);
+ widget->OnScrollEvent(event);
+ }
+
+ void ForwardMouseWheelEvent(ui::MouseWheelEvent* event) {
+ views::Widget* widget = owner_->GetWidget();
+ if (!widget)
+ return;
+
+ event->target()->ConvertEventToTarget(widget->GetNativeWindow(), event);
+ widget->OnMouseEvent(event);
}
ArcCustomNotificationView* const owner_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698