Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: webkit/glue/webdevtoolsclient_impl.cc

Issue 164225: Switch to WebFrame from the WebKit API.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webdevtoolsagent_impl.cc ('k') | webkit/glue/webframe.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "Document.h" 9 #include "Document.h"
10 #include "DOMWindow.h" 10 #include "DOMWindow.h"
11 #include "Frame.h" 11 #include "Frame.h"
12 #include "InspectorBackend.h" 12 #include "InspectorBackend.h"
13 #include "InspectorController.h" 13 #include "InspectorController.h"
14 #include "Node.h" 14 #include "Node.h"
15 #include "Page.h" 15 #include "Page.h"
16 #include "PlatformString.h" 16 #include "PlatformString.h"
17 #include "SecurityOrigin.h" 17 #include "SecurityOrigin.h"
18 #include "V8Binding.h" 18 #include "V8Binding.h"
19 #include "V8CustomBinding.h" 19 #include "V8CustomBinding.h"
20 #include "V8Proxy.h" 20 #include "V8Proxy.h"
21 #include "V8Utilities.h" 21 #include "V8Utilities.h"
22 #include <wtf/OwnPtr.h> 22 #include <wtf/OwnPtr.h>
23 #include <wtf/Vector.h> 23 #include <wtf/Vector.h>
24 #undef LOG 24 #undef LOG
25 25
26 #include "base/string_util.h" 26 #include "base/string_util.h"
27 #include "base/values.h" 27 #include "base/values.h"
28 #include "webkit/api/public/WebFrame.h"
28 #include "webkit/api/public/WebScriptSource.h" 29 #include "webkit/api/public/WebScriptSource.h"
29 #include "webkit/glue/devtools/bound_object.h" 30 #include "webkit/glue/devtools/bound_object.h"
30 #include "webkit/glue/devtools/debugger_agent.h" 31 #include "webkit/glue/devtools/debugger_agent.h"
31 #include "webkit/glue/devtools/devtools_rpc_js.h" 32 #include "webkit/glue/devtools/devtools_rpc_js.h"
32 #include "webkit/glue/devtools/dom_agent.h" 33 #include "webkit/glue/devtools/dom_agent.h"
33 #include "webkit/glue/devtools/tools_agent.h" 34 #include "webkit/glue/devtools/tools_agent.h"
34 #include "webkit/glue/glue_util.h" 35 #include "webkit/glue/glue_util.h"
35 #include "webkit/glue/webdevtoolsclient_delegate.h" 36 #include "webkit/glue/webdevtoolsclient_delegate.h"
36 #include "webkit/glue/webdevtoolsclient_impl.h" 37 #include "webkit/glue/webdevtoolsclient_impl.h"
37 #include "webkit/glue/webframe.h"
38 #include "webkit/glue/webview_impl.h" 38 #include "webkit/glue/webview_impl.h"
39 39
40 using namespace WebCore; 40 using namespace WebCore;
41 using WebKit::WebFrame;
41 using WebKit::WebScriptSource; 42 using WebKit::WebScriptSource;
42 using WebKit::WebString; 43 using WebKit::WebString;
43 44
44 DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT, 45 DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT,
45 DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) 46 DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT)
46 DEFINE_RPC_JS_BOUND_OBJ(DomAgent, DOM_AGENT_STRUCT, 47 DEFINE_RPC_JS_BOUND_OBJ(DomAgent, DOM_AGENT_STRUCT,
47 DomAgentDelegate, DOM_AGENT_DELEGATE_STRUCT) 48 DomAgentDelegate, DOM_AGENT_DELEGATE_STRUCT)
48 DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT, 49 DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT,
49 ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT) 50 ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT)
50 51
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 Node* frame) { 223 Node* frame) {
223 if (tools_agent_native_delegate_impl_->WaitingForResponse(resource_id, 224 if (tools_agent_native_delegate_impl_->WaitingForResponse(resource_id,
224 frame)) { 225 frame)) {
225 return; 226 return;
226 } 227 }
227 tools_agent_obj_->GetResourceContent(resource_id, resource_id); 228 tools_agent_obj_->GetResourceContent(resource_id, resource_id);
228 tools_agent_native_delegate_impl_->RequestSent(resource_id, mime_type, frame); 229 tools_agent_native_delegate_impl_->RequestSent(resource_id, mime_type, frame);
229 } 230 }
230 231
231 void WebDevToolsClientImpl::ExecuteScript(const std::string& expr) { 232 void WebDevToolsClientImpl::ExecuteScript(const std::string& expr) {
232 web_view_impl_->GetMainFrame()->ExecuteScript( 233 web_view_impl_->GetMainFrame()->executeScript(
233 WebScriptSource(WebString::fromUTF8(expr))); 234 WebScriptSource(WebString::fromUTF8(expr)));
234 } 235 }
235 236
236 237
237 void WebDevToolsClientImpl::SendRpcMessage(const std::string& class_name, 238 void WebDevToolsClientImpl::SendRpcMessage(const std::string& class_name,
238 const std::string& method_name, 239 const std::string& method_name,
239 const std::string& raw_msg) { 240 const std::string& raw_msg) {
240 delegate_->SendMessageToAgent(class_name, method_name, raw_msg); 241 delegate_->SendMessageToAgent(class_name, method_name, raw_msg);
241 } 242 }
242 243
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 369
369 // static 370 // static
370 v8::Handle<v8::Value> WebDevToolsClientImpl::JsToggleInspectElementMode( 371 v8::Handle<v8::Value> WebDevToolsClientImpl::JsToggleInspectElementMode(
371 const v8::Arguments& args) { 372 const v8::Arguments& args) {
372 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>( 373 WebDevToolsClientImpl* client = static_cast<WebDevToolsClientImpl*>(
373 v8::External::Cast(*args.Data())->Value()); 374 v8::External::Cast(*args.Data())->Value());
374 int enabled = static_cast<int>(args[0]->BooleanValue()); 375 int enabled = static_cast<int>(args[0]->BooleanValue());
375 client->delegate_->ToggleInspectElementMode(enabled); 376 client->delegate_->ToggleInspectElementMode(enabled);
376 return v8::Undefined(); 377 return v8::Undefined();
377 } 378 }
OLDNEW
« no previous file with comments | « webkit/glue/webdevtoolsagent_impl.cc ('k') | webkit/glue/webframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698