Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 1938043002: Merge to M51: Don't send focus accessibility events when tab isn't focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 update.nodes.push_back(empty_document); 181 update.nodes.push_back(empty_document);
182 return update; 182 return update;
183 } 183 }
184 184
185 void BrowserAccessibilityManager::FireFocusEventsIfNeeded() { 185 void BrowserAccessibilityManager::FireFocusEventsIfNeeded() {
186 BrowserAccessibility* focus = GetFocus(); 186 BrowserAccessibility* focus = GetFocus();
187 187
188 // Don't fire focus events if the window itself doesn't have focus. 188 // Don't fire focus events if the window itself doesn't have focus.
189 // Bypass this check if a global focus listener was set up for testing 189 // Bypass this check if a global focus listener was set up for testing
190 // so that the test passes whether the window is active or not. 190 // so that the test passes whether the window is active or not.
191 if (!g_focus_change_callback_for_testing.Pointer()) { 191 if (g_focus_change_callback_for_testing.Get().is_null()) {
192 if (delegate_ && !delegate_->AccessibilityViewHasFocus()) 192 if (delegate_ && !delegate_->AccessibilityViewHasFocus())
193 focus = nullptr; 193 focus = nullptr;
194 194
195 if (!CanFireEvents()) 195 if (!CanFireEvents())
196 focus = nullptr; 196 focus = nullptr;
197 } 197 }
198 198
199 // Don't allow the document to be focused if it has no children and 199 // Don't allow the document to be focused if it has no children and
200 // hasn't finished loading yet. Wait for at least a tiny bit of content, 200 // hasn't finished loading yet. Wait for at least a tiny bit of content,
201 // or for the document to actually finish loading. 201 // or for the document to actually finish loading.
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 tree_->CreateTreeSource()); 876 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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698