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