Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index a2687675cf09db47a234f9381e0ae80ea43fffe9..0faf36066e10857dc89878d83f761325abf07c14 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -3665,11 +3665,18 @@ |
FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
DidClearWindowObject(frame)); |
- if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) |
- DomAutomationController::Install(frame); |
- |
- if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
- StatsCollectionController::Install(frame); |
+ if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) { |
+ if (!dom_automation_controller_) |
+ dom_automation_controller_.reset(new DomAutomationController()); |
+ dom_automation_controller_->set_message_sender( |
+ static_cast<RenderView*>(this)); |
+ dom_automation_controller_->set_routing_id(routing_id()); |
+ dom_automation_controller_->BindToJavascript(frame, |
+ "domAutomationController"); |
+ } |
+ |
+ if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
+ StatsCollectionController::Install(frame); |
} |
void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { |