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

Unified Diff: content/renderer/dom_automation_controller.cc

Issue 157713002: Switch DomAutomationController to be a RenderFrameObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nasko@ CR feedback Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/dom_automation_controller.cc
diff --git a/content/renderer/dom_automation_controller.cc b/content/renderer/dom_automation_controller.cc
index f3f0914d51703da36b0232c6c5c8a0a51625d987..33b074523664e7249daefcc9f5aafb18d78ca54d 100644
--- a/content/renderer/dom_automation_controller.cc
+++ b/content/renderer/dom_automation_controller.cc
@@ -7,7 +7,7 @@
#include "base/json/json_string_value_serializer.h"
#include "base/strings/string_util.h"
#include "content/common/child_process_messages.h"
-#include "content/common/view_messages.h"
+#include "content/common/frame_messages.h"
#include "content/renderer/render_view_impl.h"
#include "content/renderer/v8_value_converter_impl.h"
#include "gin/handle.h"
@@ -21,7 +21,7 @@ gin::WrapperInfo DomAutomationController::kWrapperInfo = {
gin::kEmbedderNativeGin};
// static
-void DomAutomationController::Install(RenderViewImpl* render_view,
+void DomAutomationController::Install(RenderFrame* render_frame,
blink::WebFrame* frame) {
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
@@ -32,14 +32,14 @@ void DomAutomationController::Install(RenderViewImpl* render_view,
v8::Context::Scope context_scope(context);
gin::Handle<DomAutomationController> controller =
- gin::CreateHandle(isolate, new DomAutomationController(render_view));
+ gin::CreateHandle(isolate, new DomAutomationController(render_frame));
v8::Handle<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "domAutomationController"),
controller.ToV8());
}
-DomAutomationController::DomAutomationController(RenderViewImpl* render_view)
- : RenderViewObserver(render_view), automation_id_(MSG_ROUTING_NONE) {}
+DomAutomationController::DomAutomationController(RenderFrame* render_frame)
+ : RenderFrameObserver(render_frame), automation_id_(MSG_ROUTING_NONE) {}
DomAutomationController::~DomAutomationController() {}
@@ -56,7 +56,7 @@ gin::ObjectTemplateBuilder DomAutomationController::GetObjectTemplateBuilder(
void DomAutomationController::OnDestruct() {}
bool DomAutomationController::SendMsg(const gin::Arguments& args) {
- if (!render_view())
+ if (!render_frame())
return false;
if (automation_id_ == MSG_ROUTING_NONE)
@@ -84,21 +84,21 @@ bool DomAutomationController::SendMsg(const gin::Arguments& args) {
if (!serializer.Serialize(*value))
return false;
- bool succeeded = Send(
- new ViewHostMsg_DomOperationResponse(routing_id(), json, automation_id_));
+ bool succeeded = Send(new FrameHostMsg_DomOperationResponse(
+ routing_id(), json, automation_id_));
automation_id_ = MSG_ROUTING_NONE;
return succeeded;
}
bool DomAutomationController::SendJSON(const std::string& json) {
- if (!render_view())
+ if (!render_frame())
return false;
if (automation_id_ == MSG_ROUTING_NONE)
return false;
- bool result = Send(
- new ViewHostMsg_DomOperationResponse(routing_id(), json, automation_id_));
+ bool result = Send(new FrameHostMsg_DomOperationResponse(
+ routing_id(), json, automation_id_));
automation_id_ = MSG_ROUTING_NONE;
return result;
@@ -106,10 +106,10 @@ bool DomAutomationController::SendJSON(const std::string& json) {
bool DomAutomationController::SendWithId(int automation_id,
const std::string& str) {
- if (!render_view())
+ if (!render_frame())
return false;
return Send(
- new ViewHostMsg_DomOperationResponse(routing_id(), str, automation_id));
+ new FrameHostMsg_DomOperationResponse(routing_id(), str, automation_id));
}
bool DomAutomationController::SetAutomationId(int automation_id) {

Powered by Google App Engine
This is Rietveld 408576698