| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAP
TER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAP
TER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAP
TER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_ADAP
TER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ui/accessibility/ax_enums.h" |
| 10 #include "ui/gfx/geometry/point.h" | 11 #include "ui/gfx/geometry/point.h" |
| 11 | 12 |
| 13 namespace ui { |
| 14 struct AXActionData; |
| 15 } |
| 16 |
| 12 namespace extensions { | 17 namespace extensions { |
| 13 | 18 |
| 14 // Adapts an object to receive actions from the Automation extension API. | 19 // Adapts an object to receive actions from the Automation extension API. |
| 15 class AutomationActionAdapter { | 20 class AutomationActionAdapter { |
| 16 public: | 21 public: |
| 17 // Performs a default action (e.g. click, check) on the target node. | 22 // Performs an action on the target node. |
| 18 virtual void DoDefault(int32_t id) = 0; | 23 virtual void PerformAction(const ui::AXActionData& data) = 0; |
| 19 | |
| 20 // Performs a focus action on the target node. | |
| 21 virtual void Focus(int32_t id) = 0; | |
| 22 | |
| 23 // Makes the node visible by scrolling; does not change nodes from hidden to | |
| 24 // shown. | |
| 25 virtual void MakeVisible(int32_t id) = 0; | |
| 26 | |
| 27 // Sets selection for anchor and focus node/offset pairs. Also used to set | |
| 28 // selection in text fields. | |
| 29 virtual void SetSelection(int32_t anchor_id, | |
| 30 int32_t anchor_offset, | |
| 31 int32_t focus_id, | |
| 32 int32_t focus_offset) = 0; | |
| 33 | |
| 34 // Shows the context menu resulting from a right click. | |
| 35 virtual void ShowContextMenu(int32_t id) = 0; | |
| 36 }; | 24 }; |
| 37 | 25 |
| 38 } // namespace extensions | 26 } // namespace extensions |
| 39 | 27 |
| 40 #endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_A
DAPTER_H_ | 28 #endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_ACTION_A
DAPTER_H_ |
| OLD | NEW |