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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 2670003002: Accessibility for Autofill Popup View in native code (Closed)
Patch Set: Inline implementation of AutofillPopupChildView. Created 3 years, 10 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: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index dcf42475ce7723add5e3f6d31b9f63143d3fe475..a6df9d118e531b9479ce06667bd952f3a9e7625d 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -17,6 +17,7 @@
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
#include "content/public/browser/native_web_keyboard_event.h"
+#include "ui/accessibility/ax_enums.h"
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/text_elider.h"
@@ -401,8 +402,11 @@ void AutofillPopupControllerImpl::SetSelectedLine(int selected_line) {
if (selected_line != kNoSelection) {
InvalidateRow(selected_line);
- if (!CanAccept(suggestions_[selected_line].frontend_id))
+ if (CanAccept(suggestions_[selected_line].frontend_id)) {
+ NotifyAccessibilityEventForRow(ui::AX_EVENT_SELECTION, selected_line);
+ } else {
selected_line = kNoSelection;
+ }
}
selected_line_ = selected_line;
@@ -492,6 +496,13 @@ void AutofillPopupControllerImpl::InvalidateRow(size_t row) {
view_->InvalidateRow(row);
}
+void AutofillPopupControllerImpl::NotifyAccessibilityEventForRow(
+ ui::AXEvent event_type, size_t row) {
+ DCHECK(0 <= row);
+ DCHECK(row < suggestions_.size());
+ view_->NotifyAccessibilityEventForRow(event_type, row);
+}
+
WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}

Powered by Google App Engine
This is Rietveld 408576698