| 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_client.h" | 5 #include "content/renderer/devtools/devtools_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/common/devtools_messages.h" | 10 #include "content/common/devtools_messages.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 IPC_END_MESSAGE_MAP() | 48 IPC_END_MESSAGE_MAP() |
| 49 | 49 |
| 50 return handled; | 50 return handled; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void DevToolsClient::sendMessageToBackend(const WebString& message) { | 53 void DevToolsClient::sendMessageToBackend(const WebString& message) { |
| 54 Send(new DevToolsAgentMsg_DispatchOnInspectorBackend(routing_id(), | 54 Send(new DevToolsAgentMsg_DispatchOnInspectorBackend(routing_id(), |
| 55 message.utf8())); | 55 message.utf8())); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void DevToolsClient::activateWindow() { | 58 void DevToolsClient::sendMessageToEmbedder(const WebString& message) { |
| 59 Send(new DevToolsHostMsg_ActivateWindow(routing_id())); | 59 Send(new DevToolsHostMsg_DispatchOnEmbedder(routing_id(), |
| 60 } | 60 message.utf8())); |
| 61 | |
| 62 void DevToolsClient::changeAttachedWindowHeight(unsigned height) { | |
| 63 Send(new DevToolsHostMsg_ChangeAttachedWindowHeight(routing_id(), height)); | |
| 64 } | |
| 65 | |
| 66 void DevToolsClient::closeWindow() { | |
| 67 Send(new DevToolsHostMsg_CloseWindow(routing_id())); | |
| 68 } | |
| 69 | |
| 70 void DevToolsClient::moveWindowBy(const WebKit::WebFloatPoint& offset) { | |
| 71 Send(new DevToolsHostMsg_MoveWindow(routing_id(), offset.x, offset.y)); | |
| 72 } | |
| 73 | |
| 74 void DevToolsClient::requestSetDockSide(const WebKit::WebString& side) { | |
| 75 Send(new DevToolsHostMsg_RequestSetDockSide(routing_id(), side.utf8())); | |
| 76 } | |
| 77 | |
| 78 void DevToolsClient::openInNewTab(const WebKit::WebString& url) { | |
| 79 Send(new DevToolsHostMsg_OpenInNewTab(routing_id(), | |
| 80 url.utf8())); | |
| 81 } | |
| 82 | |
| 83 void DevToolsClient::save(const WebKit::WebString& url, | |
| 84 const WebKit::WebString& content, | |
| 85 bool save_as) { | |
| 86 Send(new DevToolsHostMsg_Save(routing_id(), | |
| 87 url.utf8(), | |
| 88 content.utf8(), | |
| 89 save_as)); | |
| 90 } | |
| 91 | |
| 92 void DevToolsClient::append(const WebKit::WebString& url, | |
| 93 const WebKit::WebString& content) { | |
| 94 Send(new DevToolsHostMsg_Append(routing_id(), | |
| 95 url.utf8(), | |
| 96 content.utf8())); | |
| 97 } | |
| 98 | |
| 99 void DevToolsClient::requestFileSystems() { | |
| 100 Send(new DevToolsHostMsg_RequestFileSystems(routing_id())); | |
| 101 } | |
| 102 | |
| 103 void DevToolsClient::addFileSystem() { | |
| 104 Send(new DevToolsHostMsg_AddFileSystem(routing_id())); | |
| 105 } | |
| 106 | |
| 107 void DevToolsClient::removeFileSystem(const WebString& file_system_path) { | |
| 108 Send(new DevToolsHostMsg_RemoveFileSystem(routing_id(), | |
| 109 file_system_path.utf8())); | |
| 110 } | |
| 111 | |
| 112 void DevToolsClient::indexPath(int request_id, | |
| 113 const WebKit::WebString& file_system_path) { | |
| 114 Send(new DevToolsHostMsg_IndexPath( | |
| 115 routing_id(), request_id, file_system_path.utf8())); | |
| 116 } | |
| 117 | |
| 118 void DevToolsClient::stopIndexing(int request_id) { | |
| 119 Send(new DevToolsHostMsg_StopIndexing(routing_id(), request_id)); | |
| 120 } | |
| 121 | |
| 122 void DevToolsClient::searchInPath(int request_id, | |
| 123 const WebKit::WebString& file_system_path, | |
| 124 const WebKit::WebString& query) { | |
| 125 Send(new DevToolsHostMsg_SearchInPath( | |
| 126 routing_id(), request_id, file_system_path.utf8(), query.utf8())); | |
| 127 } | 61 } |
| 128 | 62 |
| 129 bool DevToolsClient::isUnderTest() { | 63 bool DevToolsClient::isUnderTest() { |
| 130 return RenderThreadImpl::current()->layout_test_mode(); | 64 return RenderThreadImpl::current()->layout_test_mode(); |
| 131 } | 65 } |
| 132 | 66 |
| 133 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { | 67 void DevToolsClient::OnDispatchOnInspectorFrontend(const std::string& message) { |
| 134 web_tools_frontend_->dispatchOnInspectorFrontend( | 68 web_tools_frontend_->dispatchOnInspectorFrontend( |
| 135 WebString::fromUTF8(message)); | 69 WebString::fromUTF8(message)); |
| 136 } | 70 } |
| 137 | 71 |
| 138 } // namespace content | 72 } // namespace content |
| OLD | NEW |