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

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

Issue 2697533003: Fix crash in widget destruction (Closed)
Patch Set: fix mac Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_unittest.cc » ('j') | 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_widget_obj_wrapper.h" 5 #include "ui/views/accessibility/ax_widget_obj_wrapper.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/views/accessibility/ax_aura_obj_cache.h" 9 #include "ui/views/accessibility/ax_aura_obj_cache.h"
10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" 10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 widget_ = NULL; 26 widget_ = NULL;
27 } 27 }
28 28
29 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() { 29 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() {
30 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); 30 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView());
31 } 31 }
32 32
33 void AXWidgetObjWrapper::GetChildren( 33 void AXWidgetObjWrapper::GetChildren(
34 std::vector<AXAuraObjWrapper*>* out_children) { 34 std::vector<AXAuraObjWrapper*>* out_children) {
35 if (!widget_->IsVisible() || !widget_->GetRootView()->visible()) 35 if (!widget_->IsVisible() || !widget_->GetRootView() ||
36 !widget_->GetRootView()->visible()) {
36 return; 37 return;
38 }
37 39
38 out_children->push_back( 40 out_children->push_back(
39 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); 41 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView()));
40 } 42 }
41 43
42 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { 44 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
43 out_node_data->id = GetID(); 45 out_node_data->id = GetID();
44 out_node_data->role = widget_->widget_delegate()->GetAccessibleWindowRole(); 46 out_node_data->role = widget_->widget_delegate()->GetAccessibleWindowRole();
45 out_node_data->AddStringAttribute( 47 out_node_data->AddStringAttribute(
46 ui::AX_ATTR_NAME, 48 ui::AX_ATTR_NAME,
(...skipping 19 matching lines...) Expand all
66 // If a widget changes visibility it may affect what's focused, in particular 68 // If a widget changes visibility it may affect what's focused, in particular
67 // when a widget that contains the focused view gets hidden. 69 // when a widget that contains the focused view gets hidden.
68 AXAuraObjCache::GetInstance()->OnFocusedViewChanged(); 70 AXAuraObjCache::GetInstance()->OnFocusedViewChanged();
69 } 71 }
70 72
71 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { 73 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) {
72 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view); 74 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view);
73 } 75 }
74 76
75 } // namespace views 77 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698