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

Unified Diff: ui/views/accessibility/native_view_accessibility.cc

Issue 2141013004: Mac a11y: Add Help, TopLevelUIElement, and Window accessibility attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test views without tooltips set. Created 4 years, 5 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: ui/views/accessibility/native_view_accessibility.cc
diff --git a/ui/views/accessibility/native_view_accessibility.cc b/ui/views/accessibility/native_view_accessibility.cc
index 0cdec0d150397aec2813046df89fb1e840bc32c4..bea77a1011b3036d5ca2691c81cd594bb2e447fe 100644
--- a/ui/views/accessibility/native_view_accessibility.cc
+++ b/ui/views/accessibility/native_view_accessibility.cc
@@ -8,6 +8,7 @@
#include "build/build_config.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/events/event_utils.h"
+#include "ui/gfx/native_widget_types.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -65,6 +66,11 @@ const ui::AXNodeData& NativeViewAccessibility::GetData() {
base::UTF16ToUTF8(state.keyboard_shortcut));
data_.AddStringAttribute(ui::AX_ATTR_PLACEHOLDER,
base::UTF16ToUTF8(state.placeholder));
+
+ if (view_->GetTooltipText(gfx::Point(), &state.help_text))
tapted 2016/07/18 03:38:48 passing gfx::Point() might not work for the bookma
Patti Lor 2016/07/19 01:14:10 Have double checked this and you are right - both
tapted 2016/07/19 03:22:50 Acknowledged. Yeah I only had a skim of the bookma
Patti Lor 2016/07/19 05:29:24 I checked this using the XCode Accessibility Inspe
+ data_.AddStringAttribute(ui::AX_ATTR_HELP_TEXT,
+ base::UTF16ToUTF8(state.help_text));
+
data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, state.selection_start);
data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end);
@@ -105,6 +111,10 @@ gfx::NativeViewAccessible NativeViewAccessibility::ChildAtIndex(int index) {
return nullptr;
}
+gfx::NativeWindow NativeViewAccessibility::GetTopLevelWidget() {
+ return view_->GetWidget()->GetTopLevelWidget()->GetNativeWindow();
tapted 2016/07/19 03:22:50 oops - I thought I'd written a comment here but I
Patti Lor 2016/07/19 05:29:24 Done, thank you.
+}
+
gfx::NativeViewAccessible NativeViewAccessibility::GetParent() {
if (view_->parent())
return view_->parent()->GetNativeViewAccessible();

Powered by Google App Engine
This is Rietveld 408576698