| 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 #include "content/renderer/dom_automation_controller.h" | 5 #include "content/renderer/dom_automation_controller.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "content/child/v8_value_converter_impl.h" | 9 #include "content/child/v8_value_converter_impl.h" |
| 10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
| 11 #include "content/common/frame_messages.h" | 11 #include "content/common/frame_messages.h" |
| 12 #include "content/renderer/render_view_impl.h" | 12 #include "content/renderer/render_view_impl.h" |
| 13 #include "gin/handle.h" | 13 #include "gin/handle.h" |
| 14 #include "gin/object_template_builder.h" | 14 #include "gin/object_template_builder.h" |
| 15 #include "third_party/WebKit/public/web/WebFrame.h" | |
| 16 #include "third_party/WebKit/public/web/WebKit.h" | 15 #include "third_party/WebKit/public/web/WebKit.h" |
| 16 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 gin::WrapperInfo DomAutomationController::kWrapperInfo = { | 20 gin::WrapperInfo DomAutomationController::kWrapperInfo = { |
| 21 gin::kEmbedderNativeGin}; | 21 gin::kEmbedderNativeGin}; |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 void DomAutomationController::Install(RenderFrame* render_frame, | 24 void DomAutomationController::Install(RenderFrame* render_frame, |
| 25 blink::WebFrame* frame) { | 25 blink::WebLocalFrame* frame) { |
| 26 v8::Isolate* isolate = blink::MainThreadIsolate(); | 26 v8::Isolate* isolate = blink::MainThreadIsolate(); |
| 27 v8::HandleScope handle_scope(isolate); | 27 v8::HandleScope handle_scope(isolate); |
| 28 v8::Local<v8::Context> context = frame->MainWorldScriptContext(); | 28 v8::Local<v8::Context> context = frame->MainWorldScriptContext(); |
| 29 if (context.IsEmpty()) | 29 if (context.IsEmpty()) |
| 30 return; | 30 return; |
| 31 | 31 |
| 32 v8::Context::Scope context_scope(context); | 32 v8::Context::Scope context_scope(context); |
| 33 | 33 |
| 34 gin::Handle<DomAutomationController> controller = | 34 gin::Handle<DomAutomationController> controller = |
| 35 gin::CreateHandle(isolate, new DomAutomationController(render_frame)); | 35 gin::CreateHandle(isolate, new DomAutomationController(render_frame)); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return Send( | 136 return Send( |
| 137 new FrameHostMsg_DomOperationResponse(routing_id(), str)); | 137 new FrameHostMsg_DomOperationResponse(routing_id(), str)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool DomAutomationController::SetAutomationId(int automation_id) { | 140 bool DomAutomationController::SetAutomationId(int automation_id) { |
| 141 automation_id_ = automation_id; | 141 automation_id_ = automation_id; |
| 142 return true; | 142 return true; |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace content | 145 } // namespace content |
| OLD | NEW |