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