Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: content/renderer/dom_automation_controller.cc

Issue 2923053002: Move MainWorldScriptContext accessor/method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/dom_automation_controller.h ('k') | content/renderer/gin_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/renderer/dom_automation_controller.h ('k') | content/renderer/gin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698