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

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

Issue 2767253005: Implement TOGGLE_EXPANSION action for the ARC notifications. (Closed)
Patch Set: rebase Created 3 years, 9 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 | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/arc/notification/arc_notification_item.h » ('j') | 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 908e49eff5660a854f1c04ccbb43df91d67db0c6..d640556c32c2f29ddc19f24d7f48010a9cb6f930 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -547,6 +547,21 @@ views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() {
return nullptr;
}
+bool ArcCustomNotificationView::OnMousePressed(const ui::MouseEvent& event) {
+ // TODO(yhanada): Remove this hack as soon as possible after letting
+ // accessible actions be delivered to this view.
+ // 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.
+ if (event.IsOnlyLeftMouseButton() &&
+ item_->expand_state() != mojom::ArcNotificationExpandState::FIXED_SIZE &&
+ event.target() != surface_->window()) {
+ item_->ToggleExpansion();
+ return true;
+ }
+ return false;
+}
+
void ArcCustomNotificationView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (item_ && !item_->pinned() && sender == close_button_.get()) {
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/arc/notification/arc_notification_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698