Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h" | 14 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/common/extensions/chrome_extension_messages.h" | 16 #include "chrome/common/extensions/chrome_extension_messages.h" |
| 17 #include "content/public/browser/ax_event_notification_details.h" | 17 #include "content/public/browser/ax_event_notification_details.h" |
| 18 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
| 19 #include "ui/accessibility/ax_action_data.h" | 19 #include "ui/accessibility/ax_action_data.h" |
| 20 #include "ui/accessibility/ax_enums.h" | 20 #include "ui/accessibility/ax_enums.h" |
| 21 #include "ui/accessibility/ax_tree_id_registry.h" | |
| 21 #include "ui/aura/env.h" | 22 #include "ui/aura/env.h" |
| 22 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 23 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" | 24 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" |
| 24 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 26 | 27 |
| 27 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 28 #include "ash/wm/window_util.h" // nogncheck | 29 #include "ash/wm/window_util.h" // nogncheck |
| 29 #endif | 30 #endif |
| 30 | 31 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 if (!enabled_) | 140 if (!enabled_) |
| 140 return; | 141 return; |
| 141 | 142 |
| 142 if (!parent) | 143 if (!parent) |
| 143 parent = current_tree_->GetRoot(); | 144 parent = current_tree_->GetRoot(); |
| 144 | 145 |
| 145 SendEvent(nullptr, parent, ui::AX_EVENT_CHILDREN_CHANGED); | 146 SendEvent(nullptr, parent, ui::AX_EVENT_CHILDREN_CHANGED); |
| 146 } | 147 } |
| 147 | 148 |
| 148 AutomationManagerAura::AutomationManagerAura() | 149 AutomationManagerAura::AutomationManagerAura() |
| 149 : enabled_(false), processing_events_(false) {} | 150 : AXHostDelegate(0), enabled_(false), processing_events_(false) {} |
|
dmazzoni
2017/02/22 07:44:28
We really ought to have a constant somewhere in th
yawano
2017/02/22 08:39:05
api::automation::kDesktopTreeId? - https://cs.chro
David Tseng
2017/02/23 18:44:25
Done.
David Tseng
2017/02/23 18:44:25
Yeah, there's a constant (already being used) just
| |
| 150 | 151 |
| 151 AutomationManagerAura::~AutomationManagerAura() { | 152 AutomationManagerAura::~AutomationManagerAura() { |
| 152 } | 153 } |
| 153 | 154 |
| 154 void AutomationManagerAura::ResetSerializer() { | 155 void AutomationManagerAura::ResetSerializer() { |
| 155 current_tree_serializer_.reset( | 156 current_tree_serializer_.reset( |
| 156 new AuraAXTreeSerializer(current_tree_.get())); | 157 new AuraAXTreeSerializer(current_tree_.get())); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void AutomationManagerAura::SendEvent(BrowserContext* context, | 160 void AutomationManagerAura::SendEvent(BrowserContext* context, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 | 196 |
| 196 processing_events_ = false; | 197 processing_events_ = false; |
| 197 auto pending_events_copy = pending_events_; | 198 auto pending_events_copy = pending_events_; |
| 198 pending_events_.clear(); | 199 pending_events_.clear(); |
| 199 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 200 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
| 200 SendEvent(context, | 201 SendEvent(context, |
| 201 pending_events_copy[i].first, | 202 pending_events_copy[i].first, |
| 202 pending_events_copy[i].second); | 203 pending_events_copy[i].second); |
| 203 } | 204 } |
| 204 } | 205 } |
| OLD | NEW |