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/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/values.h" | 10 #include "base/values.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 void ShillManagerClientStub::ConfigureService( | 207 void ShillManagerClientStub::ConfigureService( |
208 const base::DictionaryValue& properties, | 208 const base::DictionaryValue& properties, |
209 const ObjectPathCallback& callback, | 209 const ObjectPathCallback& callback, |
210 const ErrorCallback& error_callback) { | 210 const ErrorCallback& error_callback) { |
211 ShillServiceClient::TestInterface* service_client = | 211 ShillServiceClient::TestInterface* service_client = |
212 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); | 212 DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); |
213 | 213 |
214 std::string guid; | 214 std::string guid; |
215 std::string type; | 215 std::string type; |
216 if (!properties.GetString(flimflam::kGuidProperty, &guid) || | 216 if (!properties.GetString(flimflam::kTypeProperty, &type)) { |
217 !properties.GetString(flimflam::kTypeProperty, &type)) { | 217 LOG(ERROR) << "ConfigureService requires Type to be defined"; |
218 LOG(ERROR) << "ConfigureService requies GUID and Type to be defined"; | |
219 // If the properties aren't filled out completely, then just return an empty | 218 // If the properties aren't filled out completely, then just return an empty |
220 // object path. | 219 // object path. |
221 base::MessageLoop::current()->PostTask( | 220 base::MessageLoop::current()->PostTask( |
222 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); | 221 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); |
223 return; | 222 return; |
224 } | 223 } |
225 | 224 |
226 // For the purposes of this stub, we're going to assume that the GUID property | 225 // For the purposes of this stub, we're going to assume that the GUID property |
227 // is set to the service path because we don't want to re-implement Shill's | 226 // is set to the service path because we don't want to re-implement Shill's |
228 // property matching magic here. | 227 // property matching magic here. |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 flimflam::kScanningProperty, | 641 flimflam::kScanningProperty, |
643 base::FundamentalValue(false)); | 642 base::FundamentalValue(false)); |
644 } | 643 } |
645 CallNotifyObserversPropertyChanged(flimflam::kServicesProperty, 0); | 644 CallNotifyObserversPropertyChanged(flimflam::kServicesProperty, 0); |
646 CallNotifyObserversPropertyChanged(flimflam::kServiceWatchListProperty, | 645 CallNotifyObserversPropertyChanged(flimflam::kServiceWatchListProperty, |
647 0); | 646 0); |
648 base::MessageLoop::current()->PostTask(FROM_HERE, callback); | 647 base::MessageLoop::current()->PostTask(FROM_HERE, callback); |
649 } | 648 } |
650 | 649 |
651 } // namespace chromeos | 650 } // namespace chromeos |
OLD | NEW |