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 d640556c32c2f29ddc19f24d7f48010a9cb6f930..39c3c6e4337eb5797c2e18d6bbb02ad7862aee98 100644 |
--- a/ui/arc/notification/arc_custom_notification_view.cc |
+++ b/ui/arc/notification/arc_custom_notification_view.cc |
@@ -553,9 +553,12 @@ bool ArcCustomNotificationView::OnMousePressed(const ui::MouseEvent& event) { |
// All mouse clicks or touches should be sent to corresponding Android view |
// because the surface is on this view, so receiving a mouse pressed event |
// means the event is generated by automation API. |
+ // We can distinguish events from automation API by checking the target of the |
+ // event because the target of all events generated by automation API is set |
+ // to nullptr. |
if (event.IsOnlyLeftMouseButton() && |
item_->expand_state() != mojom::ArcNotificationExpandState::FIXED_SIZE && |
- event.target() != surface_->window()) { |
+ event.target() == nullptr) { |
item_->ToggleExpansion(); |
return true; |
} |