Chromium Code Reviews| 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_; |