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

Side by Side Diff: chrome/browser/ui/aura/accessibility/automation_manager_aura.cc

Issue 2700103004: Initial support for accessibility actions on ARC. (Closed)
Patch Set: Use desktop tree id. 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
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 "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" 5 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector>
10
11 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
12 #include "build/build_config.h" 10 #include "build/build_config.h"
13 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h" 12 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h"
15 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/common/extensions/api/automation_api_constants.h"
16 #include "chrome/common/extensions/chrome_extension_messages.h" 15 #include "chrome/common/extensions/chrome_extension_messages.h"
17 #include "content/public/browser/ax_event_notification_details.h" 16 #include "content/public/browser/ax_event_notification_details.h"
18 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
19 #include "ui/accessibility/ax_action_data.h" 18 #include "ui/accessibility/ax_action_data.h"
20 #include "ui/accessibility/ax_enums.h" 19 #include "ui/accessibility/ax_enums.h"
20 #include "ui/accessibility/ax_tree_id_registry.h"
21 #include "ui/aura/env.h" 21 #include "ui/aura/env.h"
22 #include "ui/aura/window.h" 22 #include "ui/aura/window.h"
23 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" 23 #include "ui/views/accessibility/ax_aura_obj_wrapper.h"
24 #include "ui/views/view.h" 24 #include "ui/views/view.h"
25 #include "ui/views/widget/widget.h" 25 #include "ui/views/widget/widget.h"
26 26
27 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
28 #include "ash/wm/window_util.h" // nogncheck 28 #include "ash/wm/window_util.h" // nogncheck
29 #endif 29 #endif
30 30
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (!enabled_) 135 if (!enabled_)
136 return; 136 return;
137 137
138 if (!parent) 138 if (!parent)
139 parent = current_tree_->GetRoot(); 139 parent = current_tree_->GetRoot();
140 140
141 SendEvent(nullptr, parent, ui::AX_EVENT_CHILDREN_CHANGED); 141 SendEvent(nullptr, parent, ui::AX_EVENT_CHILDREN_CHANGED);
142 } 142 }
143 143
144 AutomationManagerAura::AutomationManagerAura() 144 AutomationManagerAura::AutomationManagerAura()
145 : enabled_(false), processing_events_(false) {} 145 : AXHostDelegate(extensions::api::automation::kDesktopTreeID),
146 enabled_(false),
147 processing_events_(false) {}
146 148
147 AutomationManagerAura::~AutomationManagerAura() { 149 AutomationManagerAura::~AutomationManagerAura() {
148 } 150 }
149 151
150 void AutomationManagerAura::Reset(bool reset_serializer) { 152 void AutomationManagerAura::Reset(bool reset_serializer) {
151 if (!current_tree_) 153 if (!current_tree_)
152 current_tree_.reset(new AXTreeSourceAura()); 154 current_tree_.reset(new AXTreeSourceAura());
153 reset_serializer ? current_tree_serializer_.reset() 155 reset_serializer ? current_tree_serializer_.reset()
154 : current_tree_serializer_.reset( 156 : current_tree_serializer_.reset(
155 new AuraAXTreeSerializer(current_tree_.get())); 157 new AuraAXTreeSerializer(current_tree_.get()));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 196
195 processing_events_ = false; 197 processing_events_ = false;
196 auto pending_events_copy = pending_events_; 198 auto pending_events_copy = pending_events_;
197 pending_events_.clear(); 199 pending_events_.clear();
198 for (size_t i = 0; i < pending_events_copy.size(); ++i) { 200 for (size_t i = 0; i < pending_events_copy.size(); ++i) {
199 SendEvent(context, 201 SendEvent(context,
200 pending_events_copy[i].first, 202 pending_events_copy[i].first,
201 pending_events_copy[i].second); 203 pending_events_copy[i].second);
202 } 204 }
203 } 205 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/aura/accessibility/automation_manager_aura.h ('k') | ui/accessibility/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698