| 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.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 update.nodes.push_back(empty_document); | 182 update.nodes.push_back(empty_document); |
| 183 return update; | 183 return update; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void BrowserAccessibilityManager::FireFocusEventsIfNeeded() { | 186 void BrowserAccessibilityManager::FireFocusEventsIfNeeded() { |
| 187 BrowserAccessibility* focus = GetFocus(); | 187 BrowserAccessibility* focus = GetFocus(); |
| 188 | 188 |
| 189 // Don't fire focus events if the window itself doesn't have focus. | 189 // Don't fire focus events if the window itself doesn't have focus. |
| 190 // Bypass this check if a global focus listener was set up for testing | 190 // Bypass this check if a global focus listener was set up for testing |
| 191 // so that the test passes whether the window is active or not. | 191 // so that the test passes whether the window is active or not. |
| 192 if (!g_focus_change_callback_for_testing.Pointer()) { | 192 if (g_focus_change_callback_for_testing.Get().is_null()) { |
| 193 if (delegate_ && !delegate_->AccessibilityViewHasFocus()) | 193 if (delegate_ && !delegate_->AccessibilityViewHasFocus()) |
| 194 focus = nullptr; | 194 focus = nullptr; |
| 195 | 195 |
| 196 if (!CanFireEvents()) | 196 if (!CanFireEvents()) |
| 197 focus = nullptr; | 197 focus = nullptr; |
| 198 } | 198 } |
| 199 | 199 |
| 200 // Don't allow the document to be focused if it has no children and | 200 // Don't allow the document to be focused if it has no children and |
| 201 // hasn't finished loading yet. Wait for at least a tiny bit of content, | 201 // hasn't finished loading yet. Wait for at least a tiny bit of content, |
| 202 // or for the document to actually finish loading. | 202 // or for the document to actually finish loading. |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 tree_source(tree_->CreateTreeSource()); | 876 tree_source(tree_->CreateTreeSource()); |
| 877 ui::AXTreeSerializer<const ui::AXNode*, | 877 ui::AXTreeSerializer<const ui::AXNode*, |
| 878 ui::AXNodeData, | 878 ui::AXNodeData, |
| 879 ui::AXTreeData> serializer(tree_source.get()); | 879 ui::AXTreeData> serializer(tree_source.get()); |
| 880 ui::AXTreeUpdate update; | 880 ui::AXTreeUpdate update; |
| 881 serializer.SerializeChanges(tree_->root(), &update); | 881 serializer.SerializeChanges(tree_->root(), &update); |
| 882 return update; | 882 return update; |
| 883 } | 883 } |
| 884 | 884 |
| 885 } // namespace content | 885 } // namespace content |
| OLD | NEW |