OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/accessibility_event_recorder.h" | 5 #include "content/browser/accessibility/accessibility_event_recorder.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (!application_.get()) | 76 if (!application_.get()) |
77 LOG(FATAL) << "Failed to create AXUIElement for application."; | 77 LOG(FATAL) << "Failed to create AXUIElement for application."; |
78 | 78 |
79 // Add the notifications we care about to the observer. | 79 // Add the notifications we care about to the observer. |
80 AddNotification(NSAccessibilityFocusedUIElementChangedNotification); | 80 AddNotification(NSAccessibilityFocusedUIElementChangedNotification); |
81 AddNotification(NSAccessibilityRowCountChangedNotification); | 81 AddNotification(NSAccessibilityRowCountChangedNotification); |
82 AddNotification(NSAccessibilitySelectedChildrenChangedNotification); | 82 AddNotification(NSAccessibilitySelectedChildrenChangedNotification); |
83 AddNotification(NSAccessibilitySelectedRowsChangedNotification); | 83 AddNotification(NSAccessibilitySelectedRowsChangedNotification); |
84 AddNotification(NSAccessibilitySelectedTextChangedNotification); | 84 AddNotification(NSAccessibilitySelectedTextChangedNotification); |
85 AddNotification(NSAccessibilityValueChangedNotification); | 85 AddNotification(NSAccessibilityValueChangedNotification); |
| 86 AddNotification(@"AXExpandedChanged"); |
86 AddNotification(@"AXLayoutComplete"); | 87 AddNotification(@"AXLayoutComplete"); |
87 AddNotification(@"AXLiveRegionChanged"); | 88 AddNotification(@"AXLiveRegionChanged"); |
88 AddNotification(@"AXLoadComplete"); | 89 AddNotification(@"AXLoadComplete"); |
89 AddNotification(@"AXRowCollapsed"); | 90 AddNotification(@"AXRowCollapsed"); |
90 AddNotification(@"AXRowExpanded"); | 91 AddNotification(@"AXRowExpanded"); |
91 | 92 |
92 // Add the observer to the current message loop. | 93 // Add the observer to the current message loop. |
93 observer_run_loop_source_ = AXObserverGetRunLoopSource(observer_ref_.get()); | 94 observer_run_loop_source_ = AXObserverGetRunLoopSource(observer_ref_.get()); |
94 CFRunLoopAddSource(CFRunLoopGetCurrent(), observer_run_loop_source_, | 95 CFRunLoopAddSource(CFRunLoopGetCurrent(), observer_run_loop_source_, |
95 kCFRunLoopDefaultMode); | 96 kCFRunLoopDefaultMode); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 144 |
144 std::string value = | 145 std::string value = |
145 GetAXAttributeValue(element, NSAccessibilityValueAttribute); | 146 GetAXAttributeValue(element, NSAccessibilityValueAttribute); |
146 if (!value.empty()) | 147 if (!value.empty()) |
147 log += base::StringPrintf(" AXValue=\"%s\"", value.c_str()); | 148 log += base::StringPrintf(" AXValue=\"%s\"", value.c_str()); |
148 | 149 |
149 event_logs_.push_back(log); | 150 event_logs_.push_back(log); |
150 } | 151 } |
151 | 152 |
152 } // namespace content | 153 } // namespace content |
OLD | NEW |