OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NETWORK_SHILL_PROPERTY_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const base::Value& value) = 0; | 66 const base::Value& value) = 0; |
67 | 67 |
68 // Called when a property for a watched device has changed. | 68 // Called when a property for a watched device has changed. |
69 virtual void UpdateDeviceProperty( | 69 virtual void UpdateDeviceProperty( |
70 const std::string& device_path, | 70 const std::string& device_path, |
71 const std::string& key, | 71 const std::string& key, |
72 const base::Value& value) = 0; | 72 const base::Value& value) = 0; |
73 | 73 |
74 // Called when one or more manager properties (e.g. a technology list) | 74 // Called when one or more manager properties (e.g. a technology list) |
75 // changes. | 75 // changes. |
76 virtual void ManagerPropertyChanged() = 0; | 76 virtual void NotifyManagerPropertyChanged() = 0; |
77 | 77 |
78 // Called when a managed state list has changed, after properties for any | 78 // Called when a managed state list has changed, after properties for any |
79 // new entries in the list have been received and | 79 // new entries in the list have been received and |
80 // UpdateManagedStateProperties has been called for each new entry. | 80 // UpdateManagedStateProperties has been called for each new entry. |
81 virtual void ManagedStateListChanged(ManagedState::ManagedType type) = 0; | 81 virtual void ManagedStateListChanged(ManagedState::ManagedType type) = 0; |
82 | 82 |
83 protected: | 83 protected: |
84 virtual ~Listener() {} | 84 virtual ~Listener() {} |
85 }; | 85 }; |
86 | 86 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // ShillPropertyChangedObserver overrides | 121 // ShillPropertyChangedObserver overrides |
122 virtual void OnPropertyChanged(const std::string& key, | 122 virtual void OnPropertyChanged(const std::string& key, |
123 const base::Value& value) OVERRIDE; | 123 const base::Value& value) OVERRIDE; |
124 | 124 |
125 private: | 125 private: |
126 // Callback for dbus method fetching properties. | 126 // Callback for dbus method fetching properties. |
127 void ManagerPropertiesCallback(DBusMethodCallStatus call_status, | 127 void ManagerPropertiesCallback(DBusMethodCallStatus call_status, |
128 const base::DictionaryValue& properties); | 128 const base::DictionaryValue& properties); |
129 // Called form OnPropertyChanged() and ManagerPropertiesCallback(). | 129 // Called form OnPropertyChanged() and ManagerPropertiesCallback(). |
130 // Returns true if observers should be notified. | 130 // Returns true if observers should be notified. |
131 bool ManagerPropertyChanged(const std::string& key, const base::Value& value); | 131 bool ManagerPropertyChanged(const std::string& key, |
| 132 const base::Value& value); |
132 | 133 |
133 // Updates the Shill property observers to observe any entries for |type|. | 134 // Updates the Shill property observers to observe any entries for |type|. |
134 void UpdateObserved(ManagedState::ManagedType type, | 135 void UpdateObserved(ManagedState::ManagedType type, |
135 const base::ListValue& entries); | 136 const base::ListValue& entries); |
136 | 137 |
137 | 138 |
138 // Sets |*_technologies_| to contain only entries in |technologies|. | 139 // Sets |*_technologies_| to contain only entries in |technologies|. |
139 void UpdateAvailableTechnologies(const base::ListValue& technologies); | 140 void UpdateAvailableTechnologies(const base::ListValue& technologies); |
140 void UpdateEnabledTechnologies(const base::ListValue& technologies); | 141 void UpdateEnabledTechnologies(const base::ListValue& technologies); |
141 void UpdateUninitializedTechnologies(const base::ListValue& technologies); | 142 void UpdateUninitializedTechnologies(const base::ListValue& technologies); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 std::set<std::string> enabling_technologies_; | 194 std::set<std::string> enabling_technologies_; |
194 std::set<std::string> uninitialized_technologies_; | 195 std::set<std::string> uninitialized_technologies_; |
195 | 196 |
196 DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandler); | 197 DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandler); |
197 }; | 198 }; |
198 | 199 |
199 } // namespace internal | 200 } // namespace internal |
200 } // namespace chromeos | 201 } // namespace chromeos |
201 | 202 |
202 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ | 203 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ |
OLD | NEW |