Commit 16d5b646 authored by wutao's avatar wutao Committed by Commit Bot

assistant: Add a11y heading to query log

This cl adds a11y heading to query log in the AssistantQueryView.

Bug: b/113734499
Test: tested on EVE
Change-Id: I5dcca50ef2b6a28e050b3dc462437c60036c56d7
Reviewed-on: https://chromium-review.googlesource.com/c/1285051
Commit-Queue: Tao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600932}
parent 437b8ad4
...@@ -502,6 +502,12 @@ bool AssistantMainStage::OnActiveQueryExitAnimationEnded( ...@@ -502,6 +502,12 @@ bool AssistantMainStage::OnActiveQueryExitAnimationEnded(
const ui::CallbackLayerAnimationObserver& observer) { const ui::CallbackLayerAnimationObserver& observer) {
// The exited active query view will always be the first child of its parent. // The exited active query view will always be the first child of its parent.
delete query_layout_container_->child_at(0); delete query_layout_container_->child_at(0);
// TODO(https://crbug.com/896079): Remove this when view.cc handles the
// event notification.
query_layout_container_->NotifyAccessibilityEvent(
ax::mojom::Event::kChildrenChanged, false);
UpdateTopPadding(); UpdateTopPadding();
// Return false to prevent the observer from destroying itself. // Return false to prevent the observer from destroying itself.
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "ash/assistant/model/assistant_query.h" #include "ash/assistant/model/assistant_query.h"
#include "ash/assistant/ui/assistant_ui_constants.h" #include "ash/assistant/ui/assistant_ui_constants.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
namespace ash { namespace ash {
...@@ -37,6 +39,7 @@ views::StyledLabel::RangeStyleInfo CreateStyleInfo(SkColor color) { ...@@ -37,6 +39,7 @@ views::StyledLabel::RangeStyleInfo CreateStyleInfo(SkColor color) {
AssistantQueryView::AssistantQueryView() { AssistantQueryView::AssistantQueryView() {
InitLayout(); InitLayout();
GetViewAccessibility().OverrideRole(ax::mojom::Role::kHeading);
} }
AssistantQueryView::~AssistantQueryView() = default; AssistantQueryView::~AssistantQueryView() = default;
......
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