+void DevToolsUIBindings::AttachTo(
+ const scoped_refptr<content::DevToolsAgentHost>& agent_host) {
+ if (agent_host_.get())
+ Detach();
+ agent_host_ = agent_host;
+ agent_host_->AttachClient(this);
+}
+
+void DevToolsUIBindings::Reattach() {
+ DCHECK(agent_host_.get());
+ agent_host_->DetachClient();
+ agent_host_->AttachClient(this);
+}
+
+void DevToolsUIBindings::Detach() {
+ if (agent_host_.get())
+ agent_host_->DetachClient();
+ agent_host_ = NULL;
+}
+
+bool DevToolsUIBindings::IsAttachedTo(content::DevToolsAgentHost* agent_host) {
+ return agent_host_.get() == agent_host;
+}
+