| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chromeos/dbus/fake_shill_manager_client.h" | 5 #include "chromeos/dbus/fake_shill_manager_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 std::string ipconfig_path; | 244 std::string ipconfig_path; |
| 245 properties.GetString(shill::kIPConfigProperty, &ipconfig_path); | 245 properties.GetString(shill::kIPConfigProperty, &ipconfig_path); |
| 246 | 246 |
| 247 // Merge the new properties with existing properties, if any. | 247 // Merge the new properties with existing properties, if any. |
| 248 const base::DictionaryValue* existing_properties = | 248 const base::DictionaryValue* existing_properties = |
| 249 service_client->GetServiceProperties(service_path); | 249 service_client->GetServiceProperties(service_path); |
| 250 if (!existing_properties) { | 250 if (!existing_properties) { |
| 251 // Add a new service to the service client stub because none exists, yet. | 251 // Add a new service to the service client stub because none exists, yet. |
| 252 // This calls AddManagerService. | 252 // This calls AddManagerService. |
| 253 service_client->AddServiceWithIPConfig(service_path, guid, type, | 253 service_client->AddServiceWithIPConfig(service_path, |
| 254 guid /* guid */, |
| 255 guid /* name */, |
| 256 type, |
| 254 shill::kStateIdle, ipconfig_path, | 257 shill::kStateIdle, ipconfig_path, |
| 255 true /* visible */, | 258 true /* visible */, |
| 256 true /* watch */); | 259 true /* watch */); |
| 257 existing_properties = service_client->GetServiceProperties(service_path); | 260 existing_properties = service_client->GetServiceProperties(service_path); |
| 258 } | 261 } |
| 259 | 262 |
| 260 scoped_ptr<base::DictionaryValue> merged_properties( | 263 scoped_ptr<base::DictionaryValue> merged_properties( |
| 261 existing_properties->DeepCopy()); | 264 existing_properties->DeepCopy()); |
| 262 merged_properties->MergeDictionary(&properties); | 265 merged_properties->MergeDictionary(&properties); |
| 263 | 266 |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 *enabled = true; | 1031 *enabled = true; |
| 1029 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1032 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
| 1030 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1033 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
| 1031 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1034 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
| 1032 return shill::kStateIdle; | 1035 return shill::kStateIdle; |
| 1033 } | 1036 } |
| 1034 return state; | 1037 return state; |
| 1035 } | 1038 } |
| 1036 | 1039 |
| 1037 } // namespace chromeos | 1040 } // namespace chromeos |
| OLD | NEW |