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 #ifndef CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ |
6 #define CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ | 6 #define CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const std::string& property, | 84 const std::string& property, |
85 const base::Value& value) OVERRIDE; | 85 const base::Value& value) OVERRIDE; |
86 virtual const base::DictionaryValue* GetServiceProperties( | 86 virtual const base::DictionaryValue* GetServiceProperties( |
87 const std::string& service_path) const OVERRIDE; | 87 const std::string& service_path) const OVERRIDE; |
88 virtual void ClearServices() OVERRIDE; | 88 virtual void ClearServices() OVERRIDE; |
89 | 89 |
90 private: | 90 private: |
91 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; | 91 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; |
92 | 92 |
93 void SetDefaultProperties(); | 93 void SetDefaultProperties(); |
94 void PassStubServiceProperties(const dbus::ObjectPath& service_path, | |
95 const DictionaryValueCallback& callback); | |
96 void NotifyObserversPropertyChanged(const dbus::ObjectPath& service_path, | 94 void NotifyObserversPropertyChanged(const dbus::ObjectPath& service_path, |
97 const std::string& property); | 95 const std::string& property); |
98 base::DictionaryValue* GetModifiableServiceProperties( | 96 base::DictionaryValue* GetModifiableServiceProperties( |
99 const std::string& service_path); | 97 const std::string& service_path); |
100 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); | 98 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); |
101 | 99 |
102 base::DictionaryValue stub_services_; | 100 base::DictionaryValue stub_services_; |
103 // Observer list for each service. | 101 // Observer list for each service. |
104 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; | 102 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; |
105 | 103 |
106 // Note: This should remain the last member so it'll be destroyed and | 104 // Note: This should remain the last member so it'll be destroyed and |
107 // invalidate its weak pointers before any other members are destroyed. | 105 // invalidate its weak pointers before any other members are destroyed. |
108 base::WeakPtrFactory<ShillServiceClientStub> weak_ptr_factory_; | 106 base::WeakPtrFactory<ShillServiceClientStub> weak_ptr_factory_; |
109 | 107 |
110 DISALLOW_COPY_AND_ASSIGN(ShillServiceClientStub); | 108 DISALLOW_COPY_AND_ASSIGN(ShillServiceClientStub); |
111 }; | 109 }; |
112 | 110 |
113 } // namespace chromeos | 111 } // namespace chromeos |
114 | 112 |
115 #endif // CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ | 113 #endif // CHROMEOS_DBUS_SHILL_SERVICE_CLIENT_STUB_H_ |
OLD | NEW |