| 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/browser/devtools/render_view_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_view_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (!command) { | 188 if (!command) { |
| 189 OnDispatchOnInspectorFrontend(error_message); | 189 OnDispatchOnInspectorFrontend(error_message); |
| 190 return; | 190 return; |
| 191 } | 191 } |
| 192 | 192 |
| 193 scoped_ptr<DevToolsProtocol::Response> overridden_response( | 193 scoped_ptr<DevToolsProtocol::Response> overridden_response( |
| 194 overrides_handler_->HandleCommand(command.get())); | 194 overrides_handler_->HandleCommand(command.get())); |
| 195 if (overridden_response) | 195 if (overridden_response) |
| 196 OnDispatchOnInspectorFrontend(overridden_response->Serialize()); | 196 OnDispatchOnInspectorFrontend(overridden_response->Serialize()); |
| 197 else | 197 else |
| 198 DevToolsAgentHostImpl::DispatchOnInspectorBackend(message); | 198 IPCDevToolsAgentHost::DispatchOnInspectorBackend(message); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { | 201 void RenderViewDevToolsAgentHost::SendMessageToAgent(IPC::Message* msg) { |
| 202 if (!render_view_host_) | 202 if (!render_view_host_) |
| 203 return; | 203 return; |
| 204 msg->set_routing_id(render_view_host_->GetRoutingID()); | 204 msg->set_routing_id(render_view_host_->GetRoutingID()); |
| 205 render_view_host_->Send(msg); | 205 render_view_host_->Send(msg); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void RenderViewDevToolsAgentHost::NotifyClientAttaching() { | 208 void RenderViewDevToolsAgentHost::NotifyClientAttaching() { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 snapshot_bounds)) | 376 snapshot_bounds)) |
| 377 return false; | 377 return false; |
| 378 | 378 |
| 379 return base::Base64Encode(base::StringPiece( | 379 return base::Base64Encode(base::StringPiece( |
| 380 reinterpret_cast<char*>(&*png.begin()), | 380 reinterpret_cast<char*>(&*png.begin()), |
| 381 png.size()), | 381 png.size()), |
| 382 base_64_data); | 382 base_64_data); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace content | 385 } // namespace content |
| OLD | NEW |