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

Side by Side Diff: ui/views/accessibility/ax_window_obj_wrapper.cc

Issue 2929673002: Add null check when reporting changed nodes to an AX tree. (Closed)
Patch Set: Simplest fix Created 3 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 unified diff | Download patch
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/accessibility/ax_window_obj_wrapper.h" 5 #include "ui/views/accessibility/ax_window_obj_wrapper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/accessibility/ax_node_data.h" 10 #include "ui/accessibility/ax_node_data.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 void AXWindowObjWrapper::OnWindowHierarchyChanged( 90 void AXWindowObjWrapper::OnWindowHierarchyChanged(
91 const HierarchyChangeParams& params) { 91 const HierarchyChangeParams& params) {
92 if (params.phase == WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGED) 92 if (params.phase == WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGED)
93 AXAuraObjCache::GetInstance()->Remove(params.target, params.old_parent); 93 AXAuraObjCache::GetInstance()->Remove(params.target, params.old_parent);
94 } 94 }
95 95
96 void AXWindowObjWrapper::OnWindowBoundsChanged(aura::Window* window, 96 void AXWindowObjWrapper::OnWindowBoundsChanged(aura::Window* window,
97 const gfx::Rect& old_bounds, 97 const gfx::Rect& old_bounds,
98 const gfx::Rect& new_bounds) { 98 const gfx::Rect& new_bounds) {
99 if (window != window_) 99 if (window != window_ || !window->IsVisible())
100 return; 100 return;
101 101
102 AXAuraObjCache::GetInstance()->FireEvent(this, ui::AX_EVENT_LOCATION_CHANGED); 102 AXAuraObjCache::GetInstance()->FireEvent(this, ui::AX_EVENT_LOCATION_CHANGED);
103 103
104 Widget* widget = Widget::GetWidgetForNativeView(window); 104 Widget* widget = Widget::GetWidgetForNativeView(window);
105 if (widget) { 105 if (widget) {
106 views::View* root_view = widget->GetRootView(); 106 views::View* root_view = widget->GetRootView();
107 if (root_view) 107 if (root_view)
108 root_view->NotifyAccessibilityEvent(ui::AX_EVENT_LOCATION_CHANGED, true); 108 root_view->NotifyAccessibilityEvent(ui::AX_EVENT_LOCATION_CHANGED, true);
109 } 109 }
110 } 110 }
111 111
112 void AXWindowObjWrapper::OnWindowPropertyChanged(aura::Window* window, 112 void AXWindowObjWrapper::OnWindowPropertyChanged(aura::Window* window,
113 const void* key, 113 const void* key,
114 intptr_t old) { 114 intptr_t old) {
115 if (window == window_ && key == ui::kChildAXTreeID) { 115 if (window == window_ && key == ui::kChildAXTreeID && window->IsVisible()) {
116 AXAuraObjCache::GetInstance()->FireEvent(this, 116 AXAuraObjCache::GetInstance()->FireEvent(this,
117 ui::AX_EVENT_CHILDREN_CHANGED); 117 ui::AX_EVENT_CHILDREN_CHANGED);
118 } 118 }
119 } 119 }
120 120
121 } // namespace views 121 } // namespace views
OLDNEW
« no previous file with comments | « ui/accessibility/ax_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698