[views-ax] Deprecate View::NotifyAccessibilityEvent
This CL adds "deprecated" to `View::NotifyAccessibilityEvent`. TLDR: This CL just renames. In most situations, this function should not be called directly. There are a lot of events that are already sent automatically by the setters from ViewAccessibility. Soon, events will be generated automatically by the AXEventGenerator, using the AXNodeData cached in the View's ViewAccessibility. Some specific scenarios currently do require manual event generation, for example if its an event not being fired by the ViewAccessibility setters. In essence, for a lot of the events to be sent, Views authors should just need to keep the accessibility cache in ViewAccessibility updated by using the setters found in that class. There are some others that are not being sent through there currently, and firing them manually is still allowed. Once ViewsAX is completed though, most events will be generated through the AXEventGenerator, which just requires Views authors to keep the accessibility cache up to date. Bug: 325137417 Change-Id: I7cd2dcd4fa800ebb1ccef02d0c1fefc008ef5bd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6214895 Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com> Reviewed-by: Elly FJ <ellyjones@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Javier Contreras <javiercon@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1416390}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
68f22c91a3
commit
6d3f70993e
ash
accelerators
app_list
views
app_menu
assistant
ui
main_stage
auth
capture_mode
clipboard
game_dashboard
glanceables
classroom
tasks
in_session_auth
login
ui
quick_insert
search_box
shelf
style
system
accessibility
dictation_bubble_view.cc
switch_access
cast
focus_mode
sounds
holding_space
network
power
toast
tray
unified
wm
desks
overview
window_cycle
chrome/browser
ash
arc
notifications
ui
ash
input_method
quick_answers
lens
views
autofill
popup
bookmarks
bruschetta
critical_notification_bubble_view.ccdownload
exclusive_access_bubble_views.ccframe
global_media_controls
infobars
location_bar
cookie_controls
icon_label_bubble_view.cclocation_bar_view.ccselected_keyword_view.cczoom_bubble_view.ccomnibox
page_info
passwords
profiles
supervised_user
tabs
toolbar
web_apps
frame_toolbar
webauthn
chromeos/ash/experiences/arc/message_center
components
ui
message_center
views
accessibility
ax_aura_obj_cache.ccax_aura_obj_cache_unittest.ccax_virtual_view.ccax_virtual_view.hax_window_obj_wrapper.ccview_accessibility.ccview_ax_platform_node_delegate_auralinux.ccview_ax_platform_node_delegate_auralinux_unittest.ccview_ax_platform_node_delegate_win_unittest.cc
bubble
controls
corewm
view.ccview.hwidget
@ -170,7 +170,7 @@ void ExitWarningHandler::Show() {
|
||||
widget_->Init(std::move(params));
|
||||
widget_->Show();
|
||||
|
||||
delegate->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
delegate->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
void ExitWarningHandler::Hide() {
|
||||
|
@ -136,8 +136,8 @@ void AppsCollectionSectionView::UpdateAppsForCollection() {
|
||||
|
||||
SetVisible(!apps.empty());
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
PreferredSizeChanged();
|
||||
}
|
||||
|
||||
|
@ -1271,7 +1271,8 @@ void AppsGridView::SetSelectedItemByIndex(const GridIndex& index) {
|
||||
EnsureViewVisible(index);
|
||||
selected_view_ = new_selection;
|
||||
selected_view_->SchedulePaint();
|
||||
selected_view_->NotifyAccessibilityEvent(ax::mojom::Event::kFocus, true);
|
||||
selected_view_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kFocus,
|
||||
true);
|
||||
if (selected_view_->HasNotificationBadge()) {
|
||||
a11y_announcer_->AnnounceItemNotificationBadge(
|
||||
selected_view_->title()->GetText());
|
||||
@ -2582,8 +2583,9 @@ void AppsGridView::OnListItemAdded(size_t index, AppListItem* item) {
|
||||
// Schedule a layout, since the grid items may need their bounds updated.
|
||||
ScheduleLayout(initial_grid_size);
|
||||
|
||||
items_container_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
items_container_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
|
||||
// Attempt to animate the transition from a promise app into an actual app
|
||||
if (item->GetMetadata()->app_status == AppStatus::kReady) {
|
||||
@ -2638,8 +2640,9 @@ void AppsGridView::OnListItemRemoved(size_t index, AppListItem* item) {
|
||||
// Schedule a layout, since the grid items may need their bounds updated.
|
||||
ScheduleLayout(initial_grid_size);
|
||||
|
||||
items_container_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
items_container_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
|
||||
void AppsGridView::MaybeDuplicatePromiseAppForRemoval(
|
||||
@ -2698,8 +2701,8 @@ void AppsGridView::OnListItemMoved(size_t from_index,
|
||||
size_t from_model_index = GetModelIndexOfItem(item);
|
||||
view_model_.Move(from_model_index, to_index);
|
||||
items_container_->ReorderChildView(view_model_.view_at(to_index), to_index);
|
||||
items_container_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true /* send_native_event */);
|
||||
items_container_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true /* send_native_event */);
|
||||
|
||||
// If model update is in progress, paging should be updated when the operation
|
||||
// that caused the model update completes.
|
||||
|
@ -385,7 +385,7 @@ void AssistantPageView::OnUiVisibilityChanged(
|
||||
assistant_view_delegate_->IsTabletMode() ||
|
||||
AssistantState::Get()->launch_with_mic_open().value_or(false);
|
||||
if (!assistant::util::IsVoiceEntryPoint(entry_point.value(), prefer_voice)) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ void ContinueTaskContainerView::ClearAnimatingViews() {
|
||||
RemoveChildViewT(view);
|
||||
}
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged, true);
|
||||
}
|
||||
|
||||
void ContinueTaskContainerView::SetResults(
|
||||
|
@ -71,7 +71,7 @@ class PageSwitcherButton : public IconButton {
|
||||
selected_ = selected;
|
||||
SchedulePaint();
|
||||
if (selected)
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
// IconButton:
|
||||
|
@ -117,7 +117,8 @@ class RecentAppsView::GridDelegateImpl : public AppListItemViewGridDelegate {
|
||||
selected_view_ = view;
|
||||
// Ensure the translucent background of this selection is painted.
|
||||
selected_view_->SchedulePaint();
|
||||
selected_view_->NotifyAccessibilityEvent(ax::mojom::Event::kFocus, true);
|
||||
selected_view_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kFocus,
|
||||
true);
|
||||
}
|
||||
void ClearSelectedView() override { selected_view_ = nullptr; }
|
||||
bool IsSelectedView(const AppListItemView* view) const override {
|
||||
@ -234,8 +235,8 @@ void RecentAppsView::UpdateResults(
|
||||
item_view->InitializeIconLoader();
|
||||
}
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
|
||||
void RecentAppsView::SetModels(SearchModel* search_model, AppListModel* model) {
|
||||
|
@ -269,7 +269,7 @@ int SearchResultImageListView::DoUpdate() {
|
||||
notifier_results);
|
||||
}
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged, false);
|
||||
return num_results;
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ int SearchResultListView::DoUpdate() {
|
||||
}
|
||||
|
||||
std::vector<SearchResult*> displayed_results = UpdateResultViews();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged, false);
|
||||
|
||||
auto* notifier = view_delegate()->GetNotifier();
|
||||
|
||||
|
@ -132,7 +132,7 @@ void AppMenuModelAdapter::OnMenuClosed(views::MenuItemView* menu) {
|
||||
|
||||
// No |widget_owner_| in tests.
|
||||
if (widget_owner_ && widget_owner_->GetRootView()) {
|
||||
widget_owner_->GetRootView()->NotifyAccessibilityEvent(
|
||||
widget_owner_->GetRootView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kMenuEnd,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ void UiElementContainerView::OnAllViewsAnimatedIn() {
|
||||
// and the card fallback text, but webview result is not included. We don't
|
||||
// read when there is TTS to avoid speaking over the server response.
|
||||
if (!response->has_tts())
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
void UiElementContainerView::OnOverflowIndicatorVisibilityChanged(
|
||||
|
@ -141,8 +141,9 @@ void AuthHeaderView::SetErrorTitle(const std::u16string& error_str) {
|
||||
title_label_->SetEnabledColorId(kTitleErrorColorId);
|
||||
NotifyTitleChanged(error_str);
|
||||
title_label_->GetViewAccessibility().SetName(error_str);
|
||||
title_label_->NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged,
|
||||
/*send_native_event=*/true);
|
||||
title_label_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged,
|
||||
/*send_native_event=*/true);
|
||||
title_label_->GetViewAccessibility().AnnounceText(error_str);
|
||||
}
|
||||
|
||||
|
@ -199,8 +199,8 @@ void FingerprintView::SetState(FingerprintState state) {
|
||||
state_ = state;
|
||||
DisplayCurrentState();
|
||||
if (NeedA11yAlertFromState()) {
|
||||
label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,8 +146,8 @@ void PinStatusView::SetPinStatus(
|
||||
return;
|
||||
}
|
||||
|
||||
text_label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
text_label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
|
||||
if (pin_status_->AvailableAt().is_max()) {
|
||||
return;
|
||||
|
@ -307,7 +307,7 @@ void CaptureModeSessionFocusCycler::HighlightableView::PseudoFocus() {
|
||||
focus_ring_->DeprecatedLayoutImmediately();
|
||||
focus_ring_->SchedulePaint();
|
||||
|
||||
view->NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
view->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
|
||||
magnifier_utils::MaybeUpdateActiveMagnifierFocus(
|
||||
view->GetBoundsInScreen().CenterPoint());
|
||||
@ -342,7 +342,8 @@ bool CaptureModeSessionFocusCycler::HighlightableView::ClickView() {
|
||||
ui::VKEY_RETURN, ui::EF_NONE))) {
|
||||
handled = true;
|
||||
if (weak_ptr) {
|
||||
view->NotifyAccessibilityEvent(ax::mojom::Event::kStateChanged, true);
|
||||
view->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kStateChanged, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1043,8 +1044,8 @@ void CaptureModeSessionFocusCycler::UpdateA11yAnnotation() {
|
||||
auto& view_a11y = contents_view->GetViewAccessibility();
|
||||
view_a11y.SetPreviousFocus(previous);
|
||||
view_a11y.SetNextFocus(next);
|
||||
contents_view->NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged,
|
||||
true);
|
||||
contents_view->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTreeChanged, true);
|
||||
};
|
||||
|
||||
// If there is only one widget left, clear the focus overrides so that they
|
||||
|
@ -718,8 +718,9 @@ void ClipboardHistoryMenuModelAdapter::OnMenuClosed(views::MenuItemView* menu) {
|
||||
views::View* focused_view =
|
||||
active_widget->GetFocusManager()->GetFocusedView();
|
||||
if (focused_view) {
|
||||
focused_view->NotifyAccessibilityEvent(ax::mojom::Event::kMenuEnd,
|
||||
/*send_native_event=*/true);
|
||||
focused_view->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kMenuEnd,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,8 +478,9 @@ void ClipboardHistoryItemView::SetPseudoFocus(PseudoFocus new_pseudo_focus) {
|
||||
->GetInkDrop()
|
||||
->SetFocused(IsDeleteButtonPseudoFocused());
|
||||
if (IsDeleteButtonPseudoFocused()) {
|
||||
delete_button_->NotifyAccessibilityEvent(ax::mojom::Event::kHover,
|
||||
/*send_native_event*/ true);
|
||||
delete_button_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kHover,
|
||||
/*send_native_event*/ true);
|
||||
}
|
||||
|
||||
if (repaint_main_button) {
|
||||
|
@ -74,7 +74,7 @@ void GameDashboardNetworkView::UpdateConnectionStatus(bool notify_a11y) {
|
||||
SetTooltipText(tooltip);
|
||||
if (notify_a11y && !accessible_name.empty() &&
|
||||
accessible_name != GetViewAccessibility().GetCachedName()) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
if (accessible_description.empty()) {
|
||||
|
@ -189,8 +189,9 @@ void UpdateAccessibilityTree(const std::vector<views::Widget*>& widget_list) {
|
||||
|
||||
view_a11y.SetPreviousFocus(widget_list[prev_index]);
|
||||
view_a11y.SetNextFocus(widget_list[next_index]);
|
||||
contents_view->NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged,
|
||||
/*send_native_event=*/true);
|
||||
contents_view->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTreeChanged,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ void GlanceablesClassroomStudentView::OnGetAssignments(
|
||||
items_container_view()->GetViewAccessibility().SetName(
|
||||
l10n_util::GetStringFUTF16(
|
||||
IDS_GLANCEABLES_CLASSROOM_SELECTED_LIST_ACCESSIBLE_NAME, list_name));
|
||||
items_container_view()->NotifyAccessibilityEvent(
|
||||
items_container_view()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
|
||||
|
@ -437,7 +437,8 @@ GlanceablesTaskView::GlanceablesTaskView(
|
||||
base::JoinString(details, u", "));
|
||||
}
|
||||
check_button_->GetViewAccessibility().SetDescription(a11y_description);
|
||||
check_button_->NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true);
|
||||
check_button_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged, true);
|
||||
}
|
||||
|
||||
GlanceablesTaskView::~GlanceablesTaskView() = default;
|
||||
|
@ -548,7 +548,7 @@ void GlanceablesTasksView::UpdateTasksInTaskList(
|
||||
l10n_util::GetStringFUTF16(
|
||||
IDS_GLANCEABLES_TASKS_SELECTED_LIST_ACCESSIBLE_NAME,
|
||||
base::UTF8ToUTF16(task_list_title)));
|
||||
items_container_view()->NotifyAccessibilityEvent(
|
||||
items_container_view()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged,
|
||||
/*send_native_event=*/true);
|
||||
|
||||
|
@ -220,8 +220,8 @@ class AuthDialogContentsView::FingerprintView : public views::View {
|
||||
reset_state_.Start(FROM_HERE, kResetToDefaultIconDelay,
|
||||
base::BindOnce(&FingerprintView::DisplayCurrentState,
|
||||
base::Unretained(this)));
|
||||
label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,8 +371,8 @@ class AuthDialogContentsView::TitleLabel : public views::Label {
|
||||
SetEnabledColorId(kColorAshTextColorAlert);
|
||||
is_showing_error_ = true;
|
||||
GetViewAccessibility().SetName(error_text);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -294,7 +294,8 @@ void FixedLengthCodeInput::InsertDigit(int value) {
|
||||
bool was_last_field = IsLastFieldActive();
|
||||
ResetTextValueForA11y();
|
||||
FocusNextField();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextSelectionChanged,
|
||||
true);
|
||||
on_input_change_.Run(was_last_field, GetCode().has_value());
|
||||
}
|
||||
|
||||
@ -313,7 +314,8 @@ void FixedLengthCodeInput::Backspace() {
|
||||
ActiveField()->SetText(std::u16string());
|
||||
ResetTextValueForA11y();
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextSelectionChanged,
|
||||
true);
|
||||
on_input_change_.Run(IsLastFieldActive(), false /*complete*/);
|
||||
}
|
||||
|
||||
@ -427,12 +429,14 @@ bool FixedLengthCodeInput::HandleKeyEvent(views::Textfield* sender,
|
||||
InsertDigit(key_code - ui::VKEY_NUMPAD0);
|
||||
} else if (key_code == ui::VKEY_LEFT && arrow_navigation_allowed_) {
|
||||
FocusPreviousField();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextSelectionChanged,
|
||||
true);
|
||||
} else if (key_code == ui::VKEY_RIGHT && arrow_navigation_allowed_) {
|
||||
// Do not allow to leave empty field when moving focus with arrow key.
|
||||
if (!ActiveInput().empty()) {
|
||||
FocusNextField();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextSelectionChanged, true);
|
||||
}
|
||||
} else if (key_code == ui::VKEY_BACK) {
|
||||
Backspace();
|
||||
@ -467,7 +471,8 @@ void FixedLengthCodeInput::ContentsChanged(views::Textfield* sender,
|
||||
bool was_last_field = IsLastFieldActive();
|
||||
ResetTextValueForA11y();
|
||||
FocusNextField();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextSelectionChanged,
|
||||
true);
|
||||
on_input_change_.Run(was_last_field, GetCode().has_value());
|
||||
}
|
||||
|
||||
@ -483,7 +488,8 @@ bool FixedLengthCodeInput::HandleMouseEvent(views::Textfield* sender,
|
||||
if (input_fields_[i] == sender) {
|
||||
active_input_index_ = i;
|
||||
RequestFocus();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextSelectionChanged, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -503,7 +509,8 @@ bool FixedLengthCodeInput::HandleGestureEvent(
|
||||
if (input_fields_[i] == sender) {
|
||||
active_input_index_ = i;
|
||||
RequestFocus();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextSelectionChanged, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -414,8 +414,8 @@ void LocalAuthenticationRequestView::OnAuthComplete(
|
||||
LocalAuthenticationRequestViewState::kError, default_title_,
|
||||
l10n_util::GetStringUTF16(IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PWD));
|
||||
ClearInput();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
SetInputEnabled(true);
|
||||
} else {
|
||||
LocalAuthenticationRequestWidget::Get()->Close(true /* success */,
|
||||
|
@ -1419,7 +1419,8 @@ void LockContentsView::OnOobeDialogStateChanged(OobeDialogState state) {
|
||||
Shelf* shelf = Shelf::ForWindow(GetWidget()->GetNativeWindow());
|
||||
shelf->GetStatusAreaWidget()
|
||||
->status_area_widget_delegate()
|
||||
->NotifyAccessibilityEvent(ax::mojom::Event::kStateChanged, true);
|
||||
->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kStateChanged,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,8 +519,9 @@ void LoginAuthFactorsView::OnThemeChanged() {
|
||||
}
|
||||
|
||||
void LoginAuthFactorsView::FireAlert() {
|
||||
label_wrapper_->label()->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
label_wrapper_->label()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
|
||||
void LoginAuthFactorsView::ArrowButtonPressed(const ui::Event& event) {
|
||||
|
@ -166,8 +166,8 @@ ui::CallbackLayerAnimationObserver* BuildObserverToNotifyA11yLocationChanged(
|
||||
return true;
|
||||
}
|
||||
|
||||
view->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
|
||||
false /*send_native_event*/);
|
||||
view->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kLocationChanged, false /*send_native_event*/);
|
||||
return true;
|
||||
},
|
||||
view));
|
||||
@ -307,8 +307,8 @@ class LoginAuthUserView::ChallengeResponseView : public views::View {
|
||||
label_->SetText(GetTextForLabel());
|
||||
|
||||
if (state == State::kFailure) {
|
||||
label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
|
||||
DeprecatedLayoutImmediately();
|
||||
|
@ -197,8 +197,8 @@ void LoginBaseBubbleView::Show() {
|
||||
|
||||
// Tell ChromeVox to read bubble contents.
|
||||
if (notify_a11y_alert_on_show_) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true /*send_native_event*/);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -541,11 +541,11 @@ LoginPinView::LoginPinView(Style keyboard_style,
|
||||
LoginPinView::~LoginPinView() = default;
|
||||
|
||||
void LoginPinView::NotifyAccessibilityLocationChanged() {
|
||||
this->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
|
||||
false /*send_native_event*/);
|
||||
this->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kLocationChanged,
|
||||
false /*send_native_event*/);
|
||||
for (NonAccessibleView* row : rows_) {
|
||||
row->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
|
||||
false /*send_native_event*/);
|
||||
row->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kLocationChanged,
|
||||
false /*send_native_event*/);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -483,7 +483,8 @@ void PinRequestView::UpdateState(PinRequestViewState state,
|
||||
access_code_view_->SetInputColorId(error_color_id);
|
||||
title_label_->SetEnabledColorId(error_color_id);
|
||||
// Read out the error.
|
||||
title_label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
title_label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,8 @@ void QuickInsertSearchResultsView::UpdateAccessibleName() {
|
||||
return;
|
||||
}
|
||||
GetViewAccessibility().SetName(std::move(accessible_name));
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kLiveRegionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kLiveRegionChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(QuickInsertSearchResultsView)
|
||||
|
@ -251,7 +251,7 @@ class SearchBoxTextfield : public views::Textfield {
|
||||
auto& accessibility = GetViewAccessibility();
|
||||
if (accessibility.GetIsIgnored()) {
|
||||
accessibility.SetIsIgnored(false);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1223,8 +1223,9 @@ void ScrollableShelfView::OnImplicitAnimationsCompleted() {
|
||||
UpdateTappableIconIndices();
|
||||
|
||||
// Notifies ChromeVox of the changed location at the end of animation.
|
||||
shelf_view_->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
|
||||
/*send_native_event=*/true);
|
||||
shelf_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kLocationChanged,
|
||||
/*send_native_event=*/true);
|
||||
|
||||
if (!drag_item_bounds_in_screen_ ||
|
||||
AreBoundsWithinVisibleSpace(*drag_item_bounds_in_screen_)) {
|
||||
|
@ -56,8 +56,8 @@ void ShelfContainerView::TranslateShelfView(const gfx::Vector2dF& offset) {
|
||||
gfx::Transform transform_matrix;
|
||||
transform_matrix.Translate(-offset);
|
||||
shelf_view_->SetTransform(transform_matrix);
|
||||
shelf_view_->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
|
||||
true);
|
||||
shelf_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kLocationChanged, true);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(ShelfContainerView)
|
||||
|
@ -313,13 +313,15 @@ ShelfNavigationWidget::Delegate::Delegate(Shelf* shelf, ShelfView* shelf_view)
|
||||
|
||||
// Ensure widgets are represented in accessibility.
|
||||
if (shelf->hotseat_widget()) {
|
||||
shelf->hotseat_widget()->GetRootView()->NotifyAccessibilityEvent(
|
||||
shelf->hotseat_widget()->GetRootView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
}
|
||||
|
||||
if (shelf->GetStatusAreaWidget()) {
|
||||
shelf->GetStatusAreaWidget()->GetRootView()->NotifyAccessibilityEvent(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
shelf->GetStatusAreaWidget()
|
||||
->GetRootView()
|
||||
->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
GetViewAccessibility().SetRole(ax::mojom::Role::kToolbar);
|
||||
|
@ -1720,8 +1720,8 @@ void ShelfView::MoveDragViewTo(int primary_axis_coordinate) {
|
||||
if (target_index == current_item_index &&
|
||||
old_relative_position != drag_view_relative_to_ideal_bounds_) {
|
||||
AnimateToIdealBounds();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true /* send_native_event */);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true /* send_native_event */);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2470,8 +2470,8 @@ void ShelfView::ShelfItemMoved(int start_index, int target_index) {
|
||||
|
||||
// Reorder the child view to be in the same order as in the |view_model_|.
|
||||
ReorderChildView(view_model_->view_at(target_index), target_index);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true /* send_native_event */);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true /* send_native_event */);
|
||||
|
||||
AnimateToIdealBounds();
|
||||
}
|
||||
|
@ -459,7 +459,7 @@ void DropDownCheckbox::ShowDropDownMenu() {
|
||||
kDropDownArrowIcon, kActiveTitleAndIconColorId, kArrowIconSize));
|
||||
|
||||
RequestFocus();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kStateChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kStateChanged, true);
|
||||
}
|
||||
|
||||
void DropDownCheckbox::CloseDropDownMenu() {
|
||||
@ -471,7 +471,7 @@ void DropDownCheckbox::CloseDropDownMenu() {
|
||||
title_->SetEnabledColorId(kInactiveTitleAndIconColorId);
|
||||
drop_down_arrow_->SetImage(ui::ImageModel::FromVectorIcon(
|
||||
kDropDownArrowIcon, kInactiveTitleAndIconColorId, kArrowIconSize));
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kStateChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kStateChanged, true);
|
||||
OnPerformAction();
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ void DictationHintView::Update(
|
||||
// hints to the user.
|
||||
if (num_visible_hints > 0) {
|
||||
SetVisible(true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
} else {
|
||||
SetVisible(false);
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ void SwitchAccessBackButtonBubbleController::ShowBackButton(
|
||||
back_button_view_->SetFocusRing(show_focus_ring);
|
||||
bubble_view_->ChangeAnchorRect(AdjustAnchorRect(anchor));
|
||||
widget_->Show();
|
||||
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
bubble_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
}
|
||||
|
||||
void SwitchAccessBackButtonBubbleController::HideFocusRing() {
|
||||
@ -80,8 +80,8 @@ void SwitchAccessBackButtonBubbleController::Hide() {
|
||||
if (widget_)
|
||||
widget_->Hide();
|
||||
if (bubble_view_)
|
||||
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
bubble_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
}
|
||||
|
||||
void SwitchAccessBackButtonBubbleController::BubbleViewDestroyed() {
|
||||
|
@ -116,8 +116,8 @@ void SwitchAccessBackButtonView::OnPaint(gfx::Canvas* canvas) {
|
||||
}
|
||||
|
||||
void SwitchAccessBackButtonView::OnButtonPressed() {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kClicked,
|
||||
/*send_native_event=*/false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kClicked,
|
||||
/*send_native_event=*/false);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(SwitchAccessBackButtonView)
|
||||
|
@ -87,8 +87,8 @@ void SwitchAccessMenuBubbleController::ShowMenu(
|
||||
|
||||
widget_->SetBounds(resting_bounds);
|
||||
widget_->Show();
|
||||
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
bubble_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
|
||||
// The resting bounds includes padding on each side of the menu.
|
||||
// Remove that before passing to the back button controller so the back button
|
||||
@ -112,8 +112,8 @@ void SwitchAccessMenuBubbleController::HideMenuBubble() {
|
||||
if (widget_)
|
||||
widget_->Hide();
|
||||
if (bubble_view_)
|
||||
bubble_view_->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
bubble_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, true);
|
||||
}
|
||||
|
||||
void SwitchAccessMenuBubbleController::BubbleViewDestroyed() {
|
||||
|
@ -86,8 +86,8 @@ SwitchAccessMenuButton::SwitchAccessMenuButton(std::string action_name,
|
||||
}
|
||||
|
||||
void SwitchAccessMenuButton::OnButtonPressed() {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kClicked,
|
||||
/*send_native_event=*/false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kClicked,
|
||||
/*send_native_event=*/false);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(SwitchAccessMenuButton)
|
||||
|
@ -106,7 +106,7 @@ void MediaCastAudioSelectorView::UpdateCurrentAudioDevice(
|
||||
void MediaCastAudioSelectorView::MediaCastAudioSelectorView::ShowDevices() {
|
||||
DCHECK(!is_expanded_);
|
||||
is_expanded_ = true;
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kExpandedChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kExpandedChanged, true);
|
||||
|
||||
list_view_container_->SetVisible(true);
|
||||
|
||||
@ -123,7 +123,7 @@ void MediaCastAudioSelectorView::MediaCastAudioSelectorView::ShowDevices() {
|
||||
void MediaCastAudioSelectorView::HideDevices() {
|
||||
DCHECK(is_expanded_);
|
||||
is_expanded_ = false;
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kExpandedChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kExpandedChanged, true);
|
||||
|
||||
list_view_container_->SetVisible(false);
|
||||
PreferredSizeChanged();
|
||||
|
@ -138,7 +138,7 @@ void PlaylistImageButton::SetIsSelected(bool is_selected) {
|
||||
is_selected
|
||||
? IDS_ASH_STATUS_TRAY_FOCUS_MODE_SOUNDS_PLAYLIST_SELECTED_ACCESSIBLE_DESCRIPTION
|
||||
: IDS_ASH_STATUS_TRAY_FOCUS_MODE_SOUNDS_PLAYLIST_UNSELECTED_ACCESSIBLE_DESCRIPTION));
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kStateChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kStateChanged, true);
|
||||
|
||||
OnPropertyChanged(&is_selected_, views::kPropertyEffectsPaint);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ void HoldingSpaceItemView::OnHoldingSpaceItemUpdated(
|
||||
if (updated_fields.previous_accessible_name) {
|
||||
GetViewAccessibility().SetName(item_->GetAccessibleName(),
|
||||
ax::mojom::NameFrom::kAttribute);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextChanged, true);
|
||||
}
|
||||
|
||||
// Primary action.
|
||||
|
@ -126,7 +126,7 @@ void NetworkDetailedView::OnInfoClicked() {
|
||||
weak_ptr_factory_.GetWeakPtr(), tri_view());
|
||||
info_bubble_tracker_.SetView(info_bubble.get());
|
||||
views::BubbleDialogDelegateView::CreateBubble(std::move(info_bubble))->Show();
|
||||
info_bubble_tracker_.view()->NotifyAccessibilityEvent(
|
||||
info_bubble_tracker_.view()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, false);
|
||||
}
|
||||
|
||||
|
@ -392,7 +392,8 @@ void NetworkStateListDetailedView::ToggleInfoBubble() {
|
||||
|
||||
info_bubble_ = new InfoBubble(tri_view(), CreateNetworkInfoView(), this);
|
||||
views::BubbleDialogDelegateView::CreateBubble(info_bubble_)->Show();
|
||||
info_bubble_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, false);
|
||||
info_bubble_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
false);
|
||||
}
|
||||
|
||||
bool NetworkStateListDetailedView::ResetInfoBubble() {
|
||||
|
@ -116,7 +116,7 @@ void NetworkTrayView::UpdateConnectionStatus(bool notify_a11y) {
|
||||
GetViewAccessibility().SetName(accessible_name);
|
||||
if (notify_a11y && !accessible_name.empty() &&
|
||||
accessible_name != prev_accessible_name) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
if (!accessible_description_.empty()) {
|
||||
|
@ -93,7 +93,7 @@ gfx::Size PowerButtonMenuItemView::CalculatePreferredSize(
|
||||
|
||||
void PowerButtonMenuItemView::OnFocus() {
|
||||
parent()->SetFocusBehavior(FocusBehavior::NEVER);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
SchedulePaint();
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,8 @@ void ToastOverlay::Show(bool visible) {
|
||||
overlay_widget_->ShowInactive();
|
||||
|
||||
// Notify accessibility about the overlay.
|
||||
overlay_view_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, false);
|
||||
overlay_view_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
false);
|
||||
} else {
|
||||
overlay_widget_->Hide();
|
||||
}
|
||||
|
@ -238,7 +238,8 @@ void HoverHighlightView::SetAccessibilityState(
|
||||
}
|
||||
|
||||
if (accessibility_state_ != AccessibilityState::DEFAULT) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kCheckedStateChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kCheckedStateChanged,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,7 @@ void UnifiedSliderBubbleController::ShowBubble(SliderType slider_type) {
|
||||
|
||||
// Notify value change accessibility event because the popup is triggered by
|
||||
// changing value using an accessor key like VolUp.
|
||||
slider_view_->slider()->NotifyAccessibilityEvent(
|
||||
slider_view_->slider()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kValueChanged, true);
|
||||
|
||||
StartAutoCloseTimer();
|
||||
|
@ -68,7 +68,7 @@ UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray)
|
||||
bubble_view_->InitializeAndShowBubble();
|
||||
|
||||
// Notify accessibility features that the status tray has opened.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kShow, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kShow, true);
|
||||
|
||||
// Explicitly close the app list in clamshell mode.
|
||||
if (!display::Screen::GetScreen()->InTabletMode()) {
|
||||
@ -321,12 +321,13 @@ void UnifiedSystemTrayBubble::UpdateBubbleBounds() {
|
||||
unified_system_tray_->shelf()->GetSystemTrayAnchorRect());
|
||||
}
|
||||
|
||||
void UnifiedSystemTrayBubble::NotifyAccessibilityEvent(ax::mojom::Event event,
|
||||
bool send_native_event) {
|
||||
void UnifiedSystemTrayBubble::NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event event,
|
||||
bool send_native_event) {
|
||||
if (!bubble_view_) {
|
||||
return;
|
||||
}
|
||||
bubble_view_->NotifyAccessibilityEvent(event, send_native_event);
|
||||
bubble_view_->NotifyAccessibilityEventDeprecated(event, send_native_event);
|
||||
}
|
||||
|
||||
bool UnifiedSystemTrayBubble::ShowingAudioDetailedView() const {
|
||||
|
@ -87,7 +87,8 @@ class ASH_EXPORT UnifiedSystemTrayBubble : public TrayBubbleBase,
|
||||
int GetCurrentTrayHeight() const;
|
||||
|
||||
// Fire a notification that an accessibility event has occured on this object.
|
||||
void NotifyAccessibilityEvent(ax::mojom::Event event, bool send_native_event);
|
||||
void NotifyAccessibilityEventDeprecated(ax::mojom::Event event,
|
||||
bool send_native_event);
|
||||
|
||||
// Whether the bubble is currently showing audio details or display details or
|
||||
// calendar view.
|
||||
|
@ -467,7 +467,7 @@ void UnifiedSystemTrayController::ShowDetailedView(
|
||||
if (bubble_) {
|
||||
UpdateBubble();
|
||||
// Notify accessibility features that a new view is showing.
|
||||
bubble_->NotifyAccessibilityEvent(ax::mojom::Event::kShow, true);
|
||||
bubble_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kShow, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1574,7 +1574,7 @@ void DeskBarViewBase::OnDeskReordered(int old_index, int new_index) {
|
||||
// Update the order of child views.
|
||||
auto* reordered_view = mini_views_[new_index].get();
|
||||
reordered_view->parent()->ReorderChildView(reordered_view, new_index);
|
||||
reordered_view->parent()->NotifyAccessibilityEvent(
|
||||
reordered_view->parent()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTreeChanged, true);
|
||||
|
||||
// Update the desk indices in the shortcut views.
|
||||
|
@ -116,7 +116,7 @@ void SavedDeskGridView::SortEntries(const base::Uuid& order_first_uuid) {
|
||||
// be the new item, while the rest will be sorted alphabetically.
|
||||
for (size_t i = 0; i < grid_items_.size(); i++)
|
||||
ReorderChildView(grid_items_[i], i);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
|
||||
if (bounds_animator_.IsAnimating())
|
||||
bounds_animator_.Cancel();
|
||||
@ -189,7 +189,7 @@ void SavedDeskGridView::DeleteEntries(const std::vector<base::Uuid>& uuids,
|
||||
}
|
||||
|
||||
AnimateGridItems(/*new_grid_items=*/{});
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
}
|
||||
|
||||
bool SavedDeskGridView::IsSavedDeskNameBeingModified() const {
|
||||
|
@ -259,7 +259,7 @@ void SavedDeskIconContainer::SortIcons() {
|
||||
|
||||
// Notify the a11y API so that the spoken feedback order matches the view
|
||||
// order.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
}
|
||||
|
||||
void SavedDeskIconContainer::UpdateOverflowIcon() {
|
||||
|
@ -240,7 +240,7 @@ void OverviewFocusCycler::UpdateAccessibilityFocus() {
|
||||
if (a11y_widgets.size() == 1) {
|
||||
get_view_a11y(/*index=*/0).SetPreviousFocus(nullptr);
|
||||
get_view_a11y(/*index=*/0).SetNextFocus(nullptr);
|
||||
a11y_widgets[0]->GetContentsView()->NotifyAccessibilityEvent(
|
||||
a11y_widgets[0]->GetContentsView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTreeChanged, true);
|
||||
return;
|
||||
}
|
||||
@ -251,7 +251,7 @@ void OverviewFocusCycler::UpdateAccessibilityFocus() {
|
||||
int next_index = (i + 1) % size;
|
||||
get_view_a11y(i).SetPreviousFocus(a11y_widgets[previous_index]);
|
||||
get_view_a11y(i).SetNextFocus(a11y_widgets[next_index]);
|
||||
a11y_widgets[i]->GetContentsView()->NotifyAccessibilityEvent(
|
||||
a11y_widgets[i]->GetContentsView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTreeChanged, true);
|
||||
}
|
||||
}
|
||||
|
@ -407,14 +407,14 @@ void GroupContainerCycleView::SetSelectedWindowForFocus(aura::Window* window) {
|
||||
if (old_is_first_focus_selection_request &&
|
||||
window_util::GetActiveWindow() == mini_views_[1]->source_window()) {
|
||||
mini_views_[0]->UpdateFocusState(/*focus=*/true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
} else {
|
||||
// For normal use case, follow the window cycle order and `UpdateFocusState`
|
||||
// on the cycle item that contains the target window.
|
||||
for (WindowCycleItemView* mini_view : mini_views_) {
|
||||
if (mini_view->Contains(window)) {
|
||||
mini_view->UpdateFocusState(/*focus=*/true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ void ArcAccessibilityHelperBridge::HandleFilterTypeAllEvent(
|
||||
ash::ArcNotificationSurface* surface =
|
||||
surface_manager->GetArcSurface(event_data->notification_key.value());
|
||||
if (surface && surface->IsAttached()) {
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEvent(
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextSelectionChanged, true);
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void UpdateTreeIdOfNotificationSurface(const std::string& notification_key,
|
||||
if (surface->IsAttached()) {
|
||||
// Dispatch ax::mojom::Event::kChildrenChanged to force AXNodeData of the
|
||||
// notification updated.
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEvent(
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, false);
|
||||
}
|
||||
}
|
||||
@ -679,7 +679,7 @@ void ArcAccessibilityTreeTracker::OnNotificationSurfaceAdded(
|
||||
// 1. ax_tree_id is set to the surface
|
||||
// 2. the surface is attached to the content view
|
||||
if (surface->IsAttached()) {
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEvent(
|
||||
surface->GetAttachedHost()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kChildrenChanged, false);
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ void CreateAndShowWidget(views::WidgetDelegateView* delegate,
|
||||
widget->SetBounds(bounds);
|
||||
|
||||
// Allow to use the message for spoken feedback.
|
||||
delegate->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
delegate->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -37,8 +37,8 @@ void AnnouncementLabel::DoAnnouncement(const std::u16string text) {
|
||||
|
||||
UpdateAccessibleDescription();
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kLiveRegionChanged,
|
||||
/*send_native_event=*/false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kLiveRegionChanged,
|
||||
/*send_native_event=*/false);
|
||||
}
|
||||
|
||||
void AnnouncementLabel::UpdateAccessibleDescription() {
|
||||
|
@ -381,8 +381,9 @@ void CandidateWindowView::UpdateCandidates(
|
||||
if (!candidate_window_.is_user_selecting() ||
|
||||
(selected_candidate_index_in_page_ != new_candidate_index_in_page &&
|
||||
new_candidate_index_in_page != -1)) {
|
||||
candidate_views_[new_candidate_index_in_page]->NotifyAccessibilityEvent(
|
||||
ax::mojom::Event::kSelection, false);
|
||||
candidate_views_[new_candidate_index_in_page]
|
||||
->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ void CompletionSuggestionView::SetHighlighted(bool highlighted) {
|
||||
|
||||
highlighted_ = highlighted;
|
||||
if (highlighted) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, false);
|
||||
// TODO(crbug/1099044): Use System Color for button highlight.
|
||||
SetBackground(views::CreateSolidBackground(
|
||||
ResolveSemanticColor(kButtonHighlightColor)));
|
||||
|
@ -530,7 +530,7 @@ void QuickAnswersView::OnFocus() {
|
||||
if (wants_focus != this) {
|
||||
wants_focus->RequestFocus();
|
||||
} else {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kFocus, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kFocus, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ void LensPreselectionBubble::Init() {
|
||||
exit_button_->SetProperty(views::kElementIdentifierKey,
|
||||
kLensPreselectionBubbleExitButtonElementId);
|
||||
}
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
void LensPreselectionBubble::SetLabelText(int string_id) {
|
||||
|
@ -368,14 +368,16 @@ void PopupRowAutofillAiFeedbackView::UpdateFocusedControl(
|
||||
GetFocusableControlView(*current_focused_control)
|
||||
.GetViewAccessibility()
|
||||
.SetIsSelected(false);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
}
|
||||
|
||||
if (new_focused_control) {
|
||||
views::View& view = GetFocusableControlView(*new_focused_control);
|
||||
GetA11ySelectionDelegate().NotifyAXSelection(view);
|
||||
view.GetViewAccessibility().SetIsSelected(true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
}
|
||||
|
||||
manage_prediction_improvements_link_->SetBackground(
|
||||
|
@ -310,8 +310,8 @@ void PopupBaseView::DoHide() {
|
||||
// navigates into the menu, otherwise some screen readers will ignore
|
||||
// any focus events outside of the menu, including a focus event on
|
||||
// the form control itself.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kMenuPopupEnd, true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kMenuEnd, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuPopupEnd, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuEnd, true);
|
||||
GetViewAccessibility().EndPopupFocusOverride();
|
||||
|
||||
// Also fire an accessible focus event on what currently has focus,
|
||||
@ -349,8 +349,8 @@ void PopupBaseView::NotifyAXSelection(views::View& selected_view) {
|
||||
// readers that the focus is only changing temporarily, and the screen
|
||||
// reader will restore the focus back to the appropriate textfield when the
|
||||
// menu closes.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kMenuStart, true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kMenuPopupStart, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuStart, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuPopupStart, true);
|
||||
|
||||
is_ax_menu_start_event_fired_ = true;
|
||||
}
|
||||
|
@ -384,14 +384,16 @@ void PopupRowView::SetSelectedCell(std::optional<CellType> new_cell) {
|
||||
// hide this API complexity from clients.
|
||||
GetA11ySelectionDelegate().NotifyAXSelection(*this);
|
||||
GetViewAccessibility().SetIsSelected(true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
selected_cell_ = new_cell;
|
||||
} else if (new_cell == CellType::kContent) {
|
||||
controller_->SelectSuggestion(line_number_);
|
||||
content_view_->UpdateStyle(/*selected=*/highlight_on_select_);
|
||||
GetA11ySelectionDelegate().NotifyAXSelection(*content_view_);
|
||||
content_view_->GetViewAccessibility().SetIsSelected(true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
selected_cell_ = new_cell;
|
||||
} else {
|
||||
// Set the selected cell to none in case an invalid choice was made (e.g.
|
||||
|
@ -190,7 +190,8 @@ views::View* PopupRowWithButtonView::GetButtonContainer() {
|
||||
|
||||
void PopupRowWithButtonView::HandleKeyPressEventFocusOnButton() {
|
||||
button_->GetViewAccessibility().SetPopupFocusOverride();
|
||||
button_->NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
button_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection,
|
||||
true);
|
||||
views::InkDrop::Get(button_->ink_drop_view())->GetInkDrop()->SetHovered(true);
|
||||
UpdateFocusedPartAndSelectedSuggestion(RowWithButtonPart::kButton);
|
||||
}
|
||||
@ -198,7 +199,7 @@ void PopupRowWithButtonView::HandleKeyPressEventFocusOnButton() {
|
||||
void PopupRowWithButtonView::HandleKeyPressEventFocusOnContent() {
|
||||
UpdateFocusedPartAndSelectedSuggestion(RowWithButtonPart::kContent);
|
||||
GetContentView().GetViewAccessibility().SetPopupFocusOverride();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
views::InkDrop::Get(button_->ink_drop_view())
|
||||
->GetInkDrop()
|
||||
->SetHovered(false);
|
||||
|
@ -1444,7 +1444,8 @@ void PopupViewViews::MaybeA11yFocusInformationalSuggestion() {
|
||||
}
|
||||
if (view_to_focus) {
|
||||
NotifyAXSelection(*view_to_focus);
|
||||
view_to_focus->NotifyAccessibilityEvent(ax::mojom::Event::kFocus, true);
|
||||
view_to_focus->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kFocus,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -493,10 +493,10 @@ void BookmarkBarView::SetBookmarkBarState(
|
||||
// hidden.
|
||||
if (state == BookmarkBar::SHOW) {
|
||||
GetViewAccessibility().SetIsLeaf(false);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
} else {
|
||||
GetViewAccessibility().SetIsLeaf(true);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTreeChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTreeChanged, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -303,7 +303,8 @@ bool BruschettaInstallerView::Accept() {
|
||||
RemoveChildViewT(radio_button_container_.get());
|
||||
radio_button_container_ = nullptr;
|
||||
radio_buttons_.clear();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
observation_.Reset();
|
||||
@ -503,12 +504,12 @@ void BruschettaInstallerView::OnStateUpdated() {
|
||||
if (progress_bar_visible) {
|
||||
progress_bar_->GetViewAccessibility().SetDescription(
|
||||
*secondary_message_label_);
|
||||
progress_bar_->NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged,
|
||||
true);
|
||||
progress_bar_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged, true);
|
||||
}
|
||||
|
||||
DialogModelChanged();
|
||||
primary_message_label_->NotifyAccessibilityEvent(
|
||||
primary_message_label_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kLiveRegionChanged,
|
||||
/* send_native_event = */ true);
|
||||
}
|
||||
@ -526,14 +527,14 @@ void BruschettaInstallerView::OnColorModeChanged(bool dark_mode_enabled) {
|
||||
void BruschettaInstallerView::SetPrimaryMessageLabel() {
|
||||
primary_message_label_->SetText(GetPrimaryMessage());
|
||||
primary_message_label_->SetVisible(true);
|
||||
primary_message_label_->NotifyAccessibilityEvent(
|
||||
primary_message_label_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged, true);
|
||||
}
|
||||
|
||||
void BruschettaInstallerView::SetSecondaryMessageLabel() {
|
||||
secondary_message_label_->SetText(GetSecondaryMessage());
|
||||
secondary_message_label_->SetVisible(true);
|
||||
secondary_message_label_->NotifyAccessibilityEvent(
|
||||
secondary_message_label_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged, true);
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ void CriticalNotificationBubbleView::Init() {
|
||||
void CriticalNotificationBubbleView::ViewHierarchyChanged(
|
||||
const views::ViewHierarchyChangedDetails& details) {
|
||||
if (details.is_add && details.child == this) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -981,7 +981,8 @@ std::u16string DownloadItemView::GetInProgressAccessibleAlertText() const {
|
||||
}
|
||||
|
||||
void DownloadItemView::AnnounceAccessibleAlert() {
|
||||
accessible_alert_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
accessible_alert_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, true);
|
||||
announce_accessible_alert_soon_ = false;
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,8 @@ void ExclusiveAccessBubbleViews::AnimationProgressed(
|
||||
void ExclusiveAccessBubbleViews::AnimationEnded(
|
||||
const gfx::Animation* animation) {
|
||||
if (animation_->IsShowing()) {
|
||||
GetView()->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
GetView()->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true);
|
||||
}
|
||||
AnimationProgressed(animation);
|
||||
}
|
||||
|
@ -1948,7 +1948,7 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
|
||||
if (focus_helper &&
|
||||
focus_helper->GetStoredFocus() != contents_web_view_) {
|
||||
GetWidget()->UpdateAccessibleNameForRootView();
|
||||
GetWidget()->GetRootView()->NotifyAccessibilityEvent(
|
||||
GetWidget()->GetRootView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kFocusContext, true);
|
||||
}
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ SkColor MediaItemUIDeviceSelectorView::GetIconLabelBubbleBackgroundColor()
|
||||
void MediaItemUIDeviceSelectorView::ShowDevices() {
|
||||
DCHECK(!is_expanded_);
|
||||
is_expanded_ = true;
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kExpandedChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kExpandedChanged, true);
|
||||
|
||||
// When this device selector view is used on Chrome OS ash, accessibility text
|
||||
// will be handled by MediaItemUIDetailedView instead of here.
|
||||
@ -337,7 +337,7 @@ void MediaItemUIDeviceSelectorView::ShowDevices() {
|
||||
void MediaItemUIDeviceSelectorView::HideDevices() {
|
||||
DCHECK(is_expanded_);
|
||||
is_expanded_ = false;
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kExpandedChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kExpandedChanged, true);
|
||||
|
||||
// When this device selector view is used on Chrome OS ash, accessibility text
|
||||
// will be handled by MediaItemUIDetailedView instead of here.
|
||||
|
@ -245,7 +245,7 @@ void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) {
|
||||
// infobar.
|
||||
if (focused_before && focused_now && !Contains(focused_before) &&
|
||||
Contains(focused_now)) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ void InfoBarView::PlatformSpecificShow(bool animate) {
|
||||
// that if we gain focus we'll know what the previously-focused element was.
|
||||
SetFocusManager(GetFocusManager());
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
void InfoBarView::PlatformSpecificHide(bool animate) {
|
||||
|
@ -359,7 +359,7 @@ void CookieControlsBubbleViewController::OnToggleButtonPressed(
|
||||
controller_->SetUserChangedCookieBlockingForSite(true);
|
||||
// Set the toggle ON when protections are ON (cookies are blocked).
|
||||
controller_->OnCookieBlockingEnabledForSite(protections_on);
|
||||
bubble_view_->GetContentView()->NotifyAccessibilityEvent(
|
||||
bubble_view_->GetContentView()->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,8 @@ void IconLabelBubbleView::AnimateIn(std::optional<int> string_id) {
|
||||
// virtual view.
|
||||
alert_virtual_view_->GetCustomData().role = ax::mojom::Role::kAlert;
|
||||
alert_virtual_view_->GetCustomData().SetNameChecked(label);
|
||||
alert_virtual_view_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert);
|
||||
alert_virtual_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert);
|
||||
}
|
||||
label()->SetVisible(true);
|
||||
ShowAnimation();
|
||||
@ -672,7 +673,8 @@ void IconLabelBubbleView::AnimateOut() {
|
||||
if (label()->GetVisible()) {
|
||||
label()->SetVisible(false);
|
||||
alert_virtual_view_->GetCustomData().AddState(ax::mojom::State::kInvisible);
|
||||
alert_virtual_view_->NotifyAccessibilityEvent(ax::mojom::Event::kHide);
|
||||
alert_virtual_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kHide);
|
||||
HideAnimation();
|
||||
}
|
||||
}
|
||||
|
@ -1582,8 +1582,8 @@ void LocationBarView::OnPopupVisibilityChanged() {
|
||||
}
|
||||
|
||||
// We indent the textfield when the popup is open to align to suggestions.
|
||||
omnibox_view_->NotifyAccessibilityEvent(ax::mojom::Event::kControlsChanged,
|
||||
true);
|
||||
omnibox_view_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kControlsChanged, true);
|
||||
}
|
||||
|
||||
const LocationBarModel* LocationBarView::GetLocationBarModel() const {
|
||||
|
@ -162,7 +162,8 @@ void SelectedKeywordView::SetKeyword(const std::u16string& keyword) {
|
||||
// class is calculating the preferred size. It will be updated again during
|
||||
// layout, taking into account how much space has actually been allotted.
|
||||
SetLabelForCurrentWidth();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kLiveRegionChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kLiveRegionChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
const std::u16string& SelectedKeywordView::GetKeyword() const {
|
||||
|
@ -567,7 +567,7 @@ void ZoomBubbleView::UpdateZoomPercent() {
|
||||
label_->SetText(base::FormatPercent(
|
||||
zoom::ZoomController::FromWebContents(web_contents())->GetZoomPercent()));
|
||||
label_->GetViewAccessibility().SetName(GetAccessibleWindowTitle());
|
||||
label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert, true);
|
||||
|
||||
// Disable buttons at min, max and default
|
||||
auto* zoom_controller = zoom::ZoomController::FromWebContents(web_contents());
|
||||
|
@ -495,7 +495,8 @@ void OmniboxPopupViewViews::OnGestureEvent(ui::GestureEvent* event) {
|
||||
void OmniboxPopupViewViews::FireAXEventsForNewActiveDescendant(
|
||||
View* descendant_view) {
|
||||
// Selected children changed is fired on the popup.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelectedChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelectedChildrenChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
void OmniboxPopupViewViews::OnWidgetBoundsChanged(views::Widget* widget,
|
||||
|
@ -359,7 +359,7 @@ void PageInfoCookiesContentView::UpdateBlockingThirdPartyCookiesToggle(
|
||||
void PageInfoCookiesContentView::OnToggleButtonPressed() {
|
||||
presenter_->OnThirdPartyToggleClicked(
|
||||
/*block_third_party_cookies=*/!third_party_cookies_toggle_->GetIsOn());
|
||||
third_party_cookies_container_->NotifyAccessibilityEvent(
|
||||
third_party_cookies_container_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
|
@ -339,8 +339,8 @@ void PasswordSaveUpdateView::AnnounceBubbleChange() {
|
||||
views::ViewAccessibility& ax = accessibility_alert_->GetViewAccessibility();
|
||||
ax.SetRole(ax::mojom::Role::kAlert);
|
||||
ax.SetName(GetWindowTitle(), ax::mojom::NameFrom::kAttribute);
|
||||
accessibility_alert_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
|
||||
true);
|
||||
accessibility_alert_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, true);
|
||||
}
|
||||
|
||||
void PasswordSaveUpdateView::OnContentChanged() {
|
||||
|
@ -1404,11 +1404,15 @@ class ProfileMenuViewBase::AXMenuWidgetObserver : public views::WidgetObserver {
|
||||
|
||||
void OnWidgetActivationChanged(views::Widget* widget, bool active) override {
|
||||
if (active) {
|
||||
owner_->NotifyAccessibilityEvent(ax::mojom::Event::kMenuStart, true);
|
||||
owner_->NotifyAccessibilityEvent(ax::mojom::Event::kMenuPopupStart, true);
|
||||
owner_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuStart,
|
||||
true);
|
||||
owner_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kMenuPopupStart, true);
|
||||
} else {
|
||||
owner_->NotifyAccessibilityEvent(ax::mojom::Event::kMenuPopupEnd, true);
|
||||
owner_->NotifyAccessibilityEvent(ax::mojom::Event::kMenuEnd, true);
|
||||
owner_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kMenuPopupEnd, true);
|
||||
owner_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kMenuEnd,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -837,7 +837,7 @@ void ParentPermissionDialogView::OnReAuthProofTokenFailure(
|
||||
invalid_credential_label_->SetProperty(
|
||||
views::kElementIdentifierKey,
|
||||
ParentPermissionDialog::kIncorrectParentPasswordIdForTesting);
|
||||
invalid_credential_label_->NotifyAccessibilityEvent(
|
||||
invalid_credential_label_->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kAlert, true);
|
||||
return;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ bool TabGroupHeader::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
!editor_bubble_tracker_.is_open()) {
|
||||
tab_slot_controller_->ToggleTabGroupCollapsedState(
|
||||
group().value(), ToggleTabGroupCollapsedStateOrigin::kKeyboard);
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1407,7 +1407,8 @@ void TabStrip::OnWidgetActivationChanged(views::Widget* widget, bool active) {
|
||||
// on the tab. Nevertheless, JAWS needs the event to be fired regardless,
|
||||
// as per https://crbug.com/41450089.
|
||||
tab_at(selected_tabs_.active().value())
|
||||
->NotifyAccessibilityEvent(ax::mojom::Event::kSelection, true);
|
||||
->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kSelection,
|
||||
true);
|
||||
}
|
||||
|
||||
UpdateHoverCard(nullptr, HoverCardUpdateType::kEvent);
|
||||
|
@ -832,7 +832,8 @@ class AppMenu::ZoomView : public AppMenuView, public views::WidgetObserver {
|
||||
if (!on_construction) {
|
||||
// An alert notification will ensure that the zoom label is always
|
||||
// announced even if is not focusable.
|
||||
zoom_label_->NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
|
||||
zoom_label_->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kAlert,
|
||||
true);
|
||||
}
|
||||
zoom_label_max_width_.reset();
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ void WebAppOriginText::StartFadeAnimation() {
|
||||
|
||||
label_layer->GetAnimator()->StartAnimation(opacity_sequence.release());
|
||||
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kValueChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kValueChanged, true);
|
||||
}
|
||||
|
||||
void WebAppOriginText::OnLayerAnimationEnded(
|
||||
|
@ -226,8 +226,8 @@ void PinTextfield::UpdateAccessibilityAfterPinChange() {
|
||||
|
||||
// Don't announce the selected text (last typed digit) in `obscured_` mode.
|
||||
if (!obscured_) {
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged,
|
||||
/*send_native_event=*/true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kTextSelectionChanged,
|
||||
/*send_native_event=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -936,7 +936,7 @@ void ArcNotificationContentView::OnNotificationSurfaceAdded(
|
||||
// updated. As order of OnNotificationSurfaceAdded call is not guaranteed, we
|
||||
// are dispatching the event in both ArcNotificationContentView and
|
||||
// ArcAccessibilityHelperBridge.
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, false);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged, false);
|
||||
}
|
||||
|
||||
void ArcNotificationContentView::OnNotificationSurfaceRemoved(
|
||||
|
@ -651,8 +651,8 @@ void ShellSurfaceBase::SetApplicationId(const char* application_id) {
|
||||
} else {
|
||||
GetViewAccessibility().RemoveChildTreeNodeAppId();
|
||||
}
|
||||
this->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged,
|
||||
/* send_native_event */ false);
|
||||
this->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
/* send_native_event */ false);
|
||||
}
|
||||
|
||||
void ShellSurfaceBase::SetStartupId(const char* startup_id) {
|
||||
@ -828,7 +828,8 @@ void ShellSurfaceBase::UpdateTopInset() {
|
||||
|
||||
void ShellSurfaceBase::SetChildAxTreeId(ui::AXTreeID child_ax_tree_id) {
|
||||
GetViewAccessibility().SetChildTreeID(child_ax_tree_id);
|
||||
this->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, false);
|
||||
this->NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
false);
|
||||
}
|
||||
|
||||
void ShellSurfaceBase::SetGeometry(const gfx::Rect& geometry) {
|
||||
|
@ -365,7 +365,8 @@ class CaptionBubbleLabel : public views::Label {
|
||||
auto& ax_lines = GetViewAccessibility().virtual_children();
|
||||
if (text.empty() && !ax_lines.empty()) {
|
||||
GetViewAccessibility().RemoveAllVirtualChildViews();
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -386,7 +387,8 @@ class CaptionBubbleLabel : public views::Label {
|
||||
size_t num_ax_lines = ax_lines.size();
|
||||
for (size_t i = num_lines; i < num_ax_lines; ++i) {
|
||||
GetViewAccessibility().RemoveVirtualChildView(ax_lines.back().get());
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -414,7 +416,8 @@ class CaptionBubbleLabel : public views::Label {
|
||||
auto ax_line = std::make_unique<views::AXVirtualView>();
|
||||
ax_line->GetCustomData().role = ax::mojom::Role::kStaticText;
|
||||
GetViewAccessibility().AddVirtualChildView(std::move(ax_line));
|
||||
NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, true);
|
||||
NotifyAccessibilityEventDeprecated(ax::mojom::Event::kChildrenChanged,
|
||||
true);
|
||||
}
|
||||
|
||||
// Set the virtual child's name as line text.
|
||||
@ -424,7 +427,7 @@ class CaptionBubbleLabel : public views::Label {
|
||||
ax_node_data.SetNameChecked(line_text);
|
||||
std::vector<gfx::Rect> bounds = GetSubstringBounds(text_range);
|
||||
ax_node_data.relative_bounds.bounds = gfx::RectF(bounds[0]);
|
||||
ax_lines[line_index]->NotifyAccessibilityEvent(
|
||||
ax_lines[line_index]->NotifyAccessibilityEventDeprecated(
|
||||
ax::mojom::Event::kTextChanged);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user