OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_view_accessibility.h" | 5 #include "ui/views/accessibility/native_view_accessibility.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
10 #include "ui/views/controls/native/native_view_host.h" | 10 #include "ui/views/controls/native/native_view_host.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ui::AXViewState state; | 196 ui::AXViewState state; |
197 view_->GetAccessibleState(&state); | 197 view_->GetAccessibleState(&state); |
198 if (state.set_value_callback.is_null()) | 198 if (state.set_value_callback.is_null()) |
199 return false; | 199 return false; |
200 | 200 |
201 state.set_value_callback.Run(new_value); | 201 state.set_value_callback.Run(new_value); |
202 return true; | 202 return true; |
203 } | 203 } |
204 | 204 |
205 void NativeViewAccessibility::OnWidgetDestroying(Widget* widget) { | 205 void NativeViewAccessibility::OnWidgetDestroying(Widget* widget) { |
206 if (parent_widget_ == widget) | 206 if (parent_widget_ == widget) { |
| 207 parent_widget_->RemoveObserver(this); |
207 parent_widget_ = nullptr; | 208 parent_widget_ = nullptr; |
| 209 } |
208 } | 210 } |
209 | 211 |
210 void NativeViewAccessibility::SetParentWidget(Widget* parent_widget) { | 212 void NativeViewAccessibility::SetParentWidget(Widget* parent_widget) { |
211 if (parent_widget_) | 213 if (parent_widget_) |
212 parent_widget_->RemoveObserver(this); | 214 parent_widget_->RemoveObserver(this); |
213 parent_widget_ = parent_widget; | 215 parent_widget_ = parent_widget; |
214 parent_widget_->AddObserver(this); | 216 parent_widget_->AddObserver(this); |
215 } | 217 } |
216 | 218 |
217 void NativeViewAccessibility::PopulateChildWidgetVector( | 219 void NativeViewAccessibility::PopulateChildWidgetVector( |
(...skipping 25 matching lines...) Expand all Loading... |
243 child_widget_platform_node->GetDelegate()); | 245 child_widget_platform_node->GetDelegate()); |
244 if (child_widget_view_accessibility->parent_widget() != widget) | 246 if (child_widget_view_accessibility->parent_widget() != widget) |
245 child_widget_view_accessibility->SetParentWidget(widget); | 247 child_widget_view_accessibility->SetParentWidget(widget); |
246 } | 248 } |
247 | 249 |
248 result_child_widgets->push_back(child_widget); | 250 result_child_widgets->push_back(child_widget); |
249 } | 251 } |
250 } | 252 } |
251 | 253 |
252 } // namespace views | 254 } // namespace views |
OLD | NEW |