| 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 "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (!current_tree_) | 125 if (!current_tree_) |
| 126 current_tree_.reset(new AXTreeSourceAura()); | 126 current_tree_.reset(new AXTreeSourceAura()); |
| 127 reset_serializer ? current_tree_serializer_.reset() | 127 reset_serializer ? current_tree_serializer_.reset() |
| 128 : current_tree_serializer_.reset( | 128 : current_tree_serializer_.reset( |
| 129 new AuraAXTreeSerializer(current_tree_.get())); | 129 new AuraAXTreeSerializer(current_tree_.get())); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void AutomationManagerAura::SendEvent(BrowserContext* context, | 132 void AutomationManagerAura::SendEvent(BrowserContext* context, |
| 133 views::AXAuraObjWrapper* aura_obj, | 133 views::AXAuraObjWrapper* aura_obj, |
| 134 ui::AXEvent event_type) { | 134 ui::AXEvent event_type) { |
| 135 if (!current_tree_serializer_) |
| 136 return; |
| 137 |
| 135 if (!context && g_browser_process->profile_manager()) { | 138 if (!context && g_browser_process->profile_manager()) { |
| 136 context = g_browser_process->profile_manager()->GetLastUsedProfile(); | 139 context = g_browser_process->profile_manager()->GetLastUsedProfile(); |
| 137 } | 140 } |
| 138 | 141 |
| 139 if (!context) { | 142 if (!context) { |
| 140 LOG(WARNING) << "Accessibility notification but no browser context"; | 143 LOG(WARNING) << "Accessibility notification but no browser context"; |
| 141 return; | 144 return; |
| 142 } | 145 } |
| 143 | 146 |
| 144 if (processing_events_) { | 147 if (processing_events_) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 228 } |
| 226 } | 229 } |
| 227 | 230 |
| 228 // Otherwise, fire the event directly on the Window. | 231 // Otherwise, fire the event directly on the Window. |
| 229 views::AXAuraObjWrapper* window_wrapper = | 232 views::AXAuraObjWrapper* window_wrapper = |
| 230 views::AXAuraObjCache::GetInstance()->GetOrCreate(window); | 233 views::AXAuraObjCache::GetInstance()->GetOrCreate(window); |
| 231 if (window_wrapper) | 234 if (window_wrapper) |
| 232 SendEvent(nullptr, window_wrapper, action.hit_test_event_to_fire); | 235 SendEvent(nullptr, window_wrapper, action.hit_test_event_to_fire); |
| 233 #endif | 236 #endif |
| 234 } | 237 } |
| OLD | NEW |