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 8 #include "base/macros.h" 9 #include "base/strings/string16.h" 10 #include "content/public/renderer/render_frame_observer.h" 11 12 namespace extensions { 13 14 // Renderer-side implementation for chrome.automation API (for the few pieces 15 // which aren't built in to the existing accessibility system). 16 class AutomationApiHelper : public content::RenderFrameObserver { 17 public: 18 explicit AutomationApiHelper(content::RenderFrame* render_frame); 19 ~AutomationApiHelper() override; 20 21 private: 22 // content::RenderFrameObserver: 23 bool OnMessageReceived(const IPC::Message& message) override; 24 void OnDestruct() override; 25 26 void OnQuerySelector(int acc_obj_id, 27 int request_id, 28 const base::string16& selector); 29 30 DISALLOW_COPY_AND_ASSIGN(AutomationApiHelper); 31 }; 32 33 } // namespace extensions 34 35 #endif // EXTENSIONS_RENDERER_API_AUTOMATION_AUTOMATION_API_HELPER_H_ 36