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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) { | 327 void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) { |
328 web_view_impl_->inspectElementAt(point); | 328 web_view_impl_->inspectElementAt(point); |
329 } | 329 } |
330 | 330 |
331 void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& wfeature, | 331 void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& wfeature, |
332 bool enabled) { | 332 bool enabled) { |
333 String feature = webkit_glue::WebStringToString(wfeature); | 333 String feature = webkit_glue::WebStringToString(wfeature); |
334 if (feature == kApuAgentFeatureName) { | 334 if (feature == kApuAgentFeatureName) { |
335 setApuAgentEnabled(enabled); | 335 setApuAgentEnabled(enabled); |
336 } else if (feature == kTimelineFeatureName) { | 336 } else if (feature == kTimelineFeatureName) { |
337 InspectorController* ic = web_view_impl_->page()->inspectorController(); | 337 setTimelineProfilingEnabled(enabled); |
338 if (enabled) | |
339 ic->startTimelineProfiler(); | |
340 else | |
341 ic->stopTimelineProfiler(); | |
342 } else if (feature == kResourceTrackingFeatureName) { | 338 } else if (feature == kResourceTrackingFeatureName) { |
343 InspectorController* ic = web_view_impl_->page()->inspectorController(); | 339 InspectorController* ic = web_view_impl_->page()->inspectorController(); |
344 if (enabled) | 340 if (enabled) |
345 ic->enableResourceTracking(false /* not sticky */, false /* no reload */); | 341 ic->enableResourceTracking(false /* not sticky */, false /* no reload */); |
346 else | 342 else |
347 ic->disableResourceTracking(false /* not sticky */); | 343 ic->disableResourceTracking(false /* not sticky */); |
348 } | 344 } |
349 } | 345 } |
350 | 346 |
351 void WebDevToolsAgentImpl::SendRpcMessage( | 347 void WebDevToolsAgentImpl::SendRpcMessage( |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 592 } |
597 } | 593 } |
598 | 594 |
599 void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, | 595 void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, |
600 const WebURLError& error) { | 596 const WebURLError& error) { |
601 ResourceError resource_error; | 597 ResourceError resource_error; |
602 if (InspectorController* ic = GetInspectorController()) | 598 if (InspectorController* ic = GetInspectorController()) |
603 ic->didFailLoading(resourceId, resource_error); | 599 ic->didFailLoading(resourceId, resource_error); |
604 } | 600 } |
605 | 601 |
| 602 void WebDevToolsAgentImpl::evaluateInWebInspector(long call_id, |
| 603 const WebString& script) { |
| 604 InspectorController* ic = GetInspectorController(); |
| 605 ic->evaluateForTestInFrontend(call_id, |
| 606 webkit_glue::WebStringToString(script)); |
| 607 } |
| 608 |
| 609 void WebDevToolsAgentImpl::setTimelineProfilingEnabled(bool enabled) { |
| 610 InspectorController* ic = GetInspectorController(); |
| 611 if (enabled) |
| 612 ic->startTimelineProfiler(); |
| 613 else |
| 614 ic->stopTimelineProfiler(); |
| 615 } |
| 616 |
606 | 617 |
607 namespace WebKit { | 618 namespace WebKit { |
608 | 619 |
609 // static | 620 // static |
610 WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, | 621 WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, |
611 WebDevToolsAgentClient* client) { | 622 WebDevToolsAgentClient* client) { |
612 return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); | 623 return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); |
613 } | 624 } |
614 | 625 |
615 // static | 626 // static |
(...skipping 28 matching lines...) Expand all Loading... |
644 return ProfilerAgentDispatch::Dispatch( | 655 return ProfilerAgentDispatch::Dispatch( |
645 &agent, | 656 &agent, |
646 webkit_glue::WebStringToString(className), | 657 webkit_glue::WebStringToString(className), |
647 webkit_glue::WebStringToString(methodName), | 658 webkit_glue::WebStringToString(methodName), |
648 webkit_glue::WebStringToString(param1), | 659 webkit_glue::WebStringToString(param1), |
649 webkit_glue::WebStringToString(param2), | 660 webkit_glue::WebStringToString(param2), |
650 webkit_glue::WebStringToString(param3)); | 661 webkit_glue::WebStringToString(param3)); |
651 } | 662 } |
652 | 663 |
653 } // namespace WebKit | 664 } // namespace WebKit |
OLD | NEW |