| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 reply.SendError("Invalid or missing args."); | 1060 reply.SendError("Invalid or missing args."); |
| 1061 return; | 1061 return; |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 // Connect to a remembered VPN by its service_path. Valid service_paths | 1064 // Connect to a remembered VPN by its service_path. Valid service_paths |
| 1065 // can be found in the dictionary returned by GetPrivateNetworkInfo. | 1065 // can be found in the dictionary returned by GetPrivateNetworkInfo. |
| 1066 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); | 1066 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); |
| 1067 chromeos::VirtualNetwork* network = | 1067 chromeos::VirtualNetwork* network = |
| 1068 network_library->FindVirtualNetworkByPath(service_path); | 1068 network_library->FindVirtualNetworkByPath(service_path); |
| 1069 if (!network) { | 1069 if (!network) { |
| 1070 reply.SendError(StringPrintf("No virtual network found: %s", | 1070 reply.SendError(base::StringPrintf("No virtual network found: %s", |
| 1071 service_path.c_str())); | 1071 service_path.c_str())); |
| 1072 return; | 1072 return; |
| 1073 } | 1073 } |
| 1074 if (network->NeedMoreInfoToConnect()) { | 1074 if (network->NeedMoreInfoToConnect()) { |
| 1075 reply.SendError("Virtual network is missing info required to connect."); | 1075 reply.SendError("Virtual network is missing info required to connect."); |
| 1076 return; | 1076 return; |
| 1077 }; | 1077 }; |
| 1078 | 1078 |
| 1079 // Set up an observer (it will delete itself). | 1079 // Set up an observer (it will delete itself). |
| 1080 new VirtualConnectObserver(this, reply_message, network->name()); | 1080 new VirtualConnectObserver(this, reply_message, network->name()); |
| 1081 network_library->ConnectToVirtualNetwork(network); | 1081 network_library->ConnectToVirtualNetwork(network); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1337 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1338 AddObserver(power_manager_observer_); | 1338 AddObserver(power_manager_observer_); |
| 1339 } | 1339 } |
| 1340 | 1340 |
| 1341 void TestingAutomationProvider::RemoveChromeosObservers() { | 1341 void TestingAutomationProvider::RemoveChromeosObservers() { |
| 1342 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1342 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1343 RemoveObserver(power_manager_observer_); | 1343 RemoveObserver(power_manager_observer_); |
| 1344 delete power_manager_observer_; | 1344 delete power_manager_observer_; |
| 1345 power_manager_observer_ = NULL; | 1345 power_manager_observer_ = NULL; |
| 1346 } | 1346 } |
| OLD | NEW |