| 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 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; | 116 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; |
| 117 | 117 |
| 118 void SetDefaultProperties(); | 118 void SetDefaultProperties(); |
| 119 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, | 119 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, |
| 120 const DictionaryValueCallback& callback) const; | 120 const DictionaryValueCallback& callback) const; |
| 121 | 121 |
| 122 // Posts a task to run a void callback with status code |status|. | 122 // Posts a task to run a void callback with status code |status|. |
| 123 void PostVoidCallback(const VoidDBusMethodCallback& callback, | 123 void PostVoidCallback(const VoidDBusMethodCallback& callback, |
| 124 DBusMethodCallStatus status); | 124 DBusMethodCallStatus status); |
| 125 | 125 |
| 126 void SetPropertyInternal(const dbus::ObjectPath& device_path, |
| 127 const std::string& name, |
| 128 const base::Value& value, |
| 129 const base::Closure& callback, |
| 130 const ErrorCallback& error_callback); |
| 131 |
| 126 void NotifyObserversPropertyChanged(const dbus::ObjectPath& device_path, | 132 void NotifyObserversPropertyChanged(const dbus::ObjectPath& device_path, |
| 127 const std::string& property); | 133 const std::string& property); |
| 128 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); | 134 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); |
| 129 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); | 135 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); |
| 130 | 136 |
| 131 // Dictionary of <device_name, Dictionary>. | 137 // Dictionary of <device_name, Dictionary>. |
| 132 base::DictionaryValue stub_devices_; | 138 base::DictionaryValue stub_devices_; |
| 133 // Observer list for each device. | 139 // Observer list for each device. |
| 134 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; | 140 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; |
| 135 | 141 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 150 // Note: This should remain the last member so it'll be destroyed and | 156 // Note: This should remain the last member so it'll be destroyed and |
| 151 // invalidate its weak pointers before any other members are destroyed. | 157 // invalidate its weak pointers before any other members are destroyed. |
| 152 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; | 158 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; |
| 153 | 159 |
| 154 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); | 160 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); |
| 155 }; | 161 }; |
| 156 | 162 |
| 157 } // namespace chromeos | 163 } // namespace chromeos |
| 158 | 164 |
| 159 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 165 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
| OLD | NEW |