| 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_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 (1 << ui::AX_STATE_BUSY); | 142 (1 << ui::AX_STATE_BUSY); |
| 143 return empty_document; | 143 return empty_document; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void BrowserAccessibilityManagerWin::MaybeCallNotifyWinEvent(DWORD event, | 146 void BrowserAccessibilityManagerWin::MaybeCallNotifyWinEvent(DWORD event, |
| 147 LONG child_id) { | 147 LONG child_id) { |
| 148 // Don't fire events if this view isn't hooked up to its parent. | 148 // Don't fire events if this view isn't hooked up to its parent. |
| 149 if (!parent_iaccessible()) | 149 if (!parent_iaccessible()) |
| 150 return; | 150 return; |
| 151 | 151 |
| 152 #if defined(USE_AURA) | 152 // If on Win 7 and complete accessibility is enabled, create a fake child HWND |
| 153 // If this is an Aura build on Win 7 and complete accessibility is | 153 // to use as the root of the accessibility tree. See comments above |
| 154 // enabled, create a fake child HWND to use as the root of the | 154 // AccessibleHWND for details. |
| 155 // accessibility tree. See comments above AccessibleHWND for details. | |
| 156 if (BrowserAccessibilityStateImpl::GetInstance()->IsAccessibleBrowser() && | 155 if (BrowserAccessibilityStateImpl::GetInstance()->IsAccessibleBrowser() && |
| 157 !accessible_hwnd_) { | 156 !accessible_hwnd_) { |
| 158 accessible_hwnd_ = new AccessibleHWND(parent_hwnd_, this); | 157 accessible_hwnd_ = new AccessibleHWND(parent_hwnd_, this); |
| 159 parent_hwnd_ = accessible_hwnd_->hwnd(); | 158 parent_hwnd_ = accessible_hwnd_->hwnd(); |
| 160 parent_iaccessible_ = accessible_hwnd_->window_accessible(); | 159 parent_iaccessible_ = accessible_hwnd_->window_accessible(); |
| 161 } | 160 } |
| 162 #endif | |
| 163 | 161 |
| 164 ::NotifyWinEvent(event, parent_hwnd(), OBJID_CLIENT, child_id); | 162 ::NotifyWinEvent(event, parent_hwnd(), OBJID_CLIENT, child_id); |
| 165 } | 163 } |
| 166 | 164 |
| 167 void BrowserAccessibilityManagerWin::AddNodeToMap(BrowserAccessibility* node) { | 165 void BrowserAccessibilityManagerWin::AddNodeToMap(BrowserAccessibility* node) { |
| 168 BrowserAccessibilityManager::AddNodeToMap(node); | 166 BrowserAccessibilityManager::AddNodeToMap(node); |
| 169 LONG unique_id_win = node->ToBrowserAccessibilityWin()->unique_id_win(); | 167 LONG unique_id_win = node->ToBrowserAccessibilityWin()->unique_id_win(); |
| 170 unique_id_to_renderer_id_map_[unique_id_win] = node->renderer_id(); | 168 unique_id_to_renderer_id_map_[unique_id_win] = node->renderer_id(); |
| 171 } | 169 } |
| 172 | 170 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // |parent_iaccessible_| are no longer valid either, since they were | 311 // |parent_iaccessible_| are no longer valid either, since they were |
| 314 // derived from AccessibleHWND. We don't have to restore them to | 312 // derived from AccessibleHWND. We don't have to restore them to |
| 315 // previous values, though, because this should only happen | 313 // previous values, though, because this should only happen |
| 316 // during the destruct sequence for this window. | 314 // during the destruct sequence for this window. |
| 317 accessible_hwnd_ = NULL; | 315 accessible_hwnd_ = NULL; |
| 318 parent_hwnd_ = NULL; | 316 parent_hwnd_ = NULL; |
| 319 parent_iaccessible_ = NULL; | 317 parent_iaccessible_ = NULL; |
| 320 } | 318 } |
| 321 | 319 |
| 322 } // namespace content | 320 } // namespace content |
| OLD | NEW |