| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ | 5 #ifndef CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ |
| 6 #define CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ | 6 #define CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 9 #include "content/public/renderer/render_frame_observer.h" | 11 #include "content/public/renderer/render_frame_observer.h" |
| 10 #include "gin/wrappable.h" | 12 #include "gin/wrappable.h" |
| 11 | 13 |
| 12 /* DomAutomationController class: | 14 /* DomAutomationController class: |
| 13 Bound to Javascript window.domAutomationController object. | 15 Bound to Javascript window.domAutomationController object. |
| 14 At the very basic, this object makes any native value (string, numbers, | 16 At the very basic, this object makes any native value (string, numbers, |
| 15 boolean) from javascript available to the automation host in Cpp. | 17 boolean) from javascript available to the automation host in Cpp. |
| 16 Any renderer implementation that is built with this binding will allow the | 18 Any renderer implementation that is built with this binding will allow the |
| 17 above facility. | 19 above facility. |
| 18 The intended use of this object is to expose the DOM Objects and their | 20 The intended use of this object is to expose the DOM Objects and their |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 87 |
| 86 class DomAutomationController : public gin::Wrappable<DomAutomationController>, | 88 class DomAutomationController : public gin::Wrappable<DomAutomationController>, |
| 87 public RenderFrameObserver { | 89 public RenderFrameObserver { |
| 88 public: | 90 public: |
| 89 static gin::WrapperInfo kWrapperInfo; | 91 static gin::WrapperInfo kWrapperInfo; |
| 90 | 92 |
| 91 static void Install(RenderFrame* render_frame, blink::WebFrame* frame); | 93 static void Install(RenderFrame* render_frame, blink::WebFrame* frame); |
| 92 | 94 |
| 93 // Makes the renderer send a javascript value to the app. | 95 // Makes the renderer send a javascript value to the app. |
| 94 // The value to be sent can be either of type String, | 96 // The value to be sent can be either of type String, |
| 95 // Number (double casted to int32) or Boolean. Any other type or no | 97 // Number (double casted to int32_t) or Boolean. Any other type or no |
| 96 // argument at all is ignored. | 98 // argument at all is ignored. |
| 97 bool SendMsg(const gin::Arguments& args); | 99 bool SendMsg(const gin::Arguments& args); |
| 98 | 100 |
| 99 // Makes the renderer send a javascript value to the app. | 101 // Makes the renderer send a javascript value to the app. |
| 100 // The value should be properly formed JSON. | 102 // The value should be properly formed JSON. |
| 101 bool SendJSON(const std::string& json); | 103 bool SendJSON(const std::string& json); |
| 102 | 104 |
| 103 // Sends a string with a provided Automation Id. | 105 // Sends a string with a provided Automation Id. |
| 104 bool SendWithId(int automation_id, const std::string& str); | 106 bool SendWithId(int automation_id, const std::string& str); |
| 105 | 107 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 120 int world_id) override; | 122 int world_id) override; |
| 121 | 123 |
| 122 int automation_id_; // routing id to be used by the next channel. | 124 int automation_id_; // routing id to be used by the next channel. |
| 123 | 125 |
| 124 DISALLOW_COPY_AND_ASSIGN(DomAutomationController); | 126 DISALLOW_COPY_AND_ASSIGN(DomAutomationController); |
| 125 }; | 127 }; |
| 126 | 128 |
| 127 } // namespace content | 129 } // namespace content |
| 128 | 130 |
| 129 #endif // CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ | 131 #endif // CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ |
| OLD | NEW |