| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_auralinux.h" | 5 #include "content/browser/accessibility/browser_accessibility_auralinux.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 | 464 |
| 465 return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_object)); | 465 return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_object)); |
| 466 } | 466 } |
| 467 | 467 |
| 468 static const gchar* browser_accessibility_get_name(AtkObject* atk_object) { | 468 static const gchar* browser_accessibility_get_name(AtkObject* atk_object) { |
| 469 BrowserAccessibilityAuraLinux* obj = | 469 BrowserAccessibilityAuraLinux* obj = |
| 470 ToBrowserAccessibilityAuraLinux(atk_object); | 470 ToBrowserAccessibilityAuraLinux(atk_object); |
| 471 if (!obj) | 471 if (!obj) |
| 472 return NULL; | 472 return NULL; |
| 473 | 473 |
| 474 return obj->GetStringAttribute(ui::AX_ATTR_NAME).c_str(); | 474 const std::string name = obj->GetStringAttribute(ui::AX_ATTR_NAME); |
| 475 // TODO(aleventhal) Why does this crash tests on trybot, but not locally? |
| 476 // if (name.empty() && !obj->HasExplicitlyEmptyName()) |
| 477 // return NULL; |
| 478 |
| 479 return name.c_str(); |
| 475 } | 480 } |
| 476 | 481 |
| 477 static const gchar* browser_accessibility_get_description( | 482 static const gchar* browser_accessibility_get_description( |
| 478 AtkObject* atk_object) { | 483 AtkObject* atk_object) { |
| 479 BrowserAccessibilityAuraLinux* obj = | 484 BrowserAccessibilityAuraLinux* obj = |
| 480 ToBrowserAccessibilityAuraLinux(atk_object); | 485 ToBrowserAccessibilityAuraLinux(atk_object); |
| 481 if (!obj) | 486 if (!obj) |
| 482 return NULL; | 487 return NULL; |
| 483 | 488 |
| 484 return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); | 489 return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 atk_role_ = ATK_ROLE_SECTION; | 969 atk_role_ = ATK_ROLE_SECTION; |
| 965 #endif | 970 #endif |
| 966 break; | 971 break; |
| 967 default: | 972 default: |
| 968 atk_role_ = ATK_ROLE_UNKNOWN; | 973 atk_role_ = ATK_ROLE_UNKNOWN; |
| 969 break; | 974 break; |
| 970 } | 975 } |
| 971 } | 976 } |
| 972 | 977 |
| 973 } // namespace content | 978 } // namespace content |
| OLD | NEW |