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 "webkit/tools/test_shell/test_shell_devtools_agent.h" | 5 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "grit/webkit_chromium_resources.h" | 9 #include "grit/webkit_chromium_resources.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 virtual void quitNow() { | 35 virtual void quitNow() { |
36 message_loop_->QuitNow(); | 36 message_loop_->QuitNow(); |
37 } | 37 } |
38 private: | 38 private: |
39 MessageLoop* message_loop_; | 39 MessageLoop* message_loop_; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 TestShellDevToolsAgent::TestShellDevToolsAgent() | 44 TestShellDevToolsAgent::TestShellDevToolsAgent() |
45 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 45 : weak_factory_(this), |
46 dev_tools_client_(NULL) { | 46 dev_tools_client_(NULL) { |
47 static int dev_tools_agent_counter; | 47 static int dev_tools_agent_counter; |
48 routing_id_ = ++dev_tools_agent_counter; | 48 routing_id_ = ++dev_tools_agent_counter; |
49 } | 49 } |
50 | 50 |
51 TestShellDevToolsAgent::~TestShellDevToolsAgent() { | 51 TestShellDevToolsAgent::~TestShellDevToolsAgent() { |
52 } | 52 } |
53 | 53 |
54 void TestShellDevToolsAgent::SetWebView(WebKit::WebView* web_view) { | 54 void TestShellDevToolsAgent::SetWebView(WebKit::WebView* web_view) { |
55 web_view_ = web_view; | 55 web_view_ = web_view; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 bool TestShellDevToolsAgent::evaluateInWebInspector( | 116 bool TestShellDevToolsAgent::evaluateInWebInspector( |
117 long call_id, | 117 long call_id, |
118 const std::string& script) { | 118 const std::string& script) { |
119 WebDevToolsAgent* agent = GetWebAgent(); | 119 WebDevToolsAgent* agent = GetWebAgent(); |
120 if (!agent) | 120 if (!agent) |
121 return false; | 121 return false; |
122 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script)); | 122 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script)); |
123 return true; | 123 return true; |
124 } | 124 } |
OLD | NEW |