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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 RenderViewHost* view = GetViewForTab(tab_handle); | 760 RenderViewHost* view = GetViewForTab(tab_handle); |
761 if (!view) { | 761 if (!view) { |
762 NOTREACHED(); | 762 NOTREACHED(); |
763 return; | 763 return; |
764 } | 764 } |
765 | 765 |
766 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( | 766 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( |
767 view->GetRoutingID(), cmd, param)); | 767 view->GetRoutingID(), cmd, param)); |
768 } | 768 } |
769 | 769 |
770 void AutomationProvider::BeginTracing(const std::string& categories, | 770 void AutomationProvider::BeginTracing(const std::string& category_patterns, |
771 bool* success) { | 771 bool* success) { |
772 tracing_data_.trace_output.clear(); | 772 tracing_data_.trace_output.clear(); |
773 *success = TraceController::GetInstance()->BeginTracing( | 773 *success = TraceController::GetInstance()->BeginTracing( |
774 this, | 774 this, |
775 categories, | 775 category_patterns, |
776 base::debug::TraceLog::RECORD_UNTIL_FULL); | 776 base::debug::TraceLog::RECORD_UNTIL_FULL); |
777 } | 777 } |
778 | 778 |
779 void AutomationProvider::EndTracing(IPC::Message* reply_message) { | 779 void AutomationProvider::EndTracing(IPC::Message* reply_message) { |
780 bool success = false; | 780 bool success = false; |
781 if (!tracing_data_.reply_message.get()) | 781 if (!tracing_data_.reply_message.get()) |
782 success = TraceController::GetInstance()->EndTracingAsync(this); | 782 success = TraceController::GetInstance()->EndTracingAsync(this); |
783 if (success) { | 783 if (success) { |
784 // Defer EndTracing reply until TraceController calls us back with all the | 784 // Defer EndTracing reply until TraceController calls us back with all the |
785 // events. | 785 // events. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 | 825 |
826 return NULL; | 826 return NULL; |
827 } | 827 } |
828 | 828 |
829 void AutomationProvider::SaveAsAsync(int tab_handle) { | 829 void AutomationProvider::SaveAsAsync(int tab_handle) { |
830 NavigationController* tab = NULL; | 830 NavigationController* tab = NULL; |
831 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 831 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
832 if (web_contents) | 832 if (web_contents) |
833 web_contents->OnSavePage(); | 833 web_contents->OnSavePage(); |
834 } | 834 } |
OLD | NEW |