OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 handler_map["AcceptOrDismissAppModalDialog"] = | 2249 handler_map["AcceptOrDismissAppModalDialog"] = |
2250 &TestingAutomationProvider::AcceptOrDismissAppModalDialog; | 2250 &TestingAutomationProvider::AcceptOrDismissAppModalDialog; |
2251 handler_map["GetChromeDriverAutomationVersion"] = | 2251 handler_map["GetChromeDriverAutomationVersion"] = |
2252 &TestingAutomationProvider::GetChromeDriverAutomationVersion; | 2252 &TestingAutomationProvider::GetChromeDriverAutomationVersion; |
2253 handler_map["UpdateExtensionsNow"] = | 2253 handler_map["UpdateExtensionsNow"] = |
2254 &TestingAutomationProvider::UpdateExtensionsNow; | 2254 &TestingAutomationProvider::UpdateExtensionsNow; |
2255 handler_map["CreateNewAutomationProvider"] = | 2255 handler_map["CreateNewAutomationProvider"] = |
2256 &TestingAutomationProvider::CreateNewAutomationProvider; | 2256 &TestingAutomationProvider::CreateNewAutomationProvider; |
2257 handler_map["GetBrowserInfo"] = | 2257 handler_map["GetBrowserInfo"] = |
2258 &TestingAutomationProvider::GetBrowserInfo; | 2258 &TestingAutomationProvider::GetBrowserInfo; |
| 2259 handler_map["GetProcessInfo"] = |
| 2260 &TestingAutomationProvider::GetProcessInfo; |
2259 #if defined(OS_CHROMEOS) | 2261 #if defined(OS_CHROMEOS) |
2260 handler_map["GetLoginInfo"] = &TestingAutomationProvider::GetLoginInfo; | 2262 handler_map["GetLoginInfo"] = &TestingAutomationProvider::GetLoginInfo; |
2261 handler_map["ShowCreateAccountUI"] = | 2263 handler_map["ShowCreateAccountUI"] = |
2262 &TestingAutomationProvider::ShowCreateAccountUI; | 2264 &TestingAutomationProvider::ShowCreateAccountUI; |
2263 handler_map["LoginAsGuest"] = &TestingAutomationProvider::LoginAsGuest; | 2265 handler_map["LoginAsGuest"] = &TestingAutomationProvider::LoginAsGuest; |
2264 handler_map["Login"] = &TestingAutomationProvider::Login; | 2266 handler_map["Login"] = &TestingAutomationProvider::Login; |
2265 | 2267 |
2266 handler_map["LockScreen"] = &TestingAutomationProvider::LockScreen; | 2268 handler_map["LockScreen"] = &TestingAutomationProvider::LockScreen; |
2267 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; | 2269 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; |
2268 handler_map["SignoutInScreenLocker"] = | 2270 handler_map["SignoutInScreenLocker"] = |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 item->SetString("view_type", type); | 2869 item->SetString("view_type", type); |
2868 item->SetString("url", ex_host->GetURL().spec()); | 2870 item->SetString("url", ex_host->GetURL().spec()); |
2869 item->SetBoolean("loaded", ex_host->did_stop_loading()); | 2871 item->SetBoolean("loaded", ex_host->did_stop_loading()); |
2870 extension_views->Append(item); | 2872 extension_views->Append(item); |
2871 } | 2873 } |
2872 } | 2874 } |
2873 return_value->Set("extension_views", extension_views); | 2875 return_value->Set("extension_views", extension_views); |
2874 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); | 2876 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
2875 } | 2877 } |
2876 | 2878 |
| 2879 // Sample json input: { "command": "GetProcessInfo" } |
| 2880 // Refer to GetProcessInfo() in chrome/test/pyautolib/pyauto.py for |
| 2881 // sample json output. |
| 2882 void TestingAutomationProvider::GetProcessInfo( |
| 2883 DictionaryValue* args, |
| 2884 IPC::Message* reply_message) { |
| 2885 scoped_refptr<ProcessInfoObserver> |
| 2886 proc_observer(new ProcessInfoObserver(this, reply_message)); |
| 2887 proc_observer->StartFetch(); |
| 2888 } |
| 2889 |
2877 // Sample json input: { "command": "GetNavigationInfo" } | 2890 // Sample json input: { "command": "GetNavigationInfo" } |
2878 // Refer to GetNavigationInfo() in chrome/test/pyautolib/pyauto.py for | 2891 // Refer to GetNavigationInfo() in chrome/test/pyautolib/pyauto.py for |
2879 // sample json output. | 2892 // sample json output. |
2880 void TestingAutomationProvider::GetNavigationInfo( | 2893 void TestingAutomationProvider::GetNavigationInfo( |
2881 Browser* browser, | 2894 Browser* browser, |
2882 DictionaryValue* args, | 2895 DictionaryValue* args, |
2883 IPC::Message* reply_message) { | 2896 IPC::Message* reply_message) { |
2884 AutomationJSONReply reply(this, reply_message); | 2897 AutomationJSONReply reply(this, reply_message); |
2885 int tab_index; | 2898 int tab_index; |
2886 TabContents* tab_contents = NULL; | 2899 TabContents* tab_contents = NULL; |
(...skipping 3460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6347 | 6360 |
6348 Send(reply_message_); | 6361 Send(reply_message_); |
6349 redirect_query_ = 0; | 6362 redirect_query_ = 0; |
6350 reply_message_ = NULL; | 6363 reply_message_ = NULL; |
6351 } | 6364 } |
6352 | 6365 |
6353 void TestingAutomationProvider::OnRemoveProvider() { | 6366 void TestingAutomationProvider::OnRemoveProvider() { |
6354 if (g_browser_process) | 6367 if (g_browser_process) |
6355 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6368 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6356 } | 6369 } |
OLD | NEW |