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 "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 "EventListener.h" | 10 #include "EventListener.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "V8Utilities.h" | 23 #include "V8Utilities.h" |
24 #include <wtf/OwnPtr.h> | 24 #include <wtf/OwnPtr.h> |
25 #undef LOG | 25 #undef LOG |
26 | 26 |
27 #include "webkit/api/public/WebDataSource.h" | 27 #include "webkit/api/public/WebDataSource.h" |
28 #include "webkit/api/public/WebDevToolsAgentClient.h" | 28 #include "webkit/api/public/WebDevToolsAgentClient.h" |
29 #include "webkit/api/public/WebFrame.h" | 29 #include "webkit/api/public/WebFrame.h" |
30 #include "webkit/api/public/WebString.h" | 30 #include "webkit/api/public/WebString.h" |
31 #include "webkit/api/public/WebURL.h" | 31 #include "webkit/api/public/WebURL.h" |
32 #include "webkit/api/public/WebURLRequest.h" | 32 #include "webkit/api/public/WebURLRequest.h" |
| 33 #include "webkit/api/src/WebFrameImpl.h" |
33 #include "webkit/api/src/WebViewImpl.h" | 34 #include "webkit/api/src/WebViewImpl.h" |
34 #include "webkit/glue/devtools/bound_object.h" | 35 #include "webkit/glue/devtools/bound_object.h" |
35 #include "webkit/glue/devtools/debugger_agent_impl.h" | 36 #include "webkit/glue/devtools/debugger_agent_impl.h" |
36 #include "webkit/glue/devtools/debugger_agent_manager.h" | 37 #include "webkit/glue/devtools/debugger_agent_manager.h" |
37 #include "webkit/glue/glue_util.h" | 38 #include "webkit/glue/glue_util.h" |
38 #include "webkit/glue/webdevtoolsagent_impl.h" | 39 #include "webkit/glue/webdevtoolsagent_impl.h" |
39 | 40 |
40 using WebCore::Document; | 41 using WebCore::Document; |
41 using WebCore::InspectorBackend; | 42 using WebCore::InspectorBackend; |
42 using WebCore::InspectorController; | 43 using WebCore::InspectorController; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 inspector_frontend_script_state_.clear(); | 153 inspector_frontend_script_state_.clear(); |
153 devtools_agent_host_.set(NULL); | 154 devtools_agent_host_.set(NULL); |
154 debugger_agent_impl_.set(NULL); | 155 debugger_agent_impl_.set(NULL); |
155 attached_ = false; | 156 attached_ = false; |
156 } | 157 } |
157 | 158 |
158 void WebDevToolsAgentImpl::didNavigate() { | 159 void WebDevToolsAgentImpl::didNavigate() { |
159 DebuggerAgentManager::OnNavigate(); | 160 DebuggerAgentManager::OnNavigate(); |
160 } | 161 } |
161 | 162 |
162 void WebDevToolsAgentImpl::DidCommitLoadForFrame( | 163 void WebDevToolsAgentImpl::didCommitProvisionalLoad( |
163 WebViewImpl* webview, | 164 WebFrameImpl* webframe, |
164 WebFrame* frame, | |
165 bool is_new_navigation) { | 165 bool is_new_navigation) { |
166 if (!attached_) { | 166 if (!attached_) { |
167 return; | 167 return; |
168 } | 168 } |
169 WebDataSource* ds = frame->dataSource(); | 169 WebDataSource* ds = webframe->dataSource(); |
170 const WebURLRequest& request = ds->request(); | 170 const WebURLRequest& request = ds->request(); |
171 WebURL url = ds->hasUnreachableURL() ? | 171 WebURL url = ds->hasUnreachableURL() ? |
172 ds->unreachableURL() : | 172 ds->unreachableURL() : |
173 request.url(); | 173 request.url(); |
174 if (webview->mainFrame() == frame) { | 174 if (!webframe->parent()) { |
175 ResetInspectorFrontendProxy(); | 175 ResetInspectorFrontendProxy(); |
176 tools_agent_delegate_stub_->FrameNavigate( | 176 tools_agent_delegate_stub_->FrameNavigate( |
177 webkit_glue::WebURLToKURL(url).string()); | 177 webkit_glue::WebURLToKURL(url).string()); |
178 SetApuAgentEnabledInUtilityContext(utility_context_, apu_agent_enabled_); | 178 SetApuAgentEnabledInUtilityContext(utility_context_, apu_agent_enabled_); |
179 UnhideResourcesPanelIfNecessary(); | 179 UnhideResourcesPanelIfNecessary(); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 void WebDevToolsAgentImpl::WindowObjectCleared(WebFrameImpl* webframe) { | 183 void WebDevToolsAgentImpl::didClearWindowObject(WebFrameImpl* webframe) { |
184 DebuggerAgentManager::SetHostId(webframe, host_id_); | 184 DebuggerAgentManager::SetHostId(webframe, host_id_); |
185 if (attached_) { | 185 if (attached_) { |
186 // Push context id into the client if it is already attached. | 186 // Push context id into the client if it is already attached. |
187 debugger_agent_delegate_stub_->SetContextId(host_id_); | 187 debugger_agent_delegate_stub_->SetContextId(host_id_); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 void WebDevToolsAgentImpl::ForceRepaint() { | 191 void WebDevToolsAgentImpl::ForceRepaint() { |
192 client_->forceRepaint(); | 192 client_->forceRepaint(); |
193 } | 193 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 v8::External::Cast(*args.Data())->Value()); | 454 v8::External::Cast(*args.Data())->Value()); |
455 agent->client_->runtimeFeatureStateChanged( | 455 agent->client_->runtimeFeatureStateChanged( |
456 webkit_glue::StringToWebString(feature), | 456 webkit_glue::StringToWebString(feature), |
457 enabled); | 457 enabled); |
458 return v8::Undefined(); | 458 return v8::Undefined(); |
459 } | 459 } |
460 | 460 |
461 namespace WebKit { | 461 namespace WebKit { |
462 | 462 |
463 // static | 463 // static |
| 464 WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, |
| 465 WebDevToolsAgentClient* client) { |
| 466 return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); |
| 467 } |
| 468 |
| 469 // static |
464 void WebDevToolsAgent::executeDebuggerCommand( | 470 void WebDevToolsAgent::executeDebuggerCommand( |
465 const WebString& command, | 471 const WebString& command, |
466 int caller_id) { | 472 int caller_id) { |
467 DebuggerAgentManager::ExecuteDebuggerCommand( | 473 DebuggerAgentManager::ExecuteDebuggerCommand( |
468 webkit_glue::WebStringToString(command), caller_id); | 474 webkit_glue::WebStringToString(command), caller_id); |
469 } | 475 } |
470 | 476 |
471 // static | 477 // static |
472 void WebDevToolsAgent::setMessageLoopDispatchHandler( | 478 void WebDevToolsAgent::setMessageLoopDispatchHandler( |
473 MessageLoopDispatchHandler handler) { | 479 MessageLoopDispatchHandler handler) { |
474 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); | 480 DebuggerAgentManager::SetMessageLoopDispatchHandler(handler); |
475 } | 481 } |
476 | 482 |
477 } // namespace WebKit | 483 } // namespace WebKit |
OLD | NEW |