| 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_device_client.h" | 5 #include "chromeos/dbus/fake_shill_device_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 ClearDevices(); | 395 ClearDevices(); |
| 396 | 396 |
| 397 stub_devices_.Clear(); | 397 stub_devices_.Clear(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void FakeShillDeviceClient::SetDeviceProperty(const std::string& device_path, | 400 void FakeShillDeviceClient::SetDeviceProperty(const std::string& device_path, |
| 401 const std::string& name, | 401 const std::string& name, |
| 402 const base::Value& value) { | 402 const base::Value& value) { |
| 403 VLOG(1) << "SetDeviceProperty: " << device_path | 403 VLOG(1) << "SetDeviceProperty: " << device_path |
| 404 << ": " << name << " = " << value; | 404 << ": " << name << " = " << value; |
| 405 SetProperty(dbus::ObjectPath(device_path), name, value, | 405 SetPropertyInternal(dbus::ObjectPath(device_path), name, value, |
| 406 base::Bind(&base::DoNothing), | 406 base::Bind(&base::DoNothing), |
| 407 base::Bind(&ErrorFunction, device_path)); | 407 base::Bind(&ErrorFunction, device_path)); |
| 408 } | 408 } |
| 409 | 409 |
| 410 std::string FakeShillDeviceClient::GetDevicePathForType( | 410 std::string FakeShillDeviceClient::GetDevicePathForType( |
| 411 const std::string& type) { | 411 const std::string& type) { |
| 412 for (base::DictionaryValue::Iterator iter(stub_devices_); | 412 for (base::DictionaryValue::Iterator iter(stub_devices_); |
| 413 !iter.IsAtEnd(); iter.Advance()) { | 413 !iter.IsAtEnd(); iter.Advance()) { |
| 414 const base::DictionaryValue* properties = NULL; | 414 const base::DictionaryValue* properties = NULL; |
| 415 if (!iter.value().GetAsDictionary(&properties)) | 415 if (!iter.value().GetAsDictionary(&properties)) |
| 416 continue; | 416 continue; |
| 417 std::string prop_type; | 417 std::string prop_type; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 489 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
| 490 observer_list_.find(device_path); | 490 observer_list_.find(device_path); |
| 491 if (iter != observer_list_.end()) | 491 if (iter != observer_list_.end()) |
| 492 return *(iter->second); | 492 return *(iter->second); |
| 493 PropertyObserverList* observer_list = new PropertyObserverList(); | 493 PropertyObserverList* observer_list = new PropertyObserverList(); |
| 494 observer_list_[device_path] = observer_list; | 494 observer_list_[device_path] = observer_list; |
| 495 return *observer_list; | 495 return *observer_list; |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace chromeos | 498 } // namespace chromeos |
| OLD | NEW |