| 1 | /* |
| 2 | * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 | * Copyright (C) 2013-2016 Apple Inc. All rights reserved. |
| 4 | * Copyright (C) 2014 University of Washington. All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions |
| 8 | * are met: |
| 9 | * 1. Redistributions of source code must retain the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer. |
| 11 | * 2. Redistributions in binary form must reproduce the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer in the |
| 13 | * documentation and/or other materials provided with the distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 17 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 18 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 19 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 25 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | // DO NOT EDIT THIS FILE. It is automatically generated from Automation.json |
| 29 | // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py |
| 30 | |
| 31 | #pragma once |
| 32 | |
| 33 | #include "AutomationProtocolObjects.h" |
| 34 | #include <JavaScriptCore/InspectorBackendDispatcher.h> |
| 35 | #include <wtf/text/WTFString.h> |
| 36 | |
| 37 | namespace Inspector { |
| 38 | |
| 39 | typedef String ErrorString; |
| 40 | |
| 41 | class AutomationBackendDispatcherHandler { |
| 42 | public: |
| 43 | class GetBrowsingContextsCallback : public BackendDispatcher::CallbackBase { |
| 44 | public: |
| 45 | GetBrowsingContextsCallback(Ref<BackendDispatcher>&&, int id); |
| 46 | void sendSuccess(RefPtr<JSON::ArrayOf<Inspector::Protocol::Automation::BrowsingContext>>&& contexts); |
| 47 | }; |
| 48 | virtual void getBrowsingContexts(Ref<GetBrowsingContextsCallback>&& callback) = 0; |
| 49 | class GetBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 50 | public: |
| 51 | GetBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 52 | void sendSuccess(RefPtr<Inspector::Protocol::Automation::BrowsingContext>&& context); |
| 53 | }; |
| 54 | virtual void getBrowsingContext(const String& in_handle, Ref<GetBrowsingContextCallback>&& callback) = 0; |
| 55 | class CreateBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 56 | public: |
| 57 | CreateBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 58 | void sendSuccess(const String& handle, Inspector::Protocol::Automation::BrowsingContextPresentation presentation); |
| 59 | }; |
| 60 | virtual void createBrowsingContext(const String* opt_in_presentationHint, Ref<CreateBrowsingContextCallback>&& callback) = 0; |
| 61 | virtual void closeBrowsingContext(ErrorString&, const String& in_handle) = 0; |
| 62 | class SwitchToBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 63 | public: |
| 64 | SwitchToBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 65 | void sendSuccess(); |
| 66 | }; |
| 67 | virtual void switchToBrowsingContext(const String& in_browsingContextHandle, const String* opt_in_frameHandle, Ref<SwitchToBrowsingContextCallback>&& callback) = 0; |
| 68 | class SetWindowFrameOfBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 69 | public: |
| 70 | SetWindowFrameOfBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 71 | void sendSuccess(); |
| 72 | }; |
| 73 | virtual void setWindowFrameOfBrowsingContext(const String& in_handle, const JSON::Object* opt_in_origin, const JSON::Object* opt_in_size, Ref<SetWindowFrameOfBrowsingContextCallback>&& callback) = 0; |
| 74 | class MaximizeWindowOfBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 75 | public: |
| 76 | MaximizeWindowOfBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 77 | void sendSuccess(); |
| 78 | }; |
| 79 | virtual void maximizeWindowOfBrowsingContext(const String& in_handle, Ref<MaximizeWindowOfBrowsingContextCallback>&& callback) = 0; |
| 80 | class HideWindowOfBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 81 | public: |
| 82 | HideWindowOfBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 83 | void sendSuccess(); |
| 84 | }; |
| 85 | virtual void hideWindowOfBrowsingContext(const String& in_handle, Ref<HideWindowOfBrowsingContextCallback>&& callback) = 0; |
| 86 | class NavigateBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 87 | public: |
| 88 | NavigateBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 89 | void sendSuccess(); |
| 90 | }; |
| 91 | virtual void navigateBrowsingContext(const String& in_handle, const String& in_url, const String* opt_in_pageLoadStrategy, const int* opt_in_pageLoadTimeout, Ref<NavigateBrowsingContextCallback>&& callback) = 0; |
| 92 | class GoBackInBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 93 | public: |
| 94 | GoBackInBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 95 | void sendSuccess(); |
| 96 | }; |
| 97 | virtual void goBackInBrowsingContext(const String& in_handle, const String* opt_in_pageLoadStrategy, const int* opt_in_pageLoadTimeout, Ref<GoBackInBrowsingContextCallback>&& callback) = 0; |
| 98 | class GoForwardInBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 99 | public: |
| 100 | GoForwardInBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 101 | void sendSuccess(); |
| 102 | }; |
| 103 | virtual void goForwardInBrowsingContext(const String& in_handle, const String* opt_in_pageLoadStrategy, const int* opt_in_pageLoadTimeout, Ref<GoForwardInBrowsingContextCallback>&& callback) = 0; |
| 104 | class ReloadBrowsingContextCallback : public BackendDispatcher::CallbackBase { |
| 105 | public: |
| 106 | ReloadBrowsingContextCallback(Ref<BackendDispatcher>&&, int id); |
| 107 | void sendSuccess(); |
| 108 | }; |
| 109 | virtual void reloadBrowsingContext(const String& in_handle, const String* opt_in_pageLoadStrategy, const int* opt_in_pageLoadTimeout, Ref<ReloadBrowsingContextCallback>&& callback) = 0; |
| 110 | class WaitForNavigationToCompleteCallback : public BackendDispatcher::CallbackBase { |
| 111 | public: |
| 112 | WaitForNavigationToCompleteCallback(Ref<BackendDispatcher>&&, int id); |
| 113 | void sendSuccess(); |
| 114 | }; |
| 115 | virtual void waitForNavigationToComplete(const String& in_browsingContextHandle, const String* opt_in_frameHandle, const String* opt_in_pageLoadStrategy, const int* opt_in_pageLoadTimeout, Ref<WaitForNavigationToCompleteCallback>&& callback) = 0; |
| 116 | class EvaluateJavaScriptFunctionCallback : public BackendDispatcher::CallbackBase { |
| 117 | public: |
| 118 | EvaluateJavaScriptFunctionCallback(Ref<BackendDispatcher>&&, int id); |
| 119 | void sendSuccess(const String& result); |
| 120 | }; |
| 121 | virtual void evaluateJavaScriptFunction(const String& in_browsingContextHandle, const String* opt_in_frameHandle, const String& in_function, const JSON::Array& in_arguments, const bool* opt_in_expectsImplicitCallbackArgument, const int* opt_in_callbackTimeout, Ref<EvaluateJavaScriptFunctionCallback>&& callback) = 0; |
| 122 | class PerformMouseInteractionCallback : public BackendDispatcher::CallbackBase { |
| 123 | public: |
| 124 | PerformMouseInteractionCallback(Ref<BackendDispatcher>&&, int id); |
| 125 | void sendSuccess(RefPtr<Inspector::Protocol::Automation::Point>&& position); |
| 126 | }; |
| 127 | virtual void performMouseInteraction(const String& in_handle, const JSON::Object& in_position, const String& in_button, const String& in_interaction, const JSON::Array& in_modifiers, Ref<PerformMouseInteractionCallback>&& callback) = 0; |
| 128 | class PerformKeyboardInteractionsCallback : public BackendDispatcher::CallbackBase { |
| 129 | public: |
| 130 | PerformKeyboardInteractionsCallback(Ref<BackendDispatcher>&&, int id); |
| 131 | void sendSuccess(); |
| 132 | }; |
| 133 | virtual void performKeyboardInteractions(const String& in_handle, const JSON::Array& in_interactions, Ref<PerformKeyboardInteractionsCallback>&& callback) = 0; |
| 134 | class PerformInteractionSequenceCallback : public BackendDispatcher::CallbackBase { |
| 135 | public: |
| 136 | PerformInteractionSequenceCallback(Ref<BackendDispatcher>&&, int id); |
| 137 | void sendSuccess(); |
| 138 | }; |
| 139 | virtual void performInteractionSequence(const String& in_handle, const String* opt_in_frameHandle, const JSON::Array& in_inputSources, const JSON::Array& in_steps, Ref<PerformInteractionSequenceCallback>&& callback) = 0; |
| 140 | class CancelInteractionSequenceCallback : public BackendDispatcher::CallbackBase { |
| 141 | public: |
| 142 | CancelInteractionSequenceCallback(Ref<BackendDispatcher>&&, int id); |
| 143 | void sendSuccess(); |
| 144 | }; |
| 145 | virtual void cancelInteractionSequence(const String& in_handle, const String* opt_in_frameHandle, Ref<CancelInteractionSequenceCallback>&& callback) = 0; |
| 146 | class TakeScreenshotCallback : public BackendDispatcher::CallbackBase { |
| 147 | public: |
| 148 | TakeScreenshotCallback(Ref<BackendDispatcher>&&, int id); |
| 149 | void sendSuccess(const String& data); |
| 150 | }; |
| 151 | virtual void takeScreenshot(const String& in_handle, const String* opt_in_frameHandle, const String* opt_in_nodeHandle, const bool* opt_in_scrollIntoViewIfNeeded, const bool* opt_in_clipToViewport, Ref<TakeScreenshotCallback>&& callback) = 0; |
| 152 | class ResolveChildFrameHandleCallback : public BackendDispatcher::CallbackBase { |
| 153 | public: |
| 154 | ResolveChildFrameHandleCallback(Ref<BackendDispatcher>&&, int id); |
| 155 | void sendSuccess(const String& result); |
| 156 | }; |
| 157 | virtual void resolveChildFrameHandle(const String& in_browsingContextHandle, const String* opt_in_frameHandle, const int* opt_in_ordinal, const String* opt_in_name, const String* opt_in_nodeHandle, Ref<ResolveChildFrameHandleCallback>&& callback) = 0; |
| 158 | class ResolveParentFrameHandleCallback : public BackendDispatcher::CallbackBase { |
| 159 | public: |
| 160 | ResolveParentFrameHandleCallback(Ref<BackendDispatcher>&&, int id); |
| 161 | void sendSuccess(const String& result); |
| 162 | }; |
| 163 | virtual void resolveParentFrameHandle(const String& in_browsingContextHandle, const String& in_frameHandle, Ref<ResolveParentFrameHandleCallback>&& callback) = 0; |
| 164 | class ComputeElementLayoutCallback : public BackendDispatcher::CallbackBase { |
| 165 | public: |
| 166 | ComputeElementLayoutCallback(Ref<BackendDispatcher>&&, int id); |
| 167 | void sendSuccess(RefPtr<Inspector::Protocol::Automation::Rect>&& rect, RefPtr<Inspector::Protocol::Automation::Point>&& inViewCenterPoint, bool isObscured); |
| 168 | }; |
| 169 | virtual void computeElementLayout(const String& in_browsingContextHandle, const String& in_frameHandle, const String& in_nodeHandle, const bool* opt_in_scrollIntoViewIfNeeded, const String& in_coordinateSystem, Ref<ComputeElementLayoutCallback>&& callback) = 0; |
| 170 | class SelectOptionElementCallback : public BackendDispatcher::CallbackBase { |
| 171 | public: |
| 172 | SelectOptionElementCallback(Ref<BackendDispatcher>&&, int id); |
| 173 | void sendSuccess(); |
| 174 | }; |
| 175 | virtual void selectOptionElement(const String& in_browsingContextHandle, const String& in_frameHandle, const String& in_nodeHandle, Ref<SelectOptionElementCallback>&& callback) = 0; |
| 176 | virtual void isShowingJavaScriptDialog(ErrorString&, const String& in_browsingContextHandle, bool* out_result) = 0; |
| 177 | virtual void dismissCurrentJavaScriptDialog(ErrorString&, const String& in_browsingContextHandle) = 0; |
| 178 | virtual void acceptCurrentJavaScriptDialog(ErrorString&, const String& in_browsingContextHandle) = 0; |
| 179 | virtual void messageOfCurrentJavaScriptDialog(ErrorString&, const String& in_browsingContextHandle, String* out_message) = 0; |
| 180 | virtual void setUserInputForCurrentJavaScriptPrompt(ErrorString&, const String& in_browsingContextHandle, const String& in_userInput) = 0; |
| 181 | virtual void setFilesToSelectForFileUpload(ErrorString&, const String& in_browsingContextHandle, const JSON::Array& in_filenames, const JSON::Array* opt_in_fileContents) = 0; |
| 182 | class GetAllCookiesCallback : public BackendDispatcher::CallbackBase { |
| 183 | public: |
| 184 | GetAllCookiesCallback(Ref<BackendDispatcher>&&, int id); |
| 185 | void sendSuccess(RefPtr<JSON::ArrayOf<Inspector::Protocol::Automation::Cookie>>&& cookies); |
| 186 | }; |
| 187 | virtual void getAllCookies(const String& in_browsingContextHandle, Ref<GetAllCookiesCallback>&& callback) = 0; |
| 188 | class DeleteSingleCookieCallback : public BackendDispatcher::CallbackBase { |
| 189 | public: |
| 190 | DeleteSingleCookieCallback(Ref<BackendDispatcher>&&, int id); |
| 191 | void sendSuccess(); |
| 192 | }; |
| 193 | virtual void deleteSingleCookie(const String& in_browsingContextHandle, const String& in_cookieName, Ref<DeleteSingleCookieCallback>&& callback) = 0; |
| 194 | class AddSingleCookieCallback : public BackendDispatcher::CallbackBase { |
| 195 | public: |
| 196 | AddSingleCookieCallback(Ref<BackendDispatcher>&&, int id); |
| 197 | void sendSuccess(); |
| 198 | }; |
| 199 | virtual void addSingleCookie(const String& in_browsingContextHandle, const JSON::Object& in_cookie, Ref<AddSingleCookieCallback>&& callback) = 0; |
| 200 | virtual void deleteAllCookies(ErrorString&, const String& in_browsingContextHandle) = 0; |
| 201 | virtual void getSessionPermissions(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Automation::SessionPermissionData>>& out_permissions) = 0; |
| 202 | virtual void setSessionPermissions(ErrorString&, const JSON::Array& in_permissions) = 0; |
| 203 | protected: |
| 204 | virtual ~AutomationBackendDispatcherHandler(); |
| 205 | }; |
| 206 | |
| 207 | class AutomationBackendDispatcher final : public SupplementalBackendDispatcher { |
| 208 | public: |
| 209 | static Ref<AutomationBackendDispatcher> create(BackendDispatcher&, AutomationBackendDispatcherHandler*); |
| 210 | void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override; |
| 211 | private: |
| 212 | void getBrowsingContexts(long requestId, RefPtr<JSON::Object>&& parameters); |
| 213 | void getBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 214 | void createBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 215 | void closeBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 216 | void switchToBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 217 | void setWindowFrameOfBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 218 | void maximizeWindowOfBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 219 | void hideWindowOfBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 220 | void navigateBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 221 | void goBackInBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 222 | void goForwardInBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 223 | void reloadBrowsingContext(long requestId, RefPtr<JSON::Object>&& parameters); |
| 224 | void waitForNavigationToComplete(long requestId, RefPtr<JSON::Object>&& parameters); |
| 225 | void evaluateJavaScriptFunction(long requestId, RefPtr<JSON::Object>&& parameters); |
| 226 | void performMouseInteraction(long requestId, RefPtr<JSON::Object>&& parameters); |
| 227 | void performKeyboardInteractions(long requestId, RefPtr<JSON::Object>&& parameters); |
| 228 | void performInteractionSequence(long requestId, RefPtr<JSON::Object>&& parameters); |
| 229 | void cancelInteractionSequence(long requestId, RefPtr<JSON::Object>&& parameters); |
| 230 | void takeScreenshot(long requestId, RefPtr<JSON::Object>&& parameters); |
| 231 | void resolveChildFrameHandle(long requestId, RefPtr<JSON::Object>&& parameters); |
| 232 | void resolveParentFrameHandle(long requestId, RefPtr<JSON::Object>&& parameters); |
| 233 | void computeElementLayout(long requestId, RefPtr<JSON::Object>&& parameters); |
| 234 | void selectOptionElement(long requestId, RefPtr<JSON::Object>&& parameters); |
| 235 | void isShowingJavaScriptDialog(long requestId, RefPtr<JSON::Object>&& parameters); |
| 236 | void dismissCurrentJavaScriptDialog(long requestId, RefPtr<JSON::Object>&& parameters); |
| 237 | void acceptCurrentJavaScriptDialog(long requestId, RefPtr<JSON::Object>&& parameters); |
| 238 | void messageOfCurrentJavaScriptDialog(long requestId, RefPtr<JSON::Object>&& parameters); |
| 239 | void setUserInputForCurrentJavaScriptPrompt(long requestId, RefPtr<JSON::Object>&& parameters); |
| 240 | void setFilesToSelectForFileUpload(long requestId, RefPtr<JSON::Object>&& parameters); |
| 241 | void getAllCookies(long requestId, RefPtr<JSON::Object>&& parameters); |
| 242 | void deleteSingleCookie(long requestId, RefPtr<JSON::Object>&& parameters); |
| 243 | void addSingleCookie(long requestId, RefPtr<JSON::Object>&& parameters); |
| 244 | void deleteAllCookies(long requestId, RefPtr<JSON::Object>&& parameters); |
| 245 | void getSessionPermissions(long requestId, RefPtr<JSON::Object>&& parameters); |
| 246 | void setSessionPermissions(long requestId, RefPtr<JSON::Object>&& parameters); |
| 247 | private: |
| 248 | AutomationBackendDispatcher(BackendDispatcher&, AutomationBackendDispatcherHandler*); |
| 249 | AutomationBackendDispatcherHandler* m_agent { nullptr }; |
| 250 | }; |
| 251 | |
| 252 | } // namespace Inspector |
| 253 | |