| 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 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2335 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; | 2335 handler_map["UnlockScreen"] = &TestingAutomationProvider::UnlockScreen; |
| 2336 handler_map["SignoutInScreenLocker"] = | 2336 handler_map["SignoutInScreenLocker"] = |
| 2337 &TestingAutomationProvider::SignoutInScreenLocker; | 2337 &TestingAutomationProvider::SignoutInScreenLocker; |
| 2338 | 2338 |
| 2339 handler_map["GetBatteryInfo"] = &TestingAutomationProvider::GetBatteryInfo; | 2339 handler_map["GetBatteryInfo"] = &TestingAutomationProvider::GetBatteryInfo; |
| 2340 | 2340 |
| 2341 handler_map["GetNetworkInfo"] = &TestingAutomationProvider::GetNetworkInfo; | 2341 handler_map["GetNetworkInfo"] = &TestingAutomationProvider::GetNetworkInfo; |
| 2342 handler_map["NetworkScan"] = &TestingAutomationProvider::NetworkScan; | 2342 handler_map["NetworkScan"] = &TestingAutomationProvider::NetworkScan; |
| 2343 handler_map["ToggleNetworkDevice"] = | 2343 handler_map["ToggleNetworkDevice"] = |
| 2344 &TestingAutomationProvider::ToggleNetworkDevice; | 2344 &TestingAutomationProvider::ToggleNetworkDevice; |
| 2345 handler_map["GetProxySettings"] = | |
| 2346 &TestingAutomationProvider::GetProxySettings; | |
| 2347 handler_map["SetProxySettings"] = | |
| 2348 &TestingAutomationProvider::SetProxySettings; | |
| 2349 handler_map["ConnectToCellularNetwork"] = | 2345 handler_map["ConnectToCellularNetwork"] = |
| 2350 &TestingAutomationProvider::ConnectToCellularNetwork; | 2346 &TestingAutomationProvider::ConnectToCellularNetwork; |
| 2351 handler_map["DisconnectFromCellularNetwork"] = | 2347 handler_map["DisconnectFromCellularNetwork"] = |
| 2352 &TestingAutomationProvider::DisconnectFromCellularNetwork; | 2348 &TestingAutomationProvider::DisconnectFromCellularNetwork; |
| 2353 handler_map["ConnectToWifiNetwork"] = | 2349 handler_map["ConnectToWifiNetwork"] = |
| 2354 &TestingAutomationProvider::ConnectToWifiNetwork; | 2350 &TestingAutomationProvider::ConnectToWifiNetwork; |
| 2355 handler_map["ConnectToHiddenWifiNetwork"] = | 2351 handler_map["ConnectToHiddenWifiNetwork"] = |
| 2356 &TestingAutomationProvider::ConnectToHiddenWifiNetwork; | 2352 &TestingAutomationProvider::ConnectToHiddenWifiNetwork; |
| 2357 handler_map["DisconnectFromWifiNetwork"] = | 2353 handler_map["DisconnectFromWifiNetwork"] = |
| 2358 &TestingAutomationProvider::DisconnectFromWifiNetwork; | 2354 &TestingAutomationProvider::DisconnectFromWifiNetwork; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 browser_handler_map["SetNTPMenuMode"] = | 2543 browser_handler_map["SetNTPMenuMode"] = |
| 2548 &TestingAutomationProvider::SetNTPMenuMode; | 2544 &TestingAutomationProvider::SetNTPMenuMode; |
| 2549 | 2545 |
| 2550 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; | 2546 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; |
| 2551 browser_handler_map["SetAppLaunchType"] = | 2547 browser_handler_map["SetAppLaunchType"] = |
| 2552 &TestingAutomationProvider::SetAppLaunchType; | 2548 &TestingAutomationProvider::SetAppLaunchType; |
| 2553 #if defined(OS_CHROMEOS) | 2549 #if defined(OS_CHROMEOS) |
| 2554 browser_handler_map["CaptureProfilePhoto"] = | 2550 browser_handler_map["CaptureProfilePhoto"] = |
| 2555 &TestingAutomationProvider::CaptureProfilePhoto; | 2551 &TestingAutomationProvider::CaptureProfilePhoto; |
| 2556 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; | 2552 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; |
| 2553 browser_handler_map["GetProxySettings"] = |
| 2554 &TestingAutomationProvider::GetProxySettings; |
| 2555 browser_handler_map["SetProxySettings"] = |
| 2556 &TestingAutomationProvider::SetProxySettings; |
| 2557 #endif // defined(OS_CHROMEOS) | 2557 #endif // defined(OS_CHROMEOS) |
| 2558 | 2558 |
| 2559 // Look for command in handlers that take a Browser handle. | 2559 // Look for command in handlers that take a Browser handle. |
| 2560 if (browser_handler_map.find(std::string(command)) != | 2560 if (browser_handler_map.find(std::string(command)) != |
| 2561 browser_handler_map.end()) { | 2561 browser_handler_map.end()) { |
| 2562 Browser* browser = NULL; | 2562 Browser* browser = NULL; |
| 2563 // Get Browser object associated with handle. | 2563 // Get Browser object associated with handle. |
| 2564 if (!browser_tracker_->ContainsHandle(handle) || | 2564 if (!browser_tracker_->ContainsHandle(handle) || |
| 2565 !(browser = browser_tracker_->GetResource(handle))) { | 2565 !(browser = browser_tracker_->GetResource(handle))) { |
| 2566 // Browser not found; attempt to fallback to non-Browser handlers. | 2566 // Browser not found; attempt to fallback to non-Browser handlers. |
| (...skipping 3968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6535 | 6535 |
| 6536 Send(reply_message_); | 6536 Send(reply_message_); |
| 6537 redirect_query_ = 0; | 6537 redirect_query_ = 0; |
| 6538 reply_message_ = NULL; | 6538 reply_message_ = NULL; |
| 6539 } | 6539 } |
| 6540 | 6540 |
| 6541 void TestingAutomationProvider::OnRemoveProvider() { | 6541 void TestingAutomationProvider::OnRemoveProvider() { |
| 6542 if (g_browser_process) | 6542 if (g_browser_process) |
| 6543 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6543 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6544 } | 6544 } |
| OLD | NEW |