| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/shill_manager_client_stub.h" | 5 #include "chromeos/dbus/shill_manager_client_stub.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 std::string type; | 169 std::string type; |
| 170 if (!properties.GetString(flimflam::kGuidProperty, &guid) || | 170 if (!properties.GetString(flimflam::kGuidProperty, &guid) || |
| 171 !properties.GetString(flimflam::kTypeProperty, &type)) { | 171 !properties.GetString(flimflam::kTypeProperty, &type)) { |
| 172 // If the properties aren't filled out completely, then just return an empty | 172 // If the properties aren't filled out completely, then just return an empty |
| 173 // object path. | 173 // object path. |
| 174 MessageLoop::current()->PostTask( | 174 MessageLoop::current()->PostTask( |
| 175 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); | 175 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); |
| 176 return; | 176 return; |
| 177 } | 177 } |
| 178 | 178 |
| 179 std::string ipconfig_path; |
| 180 properties.GetString(shill::kIPConfigProperty, &ipconfig_path); |
| 181 |
| 179 // Add the service to the service client stub if not already there. | 182 // Add the service to the service client stub if not already there. |
| 180 service_client->AddService(guid, guid, type, flimflam::kStateIdle, true); | 183 service_client->AddServiceWithIPConfig(guid, guid, type, flimflam::kStateIdle, |
| 184 ipconfig_path, true); |
| 181 | 185 |
| 182 // Merge the new properties with existing properties, if any. | 186 // Merge the new properties with existing properties, if any. |
| 183 scoped_ptr<base::DictionaryValue> merged_properties; | 187 scoped_ptr<base::DictionaryValue> merged_properties; |
| 184 const base::DictionaryValue* existing_properties = | 188 const base::DictionaryValue* existing_properties = |
| 185 service_client->GetServiceProperties(guid); | 189 service_client->GetServiceProperties(guid); |
| 186 if (existing_properties) { | 190 if (existing_properties) { |
| 187 merged_properties.reset(existing_properties->DeepCopy()); | 191 merged_properties.reset(existing_properties->DeepCopy()); |
| 188 } else { | 192 } else { |
| 189 merged_properties.reset(new base::DictionaryValue); | 193 merged_properties.reset(new base::DictionaryValue); |
| 190 } | 194 } |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 std::string type; | 497 std::string type; |
| 494 properties->GetString(flimflam::kTypeProperty, &type); | 498 properties->GetString(flimflam::kTypeProperty, &type); |
| 495 if (TechnologyEnabled(type)) | 499 if (TechnologyEnabled(type)) |
| 496 new_service_list->Append((*iter)->DeepCopy()); | 500 new_service_list->Append((*iter)->DeepCopy()); |
| 497 } | 501 } |
| 498 } | 502 } |
| 499 return new_service_list; | 503 return new_service_list; |
| 500 } | 504 } |
| 501 | 505 |
| 502 } // namespace chromeos | 506 } // namespace chromeos |
| OLD | NEW |