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_mac.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" |
6 | 6 |
7 #import "base/mac/mac_util.h" | 7 #import "base/mac/mac_util.h" |
8 #import "base/mac/sdk_forward_declarations.h" | 8 #import "base/mac/sdk_forward_declarations.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 case ui::AX_EVENT_AUTOCORRECTION_OCCURED: | 184 case ui::AX_EVENT_AUTOCORRECTION_OCCURED: |
185 mac_notification = NSAccessibilityAutocorrectionOccurredNotification; | 185 mac_notification = NSAccessibilityAutocorrectionOccurredNotification; |
186 break; | 186 break; |
187 case ui::AX_EVENT_FOCUS: | 187 case ui::AX_EVENT_FOCUS: |
188 mac_notification = NSAccessibilityFocusedUIElementChangedNotification; | 188 mac_notification = NSAccessibilityFocusedUIElementChangedNotification; |
189 break; | 189 break; |
190 case ui::AX_EVENT_LAYOUT_COMPLETE: | 190 case ui::AX_EVENT_LAYOUT_COMPLETE: |
191 mac_notification = NSAccessibilityLayoutCompleteNotification; | 191 mac_notification = NSAccessibilityLayoutCompleteNotification; |
192 break; | 192 break; |
193 case ui::AX_EVENT_LOAD_COMPLETE: | 193 case ui::AX_EVENT_LOAD_COMPLETE: |
194 mac_notification = NSAccessibilityLoadCompleteNotification; | 194 // This notification should only be fired on the top document. |
| 195 // Iframes should use |AX_EVENT_LAYOUT_COMPLETE| to signify that they have |
| 196 // finished loading. |
| 197 if (IsRootTree()) { |
| 198 mac_notification = NSAccessibilityLoadCompleteNotification; |
| 199 } else { |
| 200 mac_notification = NSAccessibilityLayoutCompleteNotification; |
| 201 } |
195 break; | 202 break; |
196 case ui::AX_EVENT_INVALID_STATUS_CHANGED: | 203 case ui::AX_EVENT_INVALID_STATUS_CHANGED: |
197 mac_notification = NSAccessibilityInvalidStatusChangedNotification; | 204 mac_notification = NSAccessibilityInvalidStatusChangedNotification; |
198 break; | 205 break; |
199 case ui::AX_EVENT_SELECTED_CHILDREN_CHANGED: | 206 case ui::AX_EVENT_SELECTED_CHILDREN_CHANGED: |
200 if (node->GetRole() == ui::AX_ROLE_GRID || | 207 if (node->GetRole() == ui::AX_ROLE_GRID || |
201 node->GetRole() == ui::AX_ROLE_TABLE) { | 208 node->GetRole() == ui::AX_ROLE_TABLE) { |
202 mac_notification = NSAccessibilitySelectedRowsChangedNotification; | 209 mac_notification = NSAccessibilitySelectedRowsChangedNotification; |
203 } else { | 210 } else { |
204 mac_notification = NSAccessibilitySelectedChildrenChangedNotification; | 211 mac_notification = NSAccessibilitySelectedChildrenChangedNotification; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 472 } |
466 | 473 |
467 return @{ | 474 return @{ |
468 NSAccessibilityTextStateChangeTypeKey : @(AXTextStateChangeTypeEdit), | 475 NSAccessibilityTextStateChangeTypeKey : @(AXTextStateChangeTypeEdit), |
469 NSAccessibilityTextChangeValues : changes, | 476 NSAccessibilityTextChangeValues : changes, |
470 NSAccessibilityTextChangeElement : native_node | 477 NSAccessibilityTextChangeElement : native_node |
471 }; | 478 }; |
472 } | 479 } |
473 | 480 |
474 } // namespace content | 481 } // namespace content |
OLD | NEW |