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

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 13770015: Rename confusing child_id to unique_id_win (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed feedback Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "content/browser/accessibility/browser_accessibility_manager.h" 10 #include "content/browser/accessibility/browser_accessibility_manager.h"
(...skipping 13 matching lines...) Expand all
24 // and Win. For any other platform, instantiate the base class. 24 // and Win. For any other platform, instantiate the base class.
25 // static 25 // static
26 BrowserAccessibility* BrowserAccessibility::Create() { 26 BrowserAccessibility* BrowserAccessibility::Create() {
27 return new BrowserAccessibility(); 27 return new BrowserAccessibility();
28 } 28 }
29 #endif 29 #endif
30 30
31 BrowserAccessibility::BrowserAccessibility() 31 BrowserAccessibility::BrowserAccessibility()
32 : manager_(NULL), 32 : manager_(NULL),
33 parent_(NULL), 33 parent_(NULL),
34 child_id_(0),
35 index_in_parent_(0), 34 index_in_parent_(0),
36 renderer_id_(0), 35 renderer_id_(0),
37 role_(0), 36 role_(0),
38 state_(0), 37 state_(0),
39 instance_active_(false) { 38 instance_active_(false) {
40 } 39 }
41 40
42 BrowserAccessibility::~BrowserAccessibility() { 41 BrowserAccessibility::~BrowserAccessibility() {
43 } 42 }
44 43
45 void BrowserAccessibility::DetachTree( 44 void BrowserAccessibility::DetachTree(
46 std::vector<BrowserAccessibility*>* nodes) { 45 std::vector<BrowserAccessibility*>* nodes) {
47 nodes->push_back(this); 46 nodes->push_back(this);
48 for (size_t i = 0; i < children_.size(); i++) 47 for (size_t i = 0; i < children_.size(); i++)
49 children_[i]->DetachTree(nodes); 48 children_[i]->DetachTree(nodes);
50 children_.clear(); 49 children_.clear();
51 parent_ = NULL; 50 parent_ = NULL;
52 } 51 }
53 52
54 void BrowserAccessibility::InitializeTreeStructure( 53 void BrowserAccessibility::InitializeTreeStructure(
55 BrowserAccessibilityManager* manager, 54 BrowserAccessibilityManager* manager,
56 BrowserAccessibility* parent, 55 BrowserAccessibility* parent,
57 int32 child_id,
58 int32 renderer_id, 56 int32 renderer_id,
59 int32 index_in_parent) { 57 int32 index_in_parent) {
60 manager_ = manager; 58 manager_ = manager;
61 parent_ = parent; 59 parent_ = parent;
62 child_id_ = child_id;
63 renderer_id_ = renderer_id; 60 renderer_id_ = renderer_id;
64 index_in_parent_ = index_in_parent; 61 index_in_parent_ = index_in_parent;
65 } 62 }
66 63
67 void BrowserAccessibility::InitializeData(const AccessibilityNodeData& src) { 64 void BrowserAccessibility::InitializeData(const AccessibilityNodeData& src) {
68 DCHECK_EQ(renderer_id_, src.id); 65 DCHECK_EQ(renderer_id_, src.id);
69 name_ = src.name; 66 name_ = src.name;
70 value_ = src.value; 67 value_ = src.value;
71 role_ = src.role; 68 role_ = src.role;
72 state_ = src.state; 69 state_ = src.state;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 195
199 // Allow the object to fire a TextRemoved notification. 196 // Allow the object to fire a TextRemoved notification.
200 name_.clear(); 197 name_.clear();
201 value_.clear(); 198 value_.clear();
202 PostInitialize(); 199 PostInitialize();
203 200
204 manager_->NotifyAccessibilityEvent( 201 manager_->NotifyAccessibilityEvent(
205 AccessibilityNotificationObjectHide, this); 202 AccessibilityNotificationObjectHide, this);
206 203
207 instance_active_ = false; 204 instance_active_ = false;
208 manager_->Remove(this); 205 manager_->RemoveNode(this);
209 NativeReleaseReference(); 206 NativeReleaseReference();
210 } 207 }
211 208
212 void BrowserAccessibility::NativeReleaseReference() { 209 void BrowserAccessibility::NativeReleaseReference() {
213 delete this; 210 delete this;
214 } 211 }
215 212
216 bool BrowserAccessibility::GetBoolAttribute( 213 bool BrowserAccessibility::GetBoolAttribute(
217 BoolAttribute attribute, bool* value) const { 214 BoolAttribute attribute, bool* value) const {
218 BoolAttrMap::const_iterator iter = bool_attributes_.find(attribute); 215 BoolAttrMap::const_iterator iter = bool_attributes_.find(attribute);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return name_; 312 return name_;
316 } 313 }
317 314
318 string16 result; 315 string16 result;
319 for (size_t i = 0; i < children_.size(); ++i) 316 for (size_t i = 0; i < children_.size(); ++i)
320 result += children_[i]->GetTextRecursive(); 317 result += children_[i]->GetTextRecursive();
321 return result; 318 return result;
322 } 319 }
323 320
324 } // namespace content 321 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility.h ('k') | content/browser/accessibility/browser_accessibility_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698