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

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

Issue 2456673002: Update focus when widget changes visibility. (Closed)
Patch Set: Created 4 years, 2 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') | ui/views/accessibility/ax_widget_obj_wrapper.h » ('j') | 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 11516c5f64be381f79863ce4021d55e9a13bc7e8..0ce0047c9987815064f5f795ccbb317198d53528 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -116,6 +116,12 @@ AXAuraObjWrapper* AXAuraObjCache::GetFocus() {
return nullptr;
}
+void AXAuraObjCache::OnFocusedViewChanged() {
+ View* view = GetFocusedView();
+ if (view)
+ view->NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
+}
+
AXAuraObjCache::AXAuraObjCache()
: current_id_(1),
focus_client_(nullptr),
@@ -160,9 +166,7 @@ View* AXAuraObjCache::GetFocusedView() {
void AXAuraObjCache::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) {
- View* view = GetFocusedView();
- if (view)
- view->NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
+ OnFocusedViewChanged();
}
void AXAuraObjCache::OnWindowDestroying(aura::Window* window) {
« no previous file with comments | « ui/views/accessibility/ax_aura_obj_cache.h ('k') | ui/views/accessibility/ax_widget_obj_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698