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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 RenderViewHost* view = GetViewForTab(tab_handle); | 757 RenderViewHost* view = GetViewForTab(tab_handle); |
758 if (!view) { | 758 if (!view) { |
759 NOTREACHED(); | 759 NOTREACHED(); |
760 return; | 760 return; |
761 } | 761 } |
762 | 762 |
763 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( | 763 view->Send(new ChromeViewMsg_JavaScriptStressTestControl( |
764 view->GetRoutingID(), cmd, param)); | 764 view->GetRoutingID(), cmd, param)); |
765 } | 765 } |
766 | 766 |
767 void AutomationProvider::BeginTracing(const std::string& categories, | 767 void AutomationProvider::BeginTracing(const std::string& tag_patterns, |
768 bool* success) { | 768 bool* success) { |
769 tracing_data_.trace_output.clear(); | 769 tracing_data_.trace_output.clear(); |
770 *success = TraceController::GetInstance()->BeginTracing(this, categories); | 770 *success = TraceController::GetInstance()->BeginTracing(this, tag_patterns); |
771 } | 771 } |
772 | 772 |
773 void AutomationProvider::EndTracing(IPC::Message* reply_message) { | 773 void AutomationProvider::EndTracing(IPC::Message* reply_message) { |
774 bool success = false; | 774 bool success = false; |
775 if (!tracing_data_.reply_message.get()) | 775 if (!tracing_data_.reply_message.get()) |
776 success = TraceController::GetInstance()->EndTracingAsync(this); | 776 success = TraceController::GetInstance()->EndTracingAsync(this); |
777 if (success) { | 777 if (success) { |
778 // Defer EndTracing reply until TraceController calls us back with all the | 778 // Defer EndTracing reply until TraceController calls us back with all the |
779 // events. | 779 // events. |
780 tracing_data_.reply_message.reset(reply_message); | 780 tracing_data_.reply_message.reset(reply_message); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 819 |
820 return NULL; | 820 return NULL; |
821 } | 821 } |
822 | 822 |
823 void AutomationProvider::SaveAsAsync(int tab_handle) { | 823 void AutomationProvider::SaveAsAsync(int tab_handle) { |
824 NavigationController* tab = NULL; | 824 NavigationController* tab = NULL; |
825 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 825 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
826 if (web_contents) | 826 if (web_contents) |
827 web_contents->OnSavePage(); | 827 web_contents->OnSavePage(); |
828 } | 828 } |
OLD | NEW |