| 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 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 handler_map["EnrollEnterpriseDevice"] = | 2260 handler_map["EnrollEnterpriseDevice"] = |
| 2261 &TestingAutomationProvider::EnrollEnterpriseDevice; | 2261 &TestingAutomationProvider::EnrollEnterpriseDevice; |
| 2262 | 2262 |
| 2263 handler_map["GetUpdateInfo"] = &TestingAutomationProvider::GetUpdateInfo; | 2263 handler_map["GetUpdateInfo"] = &TestingAutomationProvider::GetUpdateInfo; |
| 2264 handler_map["UpdateCheck"] = &TestingAutomationProvider::UpdateCheck; | 2264 handler_map["UpdateCheck"] = &TestingAutomationProvider::UpdateCheck; |
| 2265 handler_map["SetReleaseTrack"] = &TestingAutomationProvider::SetReleaseTrack; | 2265 handler_map["SetReleaseTrack"] = &TestingAutomationProvider::SetReleaseTrack; |
| 2266 | 2266 |
| 2267 handler_map["GetVolumeInfo"] = &TestingAutomationProvider::GetVolumeInfo; | 2267 handler_map["GetVolumeInfo"] = &TestingAutomationProvider::GetVolumeInfo; |
| 2268 handler_map["SetVolume"] = &TestingAutomationProvider::SetVolume; | 2268 handler_map["SetVolume"] = &TestingAutomationProvider::SetVolume; |
| 2269 handler_map["SetMute"] = &TestingAutomationProvider::SetMute; | 2269 handler_map["SetMute"] = &TestingAutomationProvider::SetMute; |
| 2270 |
| 2270 #endif // defined(OS_CHROMEOS) | 2271 #endif // defined(OS_CHROMEOS) |
| 2271 | 2272 |
| 2272 std::map<std::string, BrowserJsonHandler> browser_handler_map; | 2273 std::map<std::string, BrowserJsonHandler> browser_handler_map; |
| 2273 browser_handler_map["DisablePlugin"] = | 2274 browser_handler_map["DisablePlugin"] = |
| 2274 &TestingAutomationProvider::DisablePlugin; | 2275 &TestingAutomationProvider::DisablePlugin; |
| 2275 browser_handler_map["EnablePlugin"] = | 2276 browser_handler_map["EnablePlugin"] = |
| 2276 &TestingAutomationProvider::EnablePlugin; | 2277 &TestingAutomationProvider::EnablePlugin; |
| 2277 browser_handler_map["GetPluginsInfo"] = | 2278 browser_handler_map["GetPluginsInfo"] = |
| 2278 &TestingAutomationProvider::GetPluginsInfo; | 2279 &TestingAutomationProvider::GetPluginsInfo; |
| 2279 | 2280 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 &TestingAutomationProvider::SetNTPThumbnailMode; | 2425 &TestingAutomationProvider::SetNTPThumbnailMode; |
| 2425 browser_handler_map["GetNTPMenuMode"] = | 2426 browser_handler_map["GetNTPMenuMode"] = |
| 2426 &TestingAutomationProvider::GetNTPMenuMode; | 2427 &TestingAutomationProvider::GetNTPMenuMode; |
| 2427 browser_handler_map["SetNTPMenuMode"] = | 2428 browser_handler_map["SetNTPMenuMode"] = |
| 2428 &TestingAutomationProvider::SetNTPMenuMode; | 2429 &TestingAutomationProvider::SetNTPMenuMode; |
| 2429 | 2430 |
| 2430 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; | 2431 browser_handler_map["LaunchApp"] = &TestingAutomationProvider::LaunchApp; |
| 2431 browser_handler_map["SetAppLaunchType"] = | 2432 browser_handler_map["SetAppLaunchType"] = |
| 2432 &TestingAutomationProvider::SetAppLaunchType; | 2433 &TestingAutomationProvider::SetAppLaunchType; |
| 2433 | 2434 |
| 2435 #if defined(OS_CHROMEOS) |
| 2436 browser_handler_map["CaptureProfilePhoto"] = |
| 2437 &TestingAutomationProvider::CaptureProfilePhoto; |
| 2438 |
| 2439 #endif // defined(OS_CHROMEOS) |
| 2440 |
| 2434 if (handler_map.find(std::string(command)) != handler_map.end()) { | 2441 if (handler_map.find(std::string(command)) != handler_map.end()) { |
| 2435 (this->*handler_map[command])(dict_value, reply_message); | 2442 (this->*handler_map[command])(dict_value, reply_message); |
| 2436 } else if (browser_handler_map.find(std::string(command)) != | 2443 } else if (browser_handler_map.find(std::string(command)) != |
| 2437 browser_handler_map.end()) { | 2444 browser_handler_map.end()) { |
| 2438 Browser* browser = NULL; | 2445 Browser* browser = NULL; |
| 2439 if (!browser_tracker_->ContainsHandle(handle) || | 2446 if (!browser_tracker_->ContainsHandle(handle) || |
| 2440 !(browser = browser_tracker_->GetResource(handle))) { | 2447 !(browser = browser_tracker_->GetResource(handle))) { |
| 2441 AutomationJSONReply(this, reply_message).SendError("No browser object."); | 2448 AutomationJSONReply(this, reply_message).SendError("No browser object."); |
| 2442 return; | 2449 return; |
| 2443 } | 2450 } |
| (...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6140 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6147 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 6141 | 6148 |
| 6142 Send(reply_message_); | 6149 Send(reply_message_); |
| 6143 redirect_query_ = 0; | 6150 redirect_query_ = 0; |
| 6144 reply_message_ = NULL; | 6151 reply_message_ = NULL; |
| 6145 } | 6152 } |
| 6146 | 6153 |
| 6147 void TestingAutomationProvider::OnRemoveProvider() { | 6154 void TestingAutomationProvider::OnRemoveProvider() { |
| 6148 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6155 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 6149 } | 6156 } |
| OLD | NEW |