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

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

Issue 743273002: Various changes required to support ChromeVox Next to read Views and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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 | « chromeos/chromeos_switches.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 "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/views/accessibility/ax_aura_obj_cache.h" 10 #include "ui/views/accessibility/ax_aura_obj_cache.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 if (widget) 42 if (widget)
43 out_children->push_back(AXAuraObjCache::GetInstance()->GetOrCreate(widget)); 43 out_children->push_back(AXAuraObjCache::GetInstance()->GetOrCreate(widget));
44 } 44 }
45 45
46 void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) { 46 void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
47 out_node_data->id = GetID(); 47 out_node_data->id = GetID();
48 out_node_data->role = ui::AX_ROLE_WINDOW; 48 out_node_data->role = ui::AX_ROLE_WINDOW;
49 // TODO(dtseng): Set better states. 49 // TODO(dtseng): Set better states.
50 out_node_data->state = 0; 50 out_node_data->state = 0;
51 out_node_data->location = window_->bounds(); 51 out_node_data->location = window_->bounds();
52 out_node_data->AddStringAttribute( 52
53 ui::AX_ATTR_NAME, base::UTF16ToUTF8(window_->title())); 53 // Root windows currently have a non readable name (e.g. Display1234...);
54 // ignore them unless the window is the only node in the tree.
55 if (window_->parent() || window_->children().size() == 0) {
56 out_node_data->AddStringAttribute(ui::AX_ATTR_NAME,
57 base::UTF16ToUTF8(window_->title()));
58 }
54 } 59 }
55 60
56 int32 AXWindowObjWrapper::GetID() { 61 int32 AXWindowObjWrapper::GetID() {
57 return AXAuraObjCache::GetInstance()->GetID(window_); 62 return AXAuraObjCache::GetInstance()->GetID(window_);
58 } 63 }
59 64
60 void AXWindowObjWrapper::OnWindowDestroying(aura::Window* window) { 65 void AXWindowObjWrapper::OnWindowDestroying(aura::Window* window) {
61 AXAuraObjCache::GetInstance()->Remove(window); 66 AXAuraObjCache::GetInstance()->Remove(window);
62 } 67 }
63 68
64 } // namespace views 69 } // namespace views
OLDNEW
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698