| 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 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; | 2327 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; |
| 2328 handler_map["SignoutInScreenLocker"] = | 2328 handler_map["SignoutInScreenLocker"] = |
| 2329 &TestingAutomationProvider::SignoutInScreenLocker; | 2329 &TestingAutomationProvider::SignoutInScreenLocker; |
| 2330 | 2330 |
| 2331 handler_map["GetBatteryInfo"] = &TestingAutomationProvider::GetBatteryInfo; | 2331 handler_map["GetBatteryInfo"] = &TestingAutomationProvider::GetBatteryInfo; |
| 2332 | 2332 |
| 2333 handler_map["GetNetworkInfo"] = &TestingAutomationProvider::GetNetworkInfo; | 2333 handler_map["GetNetworkInfo"] = &TestingAutomationProvider::GetNetworkInfo; |
| 2334 handler_map["NetworkScan"] = &TestingAutomationProvider::NetworkScan; | 2334 handler_map["NetworkScan"] = &TestingAutomationProvider::NetworkScan; |
| 2335 handler_map["ToggleNetworkDevice"] = | 2335 handler_map["ToggleNetworkDevice"] = |
| 2336 &TestingAutomationProvider::ToggleNetworkDevice; | 2336 &TestingAutomationProvider::ToggleNetworkDevice; |
| 2337 handler_map["GetProxySettings"] = | |
| 2338 &TestingAutomationProvider::GetProxySettings; | |
| 2339 handler_map["SetProxySettings"] = | |
| 2340 &TestingAutomationProvider::SetProxySettings; | |
| 2341 handler_map["ConnectToCellularNetwork"] = | 2337 handler_map["ConnectToCellularNetwork"] = |
| 2342 &TestingAutomationProvider::ConnectToCellularNetwork; | 2338 &TestingAutomationProvider::ConnectToCellularNetwork; |
| 2343 handler_map["DisconnectFromCellularNetwork"] = | 2339 handler_map["DisconnectFromCellularNetwork"] = |
| 2344 &TestingAutomationProvider::DisconnectFromCellularNetwork; | 2340 &TestingAutomationProvider::DisconnectFromCellularNetwork; |
| 2345 handler_map["ConnectToWifiNetwork"] = | 2341 handler_map["ConnectToWifiNetwork"] = |
| 2346 &TestingAutomationProvider::ConnectToWifiNetwork; | 2342 &TestingAutomationProvider::ConnectToWifiNetwork; |
| 2347 handler_map["ConnectToHiddenWifiNetwork"] = | 2343 handler_map["ConnectToHiddenWifiNetwork"] = |
| 2348 &TestingAutomationProvider::ConnectToHiddenWifiNetwork; | 2344 &TestingAutomationProvider::ConnectToHiddenWifiNetwork; |
| 2349 handler_map["DisconnectFromWifiNetwork"] = | 2345 handler_map["DisconnectFromWifiNetwork"] = |
| 2350 &TestingAutomationProvider::DisconnectFromWifiNetwork; | 2346 &TestingAutomationProvider::DisconnectFromWifiNetwork; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2539 browser_handler_map["SetNTPMenuMode"] = | 2535 browser_handler_map["SetNTPMenuMode"] = |
| 2540 &TestingAutomationProvider::SetNTPMenuMode; | 2536 &TestingAutomationProvider::SetNTPMenuMode; |
| 2541 | 2537 |
| 2542 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; | 2538 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; |
| 2543 browser_handler_map["SetAppLaunchType"] = | 2539 browser_handler_map["SetAppLaunchType"] = |
| 2544 &TestingAutomationProvider::SetAppLaunchType; | 2540 &TestingAutomationProvider::SetAppLaunchType; |
| 2545 #if defined(OS_CHROMEOS) | 2541 #if defined(OS_CHROMEOS) |
| 2546 browser_handler_map["CaptureProfilePhoto"] = | 2542 browser_handler_map["CaptureProfilePhoto"] = |
| 2547 &TestingAutomationProvider::CaptureProfilePhoto; | 2543 &TestingAutomationProvider::CaptureProfilePhoto; |
| 2548 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; | 2544 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; |
| 2545 browser_handler_map["GetProxySettings"] = |
| 2546 &TestingAutomationProvider::GetProxySettings; |
| 2547 browser_handler_map["SetProxySettings"] = |
| 2548 &TestingAutomationProvider::SetProxySettings; |
| 2549 #endif // defined(OS_CHROMEOS) | 2549 #endif // defined(OS_CHROMEOS) |
| 2550 | 2550 |
| 2551 // Look for command in handlers that take a Browser handle. | 2551 // Look for command in handlers that take a Browser handle. |
| 2552 if (browser_handler_map.find(std::string(command)) != | 2552 if (browser_handler_map.find(std::string(command)) != |
| 2553 browser_handler_map.end()) { | 2553 browser_handler_map.end()) { |
| 2554 Browser* browser = NULL; | 2554 Browser* browser = NULL; |
| 2555 // Get Browser object associated with handle. | 2555 // Get Browser object associated with handle. |
| 2556 if (!browser_tracker_->ContainsHandle(handle) || | 2556 if (!browser_tracker_->ContainsHandle(handle) || |
| 2557 !(browser = browser_tracker_->GetResource(handle))) { | 2557 !(browser = browser_tracker_->GetResource(handle))) { |
| 2558 // Browser not found; attempt to fallback to non-Browser handlers. | 2558 // Browser not found; attempt to fallback to non-Browser handlers. |
| (...skipping 3968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6527 | 6527 |
| 6528 Send(reply_message_); | 6528 Send(reply_message_); |
| 6529 redirect_query_ = 0; | 6529 redirect_query_ = 0; |
| 6530 reply_message_ = NULL; | 6530 reply_message_ = NULL; |
| 6531 } | 6531 } |
| 6532 | 6532 |
| 6533 void TestingAutomationProvider::OnRemoveProvider() { | 6533 void TestingAutomationProvider::OnRemoveProvider() { |
| 6534 if (g_browser_process) | 6534 if (g_browser_process) |
| 6535 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6535 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6536 } | 6536 } |
| OLD | NEW |