| 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/extensions/api/automation_internal/automation_util.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 for (size_t i = 0; i < node_data.child_ids.size(); ++i) { | 108 for (size_t i = 0; i < node_data.child_ids.size(); ++i) { |
| 109 out_node_data->child_ids.push_back(node_data.child_ids[i]); | 109 out_node_data->child_ids.push_back(node_data.child_ids[i]); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 void DispatchEventInternal(content::BrowserContext* context, | 113 void DispatchEventInternal(content::BrowserContext* context, |
| 114 const std::string& event_name, | 114 const std::string& event_name, |
| 115 scoped_ptr<base::ListValue> args) { | 115 scoped_ptr<base::ListValue> args) { |
| 116 if (context && EventRouter::Get(context)) { | 116 if (context && EventRouter::Get(context)) { |
| 117 scoped_ptr<Event> event(new Event(event_name, args.Pass())); | 117 scoped_ptr<Event> event( |
| 118 new Event(events::UNKNOWN, event_name, args.Pass())); |
| 118 event->restrict_to_browser_context = context; | 119 event->restrict_to_browser_context = context; |
| 119 EventRouter::Get(context)->BroadcastEvent(event.Pass()); | 120 EventRouter::Get(context)->BroadcastEvent(event.Pass()); |
| 120 } | 121 } |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace | 124 } // namespace |
| 124 | 125 |
| 125 namespace automation_util { | 126 namespace automation_util { |
| 126 | 127 |
| 127 void DispatchAccessibilityEventsToAutomation( | 128 void DispatchAccessibilityEventsToAutomation( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 DispatchEventInternal( | 176 DispatchEventInternal( |
| 176 browser_context, | 177 browser_context, |
| 177 api::automation_internal::OnAccessibilityTreeDestroyed::kEventName, | 178 api::automation_internal::OnAccessibilityTreeDestroyed::kEventName, |
| 178 api::automation_internal::OnAccessibilityTreeDestroyed::Create(tree_id)); | 179 api::automation_internal::OnAccessibilityTreeDestroyed::Create(tree_id)); |
| 179 AXTreeIDRegistry::GetInstance()->RemoveAXTreeID(tree_id); | 180 AXTreeIDRegistry::GetInstance()->RemoveAXTreeID(tree_id); |
| 180 } | 181 } |
| 181 | 182 |
| 182 } // namespace automation_util | 183 } // namespace automation_util |
| 183 | 184 |
| 184 } // namespace extensions | 185 } // namespace extensions |
| OLD | NEW |