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/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 static gboolean browser_accessibility_grab_focus(AtkComponent* atk_component) { | 172 static gboolean browser_accessibility_grab_focus(AtkComponent* atk_component) { |
173 g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), FALSE); | 173 g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), FALSE); |
174 | 174 |
175 BrowserAccessibilityAuraLinux* obj = | 175 BrowserAccessibilityAuraLinux* obj = |
176 ToBrowserAccessibilityAuraLinux(atk_component); | 176 ToBrowserAccessibilityAuraLinux(atk_component); |
177 if (!obj) | 177 if (!obj) |
178 return false; | 178 return false; |
179 | 179 |
180 obj->manager()->SetFocus(obj, true); | 180 obj->manager()->SetFocus(*obj); |
181 return true; | 181 return true; |
182 } | 182 } |
183 | 183 |
184 static void ComponentInterfaceInit(AtkComponentIface* iface) { | 184 static void ComponentInterfaceInit(AtkComponentIface* iface) { |
185 iface->ref_accessible_at_point = browser_accessibility_accessible_at_point; | 185 iface->ref_accessible_at_point = browser_accessibility_accessible_at_point; |
186 iface->get_extents = browser_accessibility_get_extents; | 186 iface->get_extents = browser_accessibility_get_extents; |
187 iface->grab_focus = browser_accessibility_grab_focus; | 187 iface->grab_focus = browser_accessibility_grab_focus; |
188 } | 188 } |
189 | 189 |
190 static const GInterfaceInfo ComponentInfo = { | 190 static const GInterfaceInfo ComponentInfo = { |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 BrowserAccessibilityAuraLinux* obj = | 532 BrowserAccessibilityAuraLinux* obj = |
533 ToBrowserAccessibilityAuraLinux(atk_object); | 533 ToBrowserAccessibilityAuraLinux(atk_object); |
534 if (!obj) | 534 if (!obj) |
535 return NULL; | 535 return NULL; |
536 AtkStateSet* state_set = ATK_OBJECT_CLASS(browser_accessibility_parent_class) | 536 AtkStateSet* state_set = ATK_OBJECT_CLASS(browser_accessibility_parent_class) |
537 ->ref_state_set(atk_object); | 537 ->ref_state_set(atk_object); |
538 int32_t state = obj->GetState(); | 538 int32_t state = obj->GetState(); |
539 | 539 |
540 if (state & (1 << ui::AX_STATE_FOCUSABLE)) | 540 if (state & (1 << ui::AX_STATE_FOCUSABLE)) |
541 atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE); | 541 atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE); |
542 if (obj->manager()->GetFocus(NULL) == obj) | 542 if (obj->manager()->GetFocus() == obj) |
543 atk_state_set_add_state(state_set, ATK_STATE_FOCUSED); | 543 atk_state_set_add_state(state_set, ATK_STATE_FOCUSED); |
544 if (state & (1 << ui::AX_STATE_ENABLED)) | 544 if (state & (1 << ui::AX_STATE_ENABLED)) |
545 atk_state_set_add_state(state_set, ATK_STATE_ENABLED); | 545 atk_state_set_add_state(state_set, ATK_STATE_ENABLED); |
546 | 546 |
547 return state_set; | 547 return state_set; |
548 } | 548 } |
549 | 549 |
550 static AtkRelationSet* browser_accessibility_ref_relation_set( | 550 static AtkRelationSet* browser_accessibility_ref_relation_set( |
551 AtkObject* atk_object) { | 551 AtkObject* atk_object) { |
552 AtkRelationSet* relation_set = | 552 AtkRelationSet* relation_set = |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 case ui::AX_ROLE_TREE_ITEM: | 933 case ui::AX_ROLE_TREE_ITEM: |
934 atk_role_ = ATK_ROLE_TREE_ITEM; | 934 atk_role_ = ATK_ROLE_TREE_ITEM; |
935 break; | 935 break; |
936 default: | 936 default: |
937 atk_role_ = ATK_ROLE_UNKNOWN; | 937 atk_role_ = ATK_ROLE_UNKNOWN; |
938 break; | 938 break; |
939 } | 939 } |
940 } | 940 } |
941 | 941 |
942 } // namespace content | 942 } // namespace content |
OLD | NEW |