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/renderer/devtools/devtools_agent.h" | 5 #include "content/renderer/devtools/devtools_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "content/common/devtools_messages.h" | 14 #include "content/common/devtools_messages.h" |
| 15 #include "content/common/frame_messages.h" |
15 #include "content/common/gpu/gpu_messages.h" | 16 #include "content/common/gpu/gpu_messages.h" |
16 #include "content/common/view_messages.h" | 17 #include "content/common/view_messages.h" |
17 #include "content/renderer/devtools/devtools_agent_filter.h" | 18 #include "content/renderer/devtools/devtools_agent_filter.h" |
18 #include "content/renderer/devtools/devtools_client.h" | 19 #include "content/renderer/devtools/devtools_client.h" |
19 #include "content/renderer/render_thread_impl.h" | 20 #include "content/renderer/render_thread_impl.h" |
20 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
21 #include "third_party/WebKit/public/platform/WebPoint.h" | 22 #include "third_party/WebKit/public/platform/WebPoint.h" |
22 #include "third_party/WebKit/public/platform/WebString.h" | 23 #include "third_party/WebKit/public/platform/WebString.h" |
23 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 24 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
24 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 25 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, | 99 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, |
99 OnDispatchOnInspectorBackend) | 100 OnDispatchOnInspectorBackend) |
100 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_InspectElement, OnInspectElement) | 101 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_InspectElement, OnInspectElement) |
101 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_AddMessageToConsole, | 102 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_AddMessageToConsole, |
102 OnAddMessageToConsole) | 103 OnAddMessageToConsole) |
103 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_GpuTasksChunk, OnGpuTasksChunk) | 104 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_GpuTasksChunk, OnGpuTasksChunk) |
104 IPC_MESSAGE_HANDLER(DevToolsMsg_SetupDevToolsClient, OnSetupDevToolsClient) | 105 IPC_MESSAGE_HANDLER(DevToolsMsg_SetupDevToolsClient, OnSetupDevToolsClient) |
105 IPC_MESSAGE_UNHANDLED(handled = false) | 106 IPC_MESSAGE_UNHANDLED(handled = false) |
106 IPC_END_MESSAGE_MAP() | 107 IPC_END_MESSAGE_MAP() |
107 | 108 |
108 if (message.type() == ViewMsg_Navigate::ID || | 109 if (message.type() == FrameMsg_Navigate::ID || |
109 message.type() == ViewMsg_Close::ID) | 110 message.type() == ViewMsg_Close::ID) |
110 ContinueProgram(); // Don't want to swallow the message. | 111 ContinueProgram(); // Don't want to swallow the message. |
111 | 112 |
112 return handled; | 113 return handled; |
113 } | 114 } |
114 | 115 |
115 void DevToolsAgent::sendMessageToInspectorFrontend( | 116 void DevToolsAgent::sendMessageToInspectorFrontend( |
116 const blink::WebString& message) { | 117 const blink::WebString& message) { |
117 Send(new DevToolsClientMsg_DispatchOnInspectorFrontend(routing_id(), | 118 Send(new DevToolsClientMsg_DispatchOnInspectorFrontend(routing_id(), |
118 message.utf8())); | 119 message.utf8())); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (!web_view) | 352 if (!web_view) |
352 return NULL; | 353 return NULL; |
353 return web_view->devToolsAgent(); | 354 return web_view->devToolsAgent(); |
354 } | 355 } |
355 | 356 |
356 bool DevToolsAgent::IsAttached() { | 357 bool DevToolsAgent::IsAttached() { |
357 return is_attached_; | 358 return is_attached_; |
358 } | 359 } |
359 | 360 |
360 } // namespace content | 361 } // namespace content |
OLD | NEW |