| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file contains implementations of the DebuggerRemoteService methods, | 5 // This file contains implementations of the DebuggerRemoteService methods, |
| 6 // defines DebuggerRemoteService and DebuggerRemoteServiceCommand constants. | 6 // defines DebuggerRemoteService and DebuggerRemoteServiceCommand constants. |
| 7 | 7 |
| 8 #include "chrome/browser/debugger/debugger_remote_service.h" | 8 #include "chrome/browser/debugger/debugger_remote_service.h" |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/debugger/devtools_manager.h" | 15 #include "chrome/browser/debugger/devtools_manager.h" |
| 16 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 16 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
| 17 #include "chrome/browser/debugger/devtools_remote_message.h" | 17 #include "chrome/browser/debugger/devtools_remote_message.h" |
| 18 #include "chrome/browser/debugger/inspectable_tab_proxy.h" | 18 #include "chrome/browser/debugger/inspectable_tab_proxy.h" |
| 19 #include "chrome/browser/renderer_host/render_view_host.h" | |
| 20 #include "chrome/browser/tab_contents/tab_contents.h" | |
| 21 #include "chrome/common/devtools_messages.h" | 19 #include "chrome/common/devtools_messages.h" |
| 22 #include "chrome/common/render_messages.h" | 20 #include "chrome/common/render_messages.h" |
| 23 #include "chrome/common/render_messages_params.h" | 21 #include "chrome/common/render_messages_params.h" |
| 22 #include "content/browser/renderer_host/render_view_host.h" |
| 23 #include "content/browser/tab_contents/tab_contents.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Constants for the "data", "result", and "command" JSON message fields. | 27 // Constants for the "data", "result", and "command" JSON message fields. |
| 28 const char kDataKey[] = "data"; | 28 const char kDataKey[] = "data"; |
| 29 const char kResultKey[] = "result"; | 29 const char kResultKey[] = "result"; |
| 30 const char kCommandKey[] = "command"; | 30 const char kCommandKey[] = "command"; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // No RenderViewHost | 327 // No RenderViewHost |
| 328 response->SetInteger(kResultKey, RESULT_UNKNOWN_TAB); | 328 response->SetInteger(kResultKey, RESULT_UNKNOWN_TAB); |
| 329 return true; | 329 return true; |
| 330 } | 330 } |
| 331 std::string javascript; | 331 std::string javascript; |
| 332 content->GetString(kDataKey, &javascript); | 332 content->GetString(kDataKey, &javascript); |
| 333 render_view_host->ExecuteJavascriptInWebFrame(string16(), | 333 render_view_host->ExecuteJavascriptInWebFrame(string16(), |
| 334 UTF8ToUTF16(javascript)); | 334 UTF8ToUTF16(javascript)); |
| 335 return false; | 335 return false; |
| 336 } | 336 } |
| OLD | NEW |