Commit 69a842ef authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

Ash system tray bubble: Send accessibility event when bubble updates.

When the system tray bubble updates, we should notify accessibility
features too (namely switch access).

with ChromeVox.

Bug: 1105196
AX-Relnotes: N/A
Test: Manual; test that bug is fixed for switch access and still works
Change-Id: I5a48d43601502846de9b7acf934a02370d0b5c52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2360558
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799227}
parent 75dbe4b9
......@@ -107,7 +107,7 @@ UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray,
bubble_view_->InitializeAndShowBubble();
// Notify accessibility features that the status tray has opened.
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kShow, true);
NotifyAccessibilityEvent(ax::mojom::Event::kShow, true);
tray->tray_event_filter()->AddBubble(this);
tray->shelf()->AddObserver(this);
......@@ -354,4 +354,9 @@ void UnifiedSystemTrayBubble::SetFrameVisible(bool visible) {
bubble_widget_->non_client_view()->frame_view()->SetVisible(visible);
}
void UnifiedSystemTrayBubble::NotifyAccessibilityEvent(ax::mojom::Event event,
bool send_native_event) {
bubble_view_->NotifyAccessibilityEvent(event, send_native_event);
}
} // namespace ash
......@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/optional.h"
#include "base/time/time.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/wm/public/activation_change_observer.h"
......@@ -99,6 +100,9 @@ class ASH_EXPORT UnifiedSystemTrayBubble
// Called when the message center widget is activated.
void OnMessageCenterActivated();
// Fire a notification that an accessibility event has occured on this object.
void NotifyAccessibilityEvent(ax::mojom::Event event, bool send_native_event);
// TrayBubbleBase:
TrayBackgroundView* GetTray() const override;
TrayBubbleView* GetBubbleView() const override;
......
......@@ -51,6 +51,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/numerics/ranges.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/compositor/animation_metrics_reporter.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/message_center/message_center.h"
......@@ -459,8 +460,11 @@ void UnifiedSystemTrayController::ShowDetailedView(
detailed_view_controller_ = std::move(controller);
// |bubble_| may be null in tests.
if (bubble_)
if (bubble_) {
bubble_->UpdateBubble();
// Notify accessibility features that a new view is showing.
bubble_->NotifyAccessibilityEvent(ax::mojom::Event::kShow, true);
}
}
void UnifiedSystemTrayController::UpdateExpandedAmount() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment