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 "chrome/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 RenderViewHost* view = GetViewForTab(tab_handle); | 715 RenderViewHost* view = GetViewForTab(tab_handle); |
716 if (!view) { | 716 if (!view) { |
717 NOTREACHED(); | 717 NOTREACHED(); |
718 return; | 718 return; |
719 } | 719 } |
720 | 720 |
721 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( | 721 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( |
722 view->GetRoutingID(), cmd, param)); | 722 view->GetRoutingID(), cmd, param)); |
723 } | 723 } |
724 | 724 |
725 void AutomationProvider::BeginTracing(const std::string& categories, | 725 void AutomationProvider::BeginTracing(const std::string& tag_patterns, |
726 bool* success) { | 726 bool* success) { |
727 tracing_data_.trace_output.clear(); | 727 tracing_data_.trace_output.clear(); |
728 *success = TraceController::GetInstance()->BeginTracing(this, categories); | 728 *success = TraceController::GetInstance()->BeginTracing(this, tag_patterns); |
729 } | 729 } |
730 | 730 |
731 void AutomationProvider::EndTracing(IPC::Message* reply_message) { | 731 void AutomationProvider::EndTracing(IPC::Message* reply_message) { |
732 bool success = false; | 732 bool success = false; |
733 if (!tracing_data_.reply_message.get()) | 733 if (!tracing_data_.reply_message.get()) |
734 success = TraceController::GetInstance()->EndTracingAsync(this); | 734 success = TraceController::GetInstance()->EndTracingAsync(this); |
735 if (success) { | 735 if (success) { |
736 // Defer EndTracing reply until TraceController calls us back with all the | 736 // Defer EndTracing reply until TraceController calls us back with all the |
737 // events. | 737 // events. |
738 tracing_data_.reply_message.reset(reply_message); | 738 tracing_data_.reply_message.reset(reply_message); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 return NULL; | 778 return NULL; |
779 } | 779 } |
780 | 780 |
781 void AutomationProvider::SaveAsAsync(int tab_handle) { | 781 void AutomationProvider::SaveAsAsync(int tab_handle) { |
782 NavigationController* tab = NULL; | 782 NavigationController* tab = NULL; |
783 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 783 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
784 if (web_contents) | 784 if (web_contents) |
785 web_contents->OnSavePage(); | 785 web_contents->OnSavePage(); |
786 } | 786 } |
OLD | NEW |