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

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

Issue 2291193003: arc: Fix mouse scroll on notification (Closed)
Patch Set: handle mouse wheel and move forwarding to widget code into EventForwarder 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..a44364356e0ff83360a31cb8a8017de442c91c3e 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -40,7 +40,30 @@ 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())
yoshiki 2016/08/31 18:04:37 nit: as we discussed in chat, please add a comment
xiyuan 2016/08/31 18:08:23 Done.
+ 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