| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 return NULL; | 482 return NULL; |
| 483 | 483 |
| 484 return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); | 484 return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 static AtkObject* browser_accessibility_get_parent(AtkObject* atk_object) { | 487 static AtkObject* browser_accessibility_get_parent(AtkObject* atk_object) { |
| 488 BrowserAccessibilityAuraLinux* obj = | 488 BrowserAccessibilityAuraLinux* obj = |
| 489 ToBrowserAccessibilityAuraLinux(atk_object); | 489 ToBrowserAccessibilityAuraLinux(atk_object); |
| 490 if (!obj) | 490 if (!obj) |
| 491 return NULL; | 491 return NULL; |
| 492 if (obj->GetParent()) | 492 if (obj->PlatformGetParent()) |
| 493 return ToBrowserAccessibilityAuraLinux(obj->GetParent())->GetAtkObject(); | 493 return ToBrowserAccessibilityAuraLinux(obj->PlatformGetParent()) |
| 494 ->GetAtkObject(); |
| 494 | 495 |
| 495 BrowserAccessibilityManagerAuraLinux* manager = | 496 BrowserAccessibilityManagerAuraLinux* manager = |
| 496 static_cast<BrowserAccessibilityManagerAuraLinux*>(obj->manager()); | 497 static_cast<BrowserAccessibilityManagerAuraLinux*>(obj->manager()); |
| 497 return manager->parent_object(); | 498 return manager->parent_object(); |
| 498 } | 499 } |
| 499 | 500 |
| 500 static gint browser_accessibility_get_n_children(AtkObject* atk_object) { | 501 static gint browser_accessibility_get_n_children(AtkObject* atk_object) { |
| 501 BrowserAccessibilityAuraLinux* obj = | 502 BrowserAccessibilityAuraLinux* obj = |
| 502 ToBrowserAccessibilityAuraLinux(atk_object); | 503 ToBrowserAccessibilityAuraLinux(atk_object); |
| 503 if (!obj) | 504 if (!obj) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 int interface_mask = GetInterfaceMaskFromObject(this); | 778 int interface_mask = GetInterfaceMaskFromObject(this); |
| 778 if (interface_mask != interface_mask_) { | 779 if (interface_mask != interface_mask_) { |
| 779 g_object_unref(atk_object_); | 780 g_object_unref(atk_object_); |
| 780 atk_object_ = NULL; | 781 atk_object_ = NULL; |
| 781 } | 782 } |
| 782 } | 783 } |
| 783 | 784 |
| 784 if (!atk_object_) { | 785 if (!atk_object_) { |
| 785 interface_mask_ = GetInterfaceMaskFromObject(this); | 786 interface_mask_ = GetInterfaceMaskFromObject(this); |
| 786 atk_object_ = ATK_OBJECT(browser_accessibility_new(this)); | 787 atk_object_ = ATK_OBJECT(browser_accessibility_new(this)); |
| 787 if (this->GetParent()) { | 788 if (this->PlatformGetParent()) { |
| 788 atk_object_set_parent( | 789 atk_object_set_parent(atk_object_, ToBrowserAccessibilityAuraLinux( |
| 789 atk_object_, | 790 this->PlatformGetParent()) |
| 790 ToBrowserAccessibilityAuraLinux(this->GetParent())->GetAtkObject()); | 791 ->GetAtkObject()); |
| 791 } | 792 } |
| 792 } | 793 } |
| 793 } | 794 } |
| 794 | 795 |
| 795 bool BrowserAccessibilityAuraLinux::IsNative() const { | 796 bool BrowserAccessibilityAuraLinux::IsNative() const { |
| 796 return true; | 797 return true; |
| 797 } | 798 } |
| 798 | 799 |
| 799 void BrowserAccessibilityAuraLinux::InitRoleAndState() { | 800 void BrowserAccessibilityAuraLinux::InitRoleAndState() { |
| 800 switch (GetRole()) { | 801 switch (GetRole()) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 atk_role_ = ATK_ROLE_SECTION; | 961 atk_role_ = ATK_ROLE_SECTION; |
| 961 #endif | 962 #endif |
| 962 break; | 963 break; |
| 963 default: | 964 default: |
| 964 atk_role_ = ATK_ROLE_UNKNOWN; | 965 atk_role_ = ATK_ROLE_UNKNOWN; |
| 965 break; | 966 break; |
| 966 } | 967 } |
| 967 } | 968 } |
| 968 | 969 |
| 969 } // namespace content | 970 } // namespace content |
| OLD | NEW |