| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" | 5 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" |
| 6 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontend.h" | 6 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontend.h" |
| 7 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 7 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 TestShellDevToolsClient::~TestShellDevToolsClient() { | 44 TestShellDevToolsClient::~TestShellDevToolsClient() { |
| 45 // It is a chance that page will be destroyed at detach step of | 45 // It is a chance that page will be destroyed at detach step of |
| 46 // dev_tools_agent_ and we should clean pending requests a bit earlier. | 46 // dev_tools_agent_ and we should clean pending requests a bit earlier. |
| 47 call_method_factory_.RevokeAll(); | 47 call_method_factory_.RevokeAll(); |
| 48 if (dev_tools_agent_) | 48 if (dev_tools_agent_) |
| 49 dev_tools_agent_->detach(this); | 49 dev_tools_agent_->detach(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TestShellDevToolsClient::sendMessageToAgent( | 52 void TestShellDevToolsClient::sendMessageToBackend( |
| 53 const WebDevToolsMessageData& data) { | 53 const WebString& data) { |
| 54 if (dev_tools_agent_) | 54 if (dev_tools_agent_) |
| 55 dev_tools_agent_->AsyncCall(TestShellDevToolsCallArgs(data)); | 55 dev_tools_agent_->AsyncCall(TestShellDevToolsCallArgs(data)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TestShellDevToolsClient::sendDebuggerCommandToAgent( | 58 void TestShellDevToolsClient::sendDebuggerCommandToAgent( |
| 59 const WebString& command) { | 59 const WebString& command) { |
| 60 WebDevToolsAgent::executeDebuggerCommand(command, 1); | 60 WebDevToolsAgent::executeDebuggerCommand(command, 1); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void TestShellDevToolsClient::activateWindow() { | 63 void TestShellDevToolsClient::activateWindow() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 void TestShellDevToolsClient::AsyncCall(const TestShellDevToolsCallArgs &args) { | 79 void TestShellDevToolsClient::AsyncCall(const TestShellDevToolsCallArgs &args) { |
| 80 MessageLoop::current()->PostDelayedTask( | 80 MessageLoop::current()->PostDelayedTask( |
| 81 FROM_HERE, | 81 FROM_HERE, |
| 82 call_method_factory_.NewRunnableMethod(&TestShellDevToolsClient::Call, | 82 call_method_factory_.NewRunnableMethod(&TestShellDevToolsClient::Call, |
| 83 args), | 83 args), |
| 84 0); | 84 0); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void TestShellDevToolsClient::Call(const TestShellDevToolsCallArgs &args) { | 87 void TestShellDevToolsClient::Call(const TestShellDevToolsCallArgs &args) { |
| 88 web_tools_frontend_->dispatchMessageFromAgent(args.data_); | 88 web_tools_frontend_->dispatchOnInspectorFrontend(args.data_); |
| 89 if (TestShellDevToolsCallArgs::calls_count() == 1) | 89 if (TestShellDevToolsCallArgs::calls_count() == 1) |
| 90 all_messages_processed(); | 90 all_messages_processed(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void TestShellDevToolsClient::all_messages_processed() { | 93 void TestShellDevToolsClient::all_messages_processed() { |
| 94 web_view_->mainFrame()->executeScript( | 94 web_view_->mainFrame()->executeScript( |
| 95 WebKit::WebScriptSource(WebString::fromUTF8( | 95 WebKit::WebScriptSource(WebString::fromUTF8( |
| 96 "if (window.WebInspector && WebInspector.queuesAreEmpty) WebInspector.queu
esAreEmpty();"))); | 96 "if (window.WebInspector && WebInspector.queuesAreEmpty) WebInspector.queu
esAreEmpty();"))); |
| 97 } | 97 } |
| OLD | NEW |