OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/webaccessibility.h" | 5 #include "webkit/glue/webaccessibility.h" |
6 | 6 |
7 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" | 7 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityRole.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityRole.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 : id(-1), | 262 : id(-1), |
263 role(ROLE_NONE), | 263 role(ROLE_NONE), |
264 state(-1) { | 264 state(-1) { |
265 } | 265 } |
266 | 266 |
267 WebAccessibility::WebAccessibility(const WebKit::WebAccessibilityObject& src, | 267 WebAccessibility::WebAccessibility(const WebKit::WebAccessibilityObject& src, |
268 WebKit::WebAccessibilityCache* cache) { | 268 WebKit::WebAccessibilityCache* cache) { |
269 Init(src, cache); | 269 Init(src, cache); |
270 } | 270 } |
271 | 271 |
| 272 WebAccessibility::~WebAccessibility() { |
| 273 } |
| 274 |
272 void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src, | 275 void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src, |
273 WebKit::WebAccessibilityCache* cache) { | 276 WebKit::WebAccessibilityCache* cache) { |
274 name = src.title(); | 277 name = src.title(); |
275 value = src.stringValue(); | 278 value = src.stringValue(); |
276 role = ConvertRole(src.roleValue()); | 279 role = ConvertRole(src.roleValue()); |
277 state = ConvertState(src); | 280 state = ConvertState(src); |
278 location = src.boundingBoxRect(); | 281 location = src.boundingBoxRect(); |
279 | 282 |
280 if (src.actionVerb().length()) | 283 if (src.actionVerb().length()) |
281 attributes[ATTR_ACTION] = src.actionVerb(); | 284 attributes[ATTR_ACTION] = src.actionVerb(); |
282 if (src.accessibilityDescription().length()) | 285 if (src.accessibilityDescription().length()) |
283 attributes[ATTR_DESCRIPTION] = src.accessibilityDescription(); | 286 attributes[ATTR_DESCRIPTION] = src.accessibilityDescription(); |
284 if (src.helpText().length()) | 287 if (src.helpText().length()) |
285 attributes[ATTR_HELP] = src.helpText(); | 288 attributes[ATTR_HELP] = src.helpText(); |
286 if (src.keyboardShortcut().length()) | 289 if (src.keyboardShortcut().length()) |
287 attributes[ATTR_SHORTCUT] = src.keyboardShortcut(); | 290 attributes[ATTR_SHORTCUT] = src.keyboardShortcut(); |
288 | 291 |
289 // Add the source object to the cache and store its id. | 292 // Add the source object to the cache and store its id. |
290 id = cache->addOrGetId(src); | 293 id = cache->addOrGetId(src); |
291 | 294 |
292 // Recursively create children. | 295 // Recursively create children. |
293 int child_count = src.childCount(); | 296 int child_count = src.childCount(); |
294 children.resize(child_count); | 297 children.resize(child_count); |
295 for (int i = 0; i < child_count; i++) { | 298 for (int i = 0; i < child_count; i++) { |
296 children[i].Init(src.childAt(i), cache); | 299 children[i].Init(src.childAt(i), cache); |
297 } | 300 } |
298 } | 301 } |
299 | 302 |
300 } // namespace webkit_glue | 303 } // namespace webkit_glue |
OLD | NEW |