10529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
20529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Use of this source code is governed by a BSD-style license that can be
30529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// found in the LICENSE file.
40529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
50529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_UTIL_H_
60529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_UTIL_H_
70529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
80529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#include <vector>
90529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
100529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#include "chrome/common/extensions/api/automation_internal.h"
110529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#include "content/public/browser/ax_event_notification_details.h"
120529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
130529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochnamespace content {
140529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochclass BrowserContext;
150529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch}  // namespace content
160529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
170529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochnamespace ui {
180529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochstruct AXNodeData;
190529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch}  // namespace ui
200529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
210529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochnamespace extensions {
220529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
230529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Shared utility functions for the Automation API.
240529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochnamespace automation_util {
250529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
260529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Dispatch events through the Automation API making any necessary conversions
270529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// from accessibility to Automation types.
280529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochvoid DispatchAccessibilityEventsToAutomation(
290529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch    const std::vector<content::AXEventNotificationDetails>& details,
301320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    content::BrowserContext* browser_context,
311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    const gfx::Vector2d& location_offset);
320529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
33116680a4aac90f2aa7413d9095a592090648e557Ben Murdochvoid DispatchTreeDestroyedEventToAutomation(
34116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    int process_id,
35116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    int routing_id,
36116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch    content::BrowserContext* browser_context);
370529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch}  // namespace automation_util
380529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
390529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch}  // namespace extensions
400529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch
410529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch#endif  // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_UTIL_H_
42