Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chromeos/network/shill_property_handler.h

Issue 289383004: Merge FavoriteState into NetworkState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Elim UpdateManagerProperties, feedback Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 public: 43 public:
44 typedef std::map<std::string, ShillPropertyObserver*> 44 typedef std::map<std::string, ShillPropertyObserver*>
45 ShillPropertyObserverMap; 45 ShillPropertyObserverMap;
46 46
47 class CHROMEOS_EXPORT Listener { 47 class CHROMEOS_EXPORT Listener {
48 public: 48 public:
49 // Called when the entries in a managed list have changed. 49 // Called when the entries in a managed list have changed.
50 virtual void UpdateManagedList(ManagedState::ManagedType type, 50 virtual void UpdateManagedList(ManagedState::ManagedType type,
51 const base::ListValue& entries) = 0; 51 const base::ListValue& entries) = 0;
52 52
53 // Called when the entries in the visible network list have changed.
54 virtual void UpdateVisibleNetworks(const base::ListValue& entries) = 0;
55
53 // Called when the properties for a managed state have changed. 56 // Called when the properties for a managed state have changed.
54 virtual void UpdateManagedStateProperties( 57 virtual void UpdateManagedStateProperties(
55 ManagedState::ManagedType type, 58 ManagedState::ManagedType type,
56 const std::string& path, 59 const std::string& path,
57 const base::DictionaryValue& properties) = 0; 60 const base::DictionaryValue& properties) = 0;
58 61
59 // Called when the list of profiles changes. 62 // Called when the list of profiles changes.
60 virtual void ProfileListChanged() = 0; 63 virtual void ProfileListChanged() = 0;
61 64
62 // Called when a property for a watched network service has changed. 65 // Called when a property for a watched network service has changed.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 152
150 // Notifies the listener when a ManagedStateList has changed and all pending 153 // Notifies the listener when a ManagedStateList has changed and all pending
151 // updates have been received. |key| can either identify the list that 154 // updates have been received. |key| can either identify the list that
152 // has changed or an empty string if multiple lists may have changed. 155 // has changed or an empty string if multiple lists may have changed.
153 void CheckPendingStateListUpdates(const std::string& key); 156 void CheckPendingStateListUpdates(const std::string& key);
154 157
155 // Called form OnPropertyChanged() and ManagerPropertiesCallback(). 158 // Called form OnPropertyChanged() and ManagerPropertiesCallback().
156 void ManagerPropertyChanged(const std::string& key, 159 void ManagerPropertyChanged(const std::string& key,
157 const base::Value& value); 160 const base::Value& value);
158 161
159 // Requests properties for new entries in the list for |type| as follows: 162 // Requests properties for new entries in the list for |type|.
160 // * Any new Device objects for MANAGED_TYPE_DEVICE
161 // * Any new Service objects for MANAGED_TYPE_NETWORK
162 // * Additional new Service objects for MANAGED_TYPE_FAVORITE that were not
163 // requested for MANAGED_TYPE_NETWORK (i.e. only request objects once).
164 // For this to avoid duplicate requests, this must be called with
165 // MANAGED_TYPE_NETWORK before MANAGED_TYPE_FAVORITE.
166 void UpdateProperties(ManagedState::ManagedType type, 163 void UpdateProperties(ManagedState::ManagedType type,
167 const base::ListValue& entries); 164 const base::ListValue& entries);
168 165
169 // Updates the Shill property observers to observe any entries for |type|. 166 // Updates the Shill property observers to observe any entries for |type|.
170 void UpdateObserved(ManagedState::ManagedType type, 167 void UpdateObserved(ManagedState::ManagedType type,
171 const base::ListValue& entries); 168 const base::ListValue& entries);
172 169
173 170
174 // Sets |*_technologies_| to contain only entries in |technologies|. 171 // Sets |*_technologies_| to contain only entries in |technologies|.
175 void UpdateAvailableTechnologies(const base::ListValue& technologies); 172 void UpdateAvailableTechnologies(const base::ListValue& technologies);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 std::set<std::string> enabling_technologies_; 241 std::set<std::string> enabling_technologies_;
245 std::set<std::string> uninitialized_technologies_; 242 std::set<std::string> uninitialized_technologies_;
246 243
247 DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandler); 244 DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandler);
248 }; 245 };
249 246
250 } // namespace internal 247 } // namespace internal
251 } // namespace chromeos 248 } // namespace chromeos
252 249
253 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_ 250 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698