aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef EXTENSIONS_RENDERER_API_AUTOMATION_AUTOMATION_API_HELPER_H_ |
| 6 | #define EXTENSIONS_RENDERER_API_AUTOMATION_AUTOMATION_API_HELPER_H_ |
| 7 | |
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 8 | #include <string> |
| 9 | |
avi | 2d124c0 | 2015-12-23 06:36:42 | [diff] [blame] | 10 | #include "base/macros.h" |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 11 | #include "base/strings/string16.h" |
Devlin Cronin | ab75d9a8 | 2017-10-17 02:01:20 | [diff] [blame] | 12 | #include "content/public/renderer/render_frame_observer.h" |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 13 | |
| 14 | namespace extensions { |
| 15 | |
| 16 | // Renderer-side implementation for chrome.automation API (for the few pieces |
| 17 | // which aren't built in to the existing accessibility system). |
Devlin Cronin | ab75d9a8 | 2017-10-17 02:01:20 | [diff] [blame] | 18 | class AutomationApiHelper : public content::RenderFrameObserver { |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 19 | public: |
Devlin Cronin | ab75d9a8 | 2017-10-17 02:01:20 | [diff] [blame] | 20 | explicit AutomationApiHelper(content::RenderFrame* render_frame); |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 21 | ~AutomationApiHelper() override; |
| 22 | |
| 23 | private: |
Devlin Cronin | ab75d9a8 | 2017-10-17 02:01:20 | [diff] [blame] | 24 | // content::RenderFrameObserver: |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 25 | bool OnMessageReceived(const IPC::Message& message) override; |
xjz | 694b50a9 | 2016-06-07 21:49:37 | [diff] [blame] | 26 | void OnDestruct() override; |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 27 | |
| 28 | void OnQuerySelector(int acc_obj_id, |
| 29 | int request_id, |
Jan Wilken Dörrie | 85285b0 | 2021-03-11 23:38:47 | [diff] [blame^] | 30 | const std::u16string& selector); |
aboxhall | 7abfb3d | 2014-11-06 02:03:05 | [diff] [blame] | 31 | |
| 32 | DISALLOW_COPY_AND_ASSIGN(AutomationApiHelper); |
| 33 | }; |
| 34 | |
| 35 | } // namespace extensions |
| 36 | |
| 37 | #endif // EXTENSIONS_RENDERER_API_AUTOMATION_AUTOMATION_API_HELPER_H_ |