| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_event_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_event_win.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/browser/accessibility/accessibility_tree_formatter_utils_win.h
" | 8 #include "content/browser/accessibility/accessibility_tree_formatter_utils_win.h
" |
| 9 #include "content/browser/accessibility/browser_accessibility.h" | 9 #include "content/browser/accessibility/browser_accessibility.h" |
| 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 BrowserAccessibilityEvent* BrowserAccessibilityEvent::Create( | 15 BrowserAccessibilityEvent* BrowserAccessibilityEvent::Create( |
| 16 Source source, | 16 Source source, |
| 17 ui::AXEvent event_type, | 17 ui::AXEvent event_type, |
| 18 const BrowserAccessibility* target) { | 18 const BrowserAccessibility* target) { |
| 19 LONG win_event_type = EVENT_MIN; | 19 LONG win_event_type = EVENT_MIN; |
| 20 switch (event_type) { | 20 switch (event_type) { |
| 21 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: | 21 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: |
| 22 win_event_type = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; | 22 win_event_type = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; |
| 23 break; | 23 break; |
| 24 case ui::AX_EVENT_ALERT: | 24 case ui::AX_EVENT_ALERT: |
| 25 win_event_type = EVENT_SYSTEM_ALERT; | 25 win_event_type = EVENT_SYSTEM_ALERT; |
| 26 break; | 26 break; |
| 27 case ui::AX_EVENT_AUTOCORRECTION_OCCURED: | |
| 28 win_event_type = IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED; | |
| 29 break; | |
| 30 case ui::AX_EVENT_CHILDREN_CHANGED: | 27 case ui::AX_EVENT_CHILDREN_CHANGED: |
| 31 win_event_type = EVENT_OBJECT_REORDER; | 28 win_event_type = EVENT_OBJECT_REORDER; |
| 32 break; | 29 break; |
| 33 case ui::AX_EVENT_FOCUS: | 30 case ui::AX_EVENT_FOCUS: |
| 34 win_event_type = EVENT_OBJECT_FOCUS; | 31 win_event_type = EVENT_OBJECT_FOCUS; |
| 35 break; | 32 break; |
| 36 case ui::AX_EVENT_LIVE_REGION_CHANGED: | 33 case ui::AX_EVENT_LIVE_REGION_CHANGED: |
| 37 win_event_type = EVENT_OBJECT_LIVEREGIONCHANGED; | 34 win_event_type = EVENT_OBJECT_LIVEREGIONCHANGED; |
| 38 break; | 35 break; |
| 39 case ui::AX_EVENT_LOAD_COMPLETE: | 36 case ui::AX_EVENT_LOAD_COMPLETE: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 91 |
| 95 std::string BrowserAccessibilityEventWin::GetEventNameStr() { | 92 std::string BrowserAccessibilityEventWin::GetEventNameStr() { |
| 96 std::string result = base::UTF16ToUTF8(AccessibilityEventToString( | 93 std::string result = base::UTF16ToUTF8(AccessibilityEventToString( |
| 97 win_event_type_)); | 94 win_event_type_)); |
| 98 if (event_type() != ui::AX_EVENT_NONE) | 95 if (event_type() != ui::AX_EVENT_NONE) |
| 99 result += "/" + ui::ToString(event_type()); | 96 result += "/" + ui::ToString(event_type()); |
| 100 return result; | 97 return result; |
| 101 } | 98 } |
| 102 | 99 |
| 103 } // namespace content | 100 } // namespace content |
| OLD | NEW |