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

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

Issue 1005293002: Re-land: Resurrect Aura Linux accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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
OLDNEW
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"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 #include "ui/views/widget/widget.h" 12 #include "ui/views/widget/widget.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 #if !defined(OS_WIN) 16 #if !defined(OS_WIN) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
17 // static 17 // static
18 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { 18 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) {
19 return new NativeViewAccessibility(view); 19 return new NativeViewAccessibility(view);
20 } 20 }
21 #endif 21 #endif
22 22
23 NativeViewAccessibility::NativeViewAccessibility(View* view) 23 NativeViewAccessibility::NativeViewAccessibility(View* view)
24 : view_(view), 24 : view_(view),
25 parent_widget_(nullptr), 25 parent_widget_(nullptr),
26 ax_node_(ui::AXPlatformNode::Create(this)) { 26 ax_node_(nullptr) {
27 ax_node_ = ui::AXPlatformNode::Create(this);
27 } 28 }
28 29
29 NativeViewAccessibility::~NativeViewAccessibility() { 30 NativeViewAccessibility::~NativeViewAccessibility() {
30 if (ax_node_) 31 if (ax_node_)
31 ax_node_->Destroy(); 32 ax_node_->Destroy();
32 if (parent_widget_) 33 if (parent_widget_)
33 parent_widget_->RemoveObserver(this); 34 parent_widget_->RemoveObserver(this);
34 } 35 }
35 36
36 gfx::NativeViewAccessible NativeViewAccessibility::GetNativeObject() { 37 gfx::NativeViewAccessible NativeViewAccessibility::GetNativeObject() {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 child_widget_platform_node->GetDelegate()); 243 child_widget_platform_node->GetDelegate());
243 if (child_widget_view_accessibility->parent_widget() != widget) 244 if (child_widget_view_accessibility->parent_widget() != widget)
244 child_widget_view_accessibility->SetParentWidget(widget); 245 child_widget_view_accessibility->SetParentWidget(widget);
245 } 246 }
246 247
247 result_child_widgets->push_back(child_widget); 248 result_child_widgets->push_back(child_widget);
248 } 249 }
249 } 250 }
250 251
251 } // namespace views 252 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698