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

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

Issue 2878733003: Check that a view exists before sending an accessibility event. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const HierarchyChangeParams& params) { 80 const HierarchyChangeParams& params) {
81 if (params.phase == WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGED) 81 if (params.phase == WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGED)
82 AXAuraObjCache::GetInstance()->Remove(params.target, params.old_parent); 82 AXAuraObjCache::GetInstance()->Remove(params.target, params.old_parent);
83 } 83 }
84 84
85 void AXWindowObjWrapper::OnWindowBoundsChanged(aura::Window* window, 85 void AXWindowObjWrapper::OnWindowBoundsChanged(aura::Window* window,
86 const gfx::Rect& old_bounds, 86 const gfx::Rect& old_bounds,
87 const gfx::Rect& new_bounds) { 87 const gfx::Rect& new_bounds) {
88 Widget* widget = Widget::GetWidgetForNativeView(window); 88 Widget* widget = Widget::GetWidgetForNativeView(window);
89 if (widget) { 89 if (widget) {
90 widget->GetRootView()->NotifyAccessibilityEvent( 90 views::View* view = widget->GetRootView();
91 ui::AX_EVENT_LOCATION_CHANGED, true); 91 if (view) {
92 view->NotifyAccessibilityEvent(ui::AX_EVENT_LOCATION_CHANGED, true);
93 }
92 } 94 }
93 } 95 }
94 96
95 } // namespace views 97 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698