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

Unified Diff: ui/views/accessibility/ax_aura_obj_cache.cc

Issue 1283593006: Remove owned views from AXAuraObjCache when widget is deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr check Created 5 years, 4 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
« no previous file with comments | « ui/views/accessibility/ax_aura_obj_cache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessibility/ax_aura_obj_cache.cc
diff --git a/ui/views/accessibility/ax_aura_obj_cache.cc b/ui/views/accessibility/ax_aura_obj_cache.cc
index 8d5937b39c1b702d1a927af9cf1f82d05c738015..1b09df379ac6ff3c4837a6c3cbccf9cdad0aad32 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -49,8 +49,19 @@ void AXAuraObjCache::Remove(View* view) {
RemoveInternal(view, view_to_id_map_);
}
+void AXAuraObjCache::RemoveViewSubtree(View* view) {
+ Remove(view);
+ for (int i = 0; i < view->child_count(); ++i)
+ RemoveViewSubtree(view->child_at(i));
+}
+
void AXAuraObjCache::Remove(Widget* widget) {
RemoveInternal(widget, widget_to_id_map_);
+
+ // When an entire widget is deleted, it doesn't always send a notification
+ // on each of its views, so we need to explore them recursively.
+ if (widget->GetRootView())
+ RemoveViewSubtree(widget->GetRootView());
}
void AXAuraObjCache::Remove(aura::Window* window) {
« no previous file with comments | « ui/views/accessibility/ax_aura_obj_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698