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

Side by Side Diff: ui/views/accessibility/ax_window_obj_wrapper.cc

Issue 2008773002: Begin using ChromeVox Next to read tab and window titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bunch of tests. 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 unified diff | Download patch
« no previous file with comments | « ui/views/accessibility/ax_widget_obj_wrapper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/accessibility/ax_window_obj_wrapper.h" 5 #include "ui/views/accessibility/ax_window_obj_wrapper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/accessibility/ax_node_data.h" 10 #include "ui/accessibility/ax_node_data.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // Also consider any associated widgets as children. 44 // Also consider any associated widgets as children.
45 Widget* widget = Widget::GetWidgetForNativeView(window_); 45 Widget* widget = Widget::GetWidgetForNativeView(window_);
46 if (widget) 46 if (widget)
47 out_children->push_back(AXAuraObjCache::GetInstance()->GetOrCreate(widget)); 47 out_children->push_back(AXAuraObjCache::GetInstance()->GetOrCreate(widget));
48 } 48 }
49 49
50 void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) { 50 void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
51 out_node_data->id = GetID(); 51 out_node_data->id = GetID();
52 out_node_data->role = is_alert_ ? ui::AX_ROLE_ALERT : ui::AX_ROLE_WINDOW; 52 out_node_data->role = is_alert_ ? ui::AX_ROLE_ALERT : ui::AX_ROLE_WINDOW;
53 // TODO(dtseng): Set better states. 53 out_node_data->AddStringAttribute(ui::AX_ATTR_NAME,
54 base::UTF16ToUTF8(window_->title()));
54 out_node_data->state = 0; 55 out_node_data->state = 0;
55 out_node_data->location = window_->bounds(); 56 out_node_data->location = window_->bounds();
56
57 // Root windows currently have a non readable name (e.g. Display1234...);
58 // ignore them unless the window is the only node in the tree.
59 if (window_->parent() || window_->children().size() == 0) {
60 out_node_data->AddStringAttribute(ui::AX_ATTR_NAME,
61 base::UTF16ToUTF8(window_->title()));
62 }
63 } 57 }
64 58
65 int32_t AXWindowObjWrapper::GetID() { 59 int32_t AXWindowObjWrapper::GetID() {
66 return AXAuraObjCache::GetInstance()->GetID(window_); 60 return AXAuraObjCache::GetInstance()->GetID(window_);
67 } 61 }
68 62
69 void AXWindowObjWrapper::OnWindowDestroyed(aura::Window* window) { 63 void AXWindowObjWrapper::OnWindowDestroyed(aura::Window* window) {
70 AXAuraObjCache::GetInstance()->Remove(window); 64 AXAuraObjCache::GetInstance()->Remove(window);
71 } 65 }
72 66
73 } // namespace views 67 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/accessibility/ax_widget_obj_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698