| 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 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; | 2265 handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; |
| 2266 handler_map["SetTimezone"] = &TestingAutomationProvider::SetTimezone; | 2266 handler_map["SetTimezone"] = &TestingAutomationProvider::SetTimezone; |
| 2267 | 2267 |
| 2268 handler_map["GetUpdateInfo"] = &TestingAutomationProvider::GetUpdateInfo; | 2268 handler_map["GetUpdateInfo"] = &TestingAutomationProvider::GetUpdateInfo; |
| 2269 handler_map["UpdateCheck"] = &TestingAutomationProvider::UpdateCheck; | 2269 handler_map["UpdateCheck"] = &TestingAutomationProvider::UpdateCheck; |
| 2270 handler_map["SetReleaseTrack"] = &TestingAutomationProvider::SetReleaseTrack; | 2270 handler_map["SetReleaseTrack"] = &TestingAutomationProvider::SetReleaseTrack; |
| 2271 | 2271 |
| 2272 handler_map["GetVolumeInfo"] = &TestingAutomationProvider::GetVolumeInfo; | 2272 handler_map["GetVolumeInfo"] = &TestingAutomationProvider::GetVolumeInfo; |
| 2273 handler_map["SetVolume"] = &TestingAutomationProvider::SetVolume; | 2273 handler_map["SetVolume"] = &TestingAutomationProvider::SetVolume; |
| 2274 handler_map["SetMute"] = &TestingAutomationProvider::SetMute; | 2274 handler_map["SetMute"] = &TestingAutomationProvider::SetMute; |
| 2275 |
| 2275 #endif // defined(OS_CHROMEOS) | 2276 #endif // defined(OS_CHROMEOS) |
| 2276 | 2277 |
| 2277 std::map<std::string, BrowserJsonHandler> browser_handler_map; | 2278 std::map<std::string, BrowserJsonHandler> browser_handler_map; |
| 2278 browser_handler_map["DisablePlugin"] = | 2279 browser_handler_map["DisablePlugin"] = |
| 2279 &TestingAutomationProvider::DisablePlugin; | 2280 &TestingAutomationProvider::DisablePlugin; |
| 2280 browser_handler_map["EnablePlugin"] = | 2281 browser_handler_map["EnablePlugin"] = |
| 2281 &TestingAutomationProvider::EnablePlugin; | 2282 &TestingAutomationProvider::EnablePlugin; |
| 2282 browser_handler_map["GetPluginsInfo"] = | 2283 browser_handler_map["GetPluginsInfo"] = |
| 2283 &TestingAutomationProvider::GetPluginsInfo; | 2284 &TestingAutomationProvider::GetPluginsInfo; |
| 2284 | 2285 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 &TestingAutomationProvider::SetNTPThumbnailMode; | 2430 &TestingAutomationProvider::SetNTPThumbnailMode; |
| 2430 browser_handler_map["GetNTPMenuMode"] = | 2431 browser_handler_map["GetNTPMenuMode"] = |
| 2431 &TestingAutomationProvider::GetNTPMenuMode; | 2432 &TestingAutomationProvider::GetNTPMenuMode; |
| 2432 browser_handler_map["SetNTPMenuMode"] = | 2433 browser_handler_map["SetNTPMenuMode"] = |
| 2433 &TestingAutomationProvider::SetNTPMenuMode; | 2434 &TestingAutomationProvider::SetNTPMenuMode; |
| 2434 | 2435 |
| 2435 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; | 2436 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; |
| 2436 browser_handler_map["SetAppLaunchType"] = | 2437 browser_handler_map["SetAppLaunchType"] = |
| 2437 &TestingAutomationProvider::SetAppLaunchType; | 2438 &TestingAutomationProvider::SetAppLaunchType; |
| 2438 #if defined(OS_CHROMEOS) | 2439 #if defined(OS_CHROMEOS) |
| 2440 browser_handler_map["CaptureProfilePhoto"] = |
| 2441 &TestingAutomationProvider::CaptureProfilePhoto; |
| 2439 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; | 2442 browser_handler_map["GetTimeInfo"] = &TestingAutomationProvider::GetTimeInfo; |
| 2440 #endif // defined(OS_CHROMEOS) | 2443 #endif // defined(OS_CHROMEOS) |
| 2441 | 2444 |
| 2442 // Look for command in handlers that take a Browser handle. | 2445 // Look for command in handlers that take a Browser handle. |
| 2443 if (browser_handler_map.find(std::string(command)) != | 2446 if (browser_handler_map.find(std::string(command)) != |
| 2444 browser_handler_map.end()) { | 2447 browser_handler_map.end()) { |
| 2445 Browser* browser = NULL; | 2448 Browser* browser = NULL; |
| 2446 // Get Browser object associated with handle. | 2449 // Get Browser object associated with handle. |
| 2447 if (!browser_tracker_->ContainsHandle(handle) || | 2450 if (!browser_tracker_->ContainsHandle(handle) || |
| 2448 !(browser = browser_tracker_->GetResource(handle))) { | 2451 !(browser = browser_tracker_->GetResource(handle))) { |
| (...skipping 3708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6157 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6160 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 6158 | 6161 |
| 6159 Send(reply_message_); | 6162 Send(reply_message_); |
| 6160 redirect_query_ = 0; | 6163 redirect_query_ = 0; |
| 6161 reply_message_ = NULL; | 6164 reply_message_ = NULL; |
| 6162 } | 6165 } |
| 6163 | 6166 |
| 6164 void TestingAutomationProvider::OnRemoveProvider() { | 6167 void TestingAutomationProvider::OnRemoveProvider() { |
| 6165 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6168 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 6166 } | 6169 } |
| OLD | NEW |