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

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

Issue 1765583002: AXAuraObjCache - clear focus client reference when window is destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 72abde71a028195511abdb3141eaa3d754a1cb58..9bd021e1d009dbe0b1f50cf3a8ac0ba272aa611f 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -35,6 +35,7 @@ AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(aura::Window* window) {
aura::Window* root_window = window->GetRootWindow();
if (root_window) {
focus_client_ = aura::client::GetFocusClient(root_window);
+ root_window->AddObserver(this);
if (focus_client_)
focus_client_->AddObserver(this);
}
@@ -159,6 +160,10 @@ void AXAuraObjCache::OnWindowFocused(aura::Window* gained_focus,
view->NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
}
+void AXAuraObjCache::OnWindowDestroying(aura::Window* window) {
+ focus_client_ = nullptr;
+}
+
template <typename AuraViewWrapper, typename AuraView>
AXAuraObjWrapper* AXAuraObjCache::CreateInternal(
AuraView* aura_view,
« 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