Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/arc/notification/arc_custom_notification_view.h" | 5 #include "ui/arc/notification/arc_custom_notification_view.h" |
| 6 | 6 |
| 7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "components/exo/notification_surface.h" | 10 #include "components/exo/notification_surface.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // ui::EventHandler | 37 // ui::EventHandler |
| 38 void OnEvent(ui::Event* event) override { | 38 void OnEvent(ui::Event* event) override { |
| 39 // Do not forward event targeted to the floating close button so that | 39 // Do not forward event targeted to the floating close button so that |
| 40 // keyboard press and tap are handled properly. | 40 // keyboard press and tap are handled properly. |
| 41 if (owner_->floating_control_buttons_widget_ && event->target() && | 41 if (owner_->floating_control_buttons_widget_ && event->target() && |
| 42 owner_->floating_control_buttons_widget_->GetNativeWindow() == | 42 owner_->floating_control_buttons_widget_->GetNativeWindow() == |
| 43 event->target()) { | 43 event->target()) { |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Tap gestures are handled on the Android side, so drop them here. | |
| 48 // See crbug.com/709911. | |
| 49 if (event->type() == ui::ET_GESTURE_TAP) { | |
| 50 return; | |
| 51 } | |
| 52 | |
| 47 if (event->IsScrollEvent()) { | 53 if (event->IsScrollEvent()) { |
| 48 ForwardScrollEvent(event->AsScrollEvent()); | 54 ForwardScrollEvent(event->AsScrollEvent()); |
| 49 } else if (event->IsMouseWheelEvent()) { | 55 } else if (event->IsMouseWheelEvent()) { |
| 50 ForwardMouseWheelEvent(event->AsMouseWheelEvent()); | 56 ForwardMouseWheelEvent(event->AsMouseWheelEvent()); |
| 51 } else if (!event->IsTouchEvent()) { | 57 } else if (!event->IsTouchEvent()) { |
|
yhanada
2017/04/10 09:18:13
How about adding |event->type() != ui::ET_GESTURE_
Eliot Courtney
2017/04/11 06:27:21
Done.
| |
| 52 // TODO(yoshiki): Use a better tigger (eg. focusing EditText on | 58 // TODO(yoshiki): Use a better tigger (eg. focusing EditText on |
| 53 // notification) than clicking (crbug.com/697379). | 59 // notification) than clicking (crbug.com/697379). |
| 54 if (event->type() == ui::ET_MOUSE_PRESSED) | 60 if (event->type() == ui::ET_MOUSE_PRESSED) |
| 55 owner_->ActivateToast(); | 61 owner_->ActivateToast(); |
| 56 | 62 |
| 57 // Forward the rest events to |owner_| except touches because View | 63 // Forward the rest events to |owner_| except touches because View |
| 58 // should no longer receive touch events. See View::OnTouchEvent. | 64 // should no longer receive touch events. See View::OnTouchEvent. |
| 59 owner_->OnEvent(event); | 65 owner_->OnEvent(event); |
| 60 } | 66 } |
| 61 } | 67 } |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 | 623 |
| 618 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( | 624 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( |
| 619 exo::NotificationSurface* surface) { | 625 exo::NotificationSurface* surface) { |
| 620 if (surface->notification_id() != notification_key_) | 626 if (surface->notification_id() != notification_key_) |
| 621 return; | 627 return; |
| 622 | 628 |
| 623 SetSurface(nullptr); | 629 SetSurface(nullptr); |
| 624 } | 630 } |
| 625 | 631 |
| 626 } // namespace arc | 632 } // namespace arc |
| OLD | NEW |