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

Unified Diff: chrome/browser/ui/views/subtle_notification_view.cc

Issue 2010493005: a11y/Mac: Add screenreader support for SubtleNotificationView announcements. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and use title instead of value. Created 4 years, 6 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/views/subtle_notification_view.cc
diff --git a/chrome/browser/ui/views/subtle_notification_view.cc b/chrome/browser/ui/views/subtle_notification_view.cc
index 8d42713d9d59bbfab42d6ea49c257883f5927e4d..dbe9f58ed980a5e1748663ff86b9b84b7b5688b8 100644
--- a/chrome/browser/ui/views/subtle_notification_view.cc
+++ b/chrome/browser/ui/views/subtle_notification_view.cc
@@ -9,6 +9,7 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/accessibility/ax_view_state.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/font_list.h"
#include "ui/views/bubble/bubble_border.h"
@@ -49,6 +50,7 @@ class SubtleNotificationView::InstructionView : public views::View {
SkColor foreground_color,
SkColor background_color);
+ base::string16 text();
tapted 2016/06/22 00:23:38 nit: declare const function
Patti Lor 2016/06/23 01:00:38 Done.
void SetText(const base::string16& text);
private:
@@ -82,6 +84,10 @@ SubtleNotificationView::InstructionView::InstructionView(
SetText(text);
}
+base::string16 SubtleNotificationView::InstructionView::text() {
+ return text_;
tapted 2016/06/22 00:23:38 nit: declare this inline
Matt Giuca 2016/06/22 02:59:20 This needs to have the pipes removed (http://www.o
Patti Lor 2016/06/23 01:00:38 Done (as per option 2).
+}
+
void SubtleNotificationView::InstructionView::SetText(
const base::string16& text) {
// Avoid replacing the contents with the same text.
@@ -208,3 +214,10 @@ views::Widget* SubtleNotificationView::CreatePopupWidget(
return popup;
}
+
+// views::View:
tapted 2016/06/22 00:23:38 nit: no need for this comment
Patti Lor 2016/06/23 01:00:39 Done.
+
+void SubtleNotificationView::GetAccessibleState(ui::AXViewState* state) {
+ state->role = ui::AX_ROLE_LABEL_TEXT;
+ state->name = instruction_view_->text();
Matt Giuca 2016/06/22 02:59:20 This needs to have the pipes removed (http://www.o
Patti Lor 2016/06/23 01:00:38 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698