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

Unified Diff: content/browser/accessibility/#browser_accessibility_manager.cc#

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/#browser_accessibility_manager.cc#
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/#browser_accessibility_manager.cc#
similarity index 88%
copy from content/browser/accessibility/browser_accessibility_manager.cc
copy to content/browser/accessibility/#browser_accessibility_manager.cc#
index 6bdce2d907a503186a04788d2ba7731723866923..27572fe3c513221503d721dcbd6c2656385561c5 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/#browser_accessibility_manager.cc#
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -51,8 +51,9 @@ BrowserAccessibility* BrowserAccessibilityFactory::Create() {
#if !defined(OS_MACOSX) && \
!defined(OS_WIN) && \
!defined(OS_ANDROID) \
-// We have subclassess of BrowserAccessibilityManager on Mac, and Win. For any
-// other platform, instantiate the base class.
+// We have subclassess of BrowserAccessibilityManager on Mac, Win, and Android.
+// These are the default implementations of these functions
+
// static
BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
const ui::AXTreeUpdate& initial_tree,
@@ -60,6 +61,16 @@ BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
BrowserAccessibilityFactory* factory) {
return new BrowserAccessibilityManager(initial_tree, delegate, factory);
}
+
+// static
+ui::AXTreeUpdate BrowserAccessibilityManager::GetEmptyDocument() {
+ ui::AXNodeData empty_document;
+ empty_document.id = 0;
+ empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
+ ui::AXTreeUpdate update;
+ update.nodes.push_back(empty_document);
+ return update;
+}
#endif
BrowserAccessibilityManager::BrowserAccessibilityManager(
@@ -105,16 +116,6 @@ void BrowserAccessibilityManager::Initialize(
SetFocus(tree_->GetRoot(), false);
}
-// static
-ui::AXTreeUpdate BrowserAccessibilityManager::GetEmptyDocument() {
- ui::AXNodeData empty_document;
- empty_document.id = 0;
- empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
- ui::AXTreeUpdate update;
- update.nodes.push_back(empty_document);
- return update;
-}
-
BrowserAccessibility* BrowserAccessibilityManager::GetRoot() {
return GetFromAXNode(tree_->GetRoot());
}
@@ -142,6 +143,40 @@ void BrowserAccessibilityManager::OnWindowBlurred() {
NotifyAccessibilityEvent(ui::AX_EVENT_BLUR, GetFromAXNode(focus_));
}
+void BrowserAccessibilityManager::OnNavigation(bool is_reload) {
+ // Exit if we don't even have the first document loaded yet.
+ if (GetRoot()->GetId() == 0)
+ return;
+
+ LOG(ERROR) << "AX: BrowserAccessibilityManager::OnNavigation " << is_reload;
+ // Create an update that replaces the current tree with an empty document
+ // (which should be in the "busy" state by default) and apply it.
+ ui::AXTreeUpdate update = GetEmptyDocument();
+
+ LOG(ERROR) << "AX: OnNavigation empty doc update state: "
+ << update.nodes[0].state;
+
+ update.nodes[0].id = GetRoot()->GetId();
+
+ LOG(ERROR) << "AX: State before unserializing the empty doc: "
+ << GetRoot()->GetState();
+ LOG(ERROR) << "AX: Root id before unserializing the empty doc: "
+ << GetRoot()->GetId();
+ LOG(ERROR) << "AX: Root children before: "
+ << GetRoot()->PlatformChildCount();
+
+ LOG(ERROR) << "AX: State of first node in update: "
+ << update.nodes[0].state;
+
+ CHECK(tree_->Unserialize(update));
+ LOG(ERROR) << "AX: State after unserializing the empty doc: "
+ << GetRoot()->GetState();
+ LOG(ERROR) << "AX: Root id after unserializing the empty doc: "
+ << GetRoot()->GetId();
+ LOG(ERROR) << "AX: Root children after: "
+ << GetRoot()->PlatformChildCount();
+}
+
void BrowserAccessibilityManager::GotMouseDown() {
osk_state_ = OSK_ALLOWED_WITHIN_FOCUSED_OBJECT;
NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetFromAXNode(focus_));

Powered by Google App Engine
This is Rietveld 408576698