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