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

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

Issue 2800373002: Remove hack for handling accessibility action on ARC notifications. (Closed)
Patch Set: "ui/accessibility:accessibility" -> "ui/accessibility" Created 3 years, 8 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
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 0c8c2ea404313552bb7e8ac750756954ab1e9fad..57c03447773177b2bc22842c18d16fb401c21205 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -9,6 +9,7 @@
#include "base/memory/ptr_util.h"
#include "components/exo/notification_surface.h"
#include "components/exo/surface.h"
+#include "ui/accessibility/ax_action_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/layer_animation_observer.h"
@@ -624,18 +625,9 @@ 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.
- // 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_ &&
- item_->expand_state() != mojom::ArcNotificationExpandState::FIXED_SIZE &&
- event.target() == nullptr) {
+bool ArcCustomNotificationView::HandleAccessibleAction(
+ const ui::AXActionData& action_data) {
+ if (item_ && action_data.action == ui::AX_ACTION_DO_DEFAULT) {
item_->ToggleExpansion();
return true;
}
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.h ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698