OLD | NEW |
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_manager_gtk.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_gtk.h" |
6 | 6 |
7 #include "content/browser/accessibility/browser_accessibility_gtk.h" | 7 #include "content/browser/accessibility/browser_accessibility_gtk.h" |
8 #include "content/common/accessibility_messages.h" | 8 #include "content/common/accessibility_messages.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 BrowserAccessibility* node) { | 49 BrowserAccessibility* node) { |
50 if (!node->IsNative()) | 50 if (!node->IsNative()) |
51 return; | 51 return; |
52 AtkObject* atk_object = node->ToBrowserAccessibilityGtk()->GetAtkObject(); | 52 AtkObject* atk_object = node->ToBrowserAccessibilityGtk()->GetAtkObject(); |
53 | 53 |
54 switch (event_type) { | 54 switch (event_type) { |
55 case WebKit::WebAXEventChildrenChanged: | 55 case WebKit::WebAXEventChildrenChanged: |
56 RecursivelySendChildrenChanged(GetRoot()->ToBrowserAccessibilityGtk()); | 56 RecursivelySendChildrenChanged(GetRoot()->ToBrowserAccessibilityGtk()); |
57 break; | 57 break; |
58 case WebKit::WebAXEventFocus: | 58 case WebKit::WebAXEventFocus: |
59 // Note: atk_focus_tracker_notify may be deprecated in the future; | 59 // Note: the focus-event was deprecated in ATK 2.9.4 |
60 // follow this bug for the replacement: | 60 // See https://bugzilla.gnome.org/show_bug.cgi?id=649575#c8 |
61 // https://bugzilla.gnome.org/show_bug.cgi?id=649575#c4 | |
62 g_signal_emit_by_name(atk_object, "focus-event", true); | 61 g_signal_emit_by_name(atk_object, "focus-event", true); |
63 atk_focus_tracker_notify(atk_object); | |
64 break; | 62 break; |
65 default: | 63 default: |
66 break; | 64 break; |
67 } | 65 } |
68 } | 66 } |
69 | 67 |
70 void BrowserAccessibilityManagerGtk::RecursivelySendChildrenChanged( | 68 void BrowserAccessibilityManagerGtk::RecursivelySendChildrenChanged( |
71 BrowserAccessibilityGtk* node) { | 69 BrowserAccessibilityGtk* node) { |
72 AtkObject* atkObject = node->ToBrowserAccessibilityGtk()->GetAtkObject(); | 70 AtkObject* atkObject = node->ToBrowserAccessibilityGtk()->GetAtkObject(); |
73 for (unsigned int i = 0; i < node->children().size(); ++i) { | 71 for (unsigned int i = 0; i < node->children().size(); ++i) { |
74 BrowserAccessibilityGtk* child = | 72 BrowserAccessibilityGtk* child = |
75 node->children()[i]->ToBrowserAccessibilityGtk(); | 73 node->children()[i]->ToBrowserAccessibilityGtk(); |
76 g_signal_emit_by_name(atkObject, | 74 g_signal_emit_by_name(atkObject, |
77 "children-changed::add", | 75 "children-changed::add", |
78 i, | 76 i, |
79 child->GetAtkObject()); | 77 child->GetAtkObject()); |
80 RecursivelySendChildrenChanged(child); | 78 RecursivelySendChildrenChanged(child); |
81 } | 79 } |
82 } | 80 } |
83 | 81 |
84 } // namespace content | 82 } // namespace content |
OLD | NEW |