| 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/logging.h" | 7 #import "base/logging.h" |
| 8 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 8 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
| 9 #include "content/common/accessibility_messages.h" | 9 #include "content/common/accessibility_messages.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void BrowserAccessibilityManagerMac::NotifyAccessibilityEvent( | 40 void BrowserAccessibilityManagerMac::NotifyAccessibilityEvent( |
| 41 ui::AXEvent event_type, | 41 ui::AXEvent event_type, |
| 42 BrowserAccessibility* node) { | 42 BrowserAccessibility* node) { |
| 43 if (!node->IsNative()) | 43 if (!node->IsNative()) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 // Refer to AXObjectCache.mm (webkit). | 46 // Refer to AXObjectCache.mm (webkit). |
| 47 NSString* event_id = @""; | 47 NSString* event_id = @""; |
| 48 switch (event_type) { | 48 switch (event_type) { |
| 49 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: | 49 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: |
| 50 if (node->role() == ui::AX_ROLE_TREE) | 50 if (node->GetRole() == ui::AX_ROLE_TREE) |
| 51 event_id = NSAccessibilitySelectedRowsChangedNotification; | 51 event_id = NSAccessibilitySelectedRowsChangedNotification; |
| 52 else | 52 else |
| 53 event_id = NSAccessibilityFocusedUIElementChangedNotification; | 53 event_id = NSAccessibilityFocusedUIElementChangedNotification; |
| 54 break; | 54 break; |
| 55 case ui::AX_EVENT_ALERT: | 55 case ui::AX_EVENT_ALERT: |
| 56 // Not used on Mac. | 56 // Not used on Mac. |
| 57 return; | 57 return; |
| 58 case ui::AX_EVENT_BLUR: | 58 case ui::AX_EVENT_BLUR: |
| 59 // A no-op on Mac. | 59 // A no-op on Mac. |
| 60 return; | 60 return; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 default: | 133 default: |
| 134 LOG(WARNING) << "Unknown accessibility event: " << event_type; | 134 LOG(WARNING) << "Unknown accessibility event: " << event_type; |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 BrowserAccessibilityCocoa* native_node = node->ToBrowserAccessibilityCocoa(); | 137 BrowserAccessibilityCocoa* native_node = node->ToBrowserAccessibilityCocoa(); |
| 138 DCHECK(native_node); | 138 DCHECK(native_node); |
| 139 NSAccessibilityPostNotification(native_node, event_id); | 139 NSAccessibilityPostNotification(native_node, event_id); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace content | 142 } // namespace content |
| OLD | NEW |