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_NETWORK_STATE_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 protected: | 238 protected: |
239 friend class NetworkHandler; | 239 friend class NetworkHandler; |
240 NetworkStateHandler(); | 240 NetworkStateHandler(); |
241 | 241 |
242 // ShillPropertyHandler::Listener overrides. | 242 // ShillPropertyHandler::Listener overrides. |
243 | 243 |
244 // This adds new entries to |network_list_| or |device_list_| and deletes any | 244 // This adds new entries to |network_list_| or |device_list_| and deletes any |
245 // entries that are no longer in the list. | 245 // entries that are no longer in the list. |
246 virtual void UpdateManagedList(ManagedState::ManagedType type, | 246 virtual void UpdateManagedList(ManagedState::ManagedType type, |
247 const base::ListValue& entries) OVERRIDE; | 247 const base::ListValue& entries) override; |
248 | 248 |
249 // The list of profiles changed (i.e. a user has logged in). Re-request | 249 // The list of profiles changed (i.e. a user has logged in). Re-request |
250 // properties for all services since they may have changed. | 250 // properties for all services since they may have changed. |
251 virtual void ProfileListChanged() OVERRIDE; | 251 virtual void ProfileListChanged() override; |
252 | 252 |
253 // Parses the properties for the network service or device. Mostly calls | 253 // Parses the properties for the network service or device. Mostly calls |
254 // managed->PropertyChanged(key, value) for each dictionary entry. | 254 // managed->PropertyChanged(key, value) for each dictionary entry. |
255 virtual void UpdateManagedStateProperties( | 255 virtual void UpdateManagedStateProperties( |
256 ManagedState::ManagedType type, | 256 ManagedState::ManagedType type, |
257 const std::string& path, | 257 const std::string& path, |
258 const base::DictionaryValue& properties) OVERRIDE; | 258 const base::DictionaryValue& properties) override; |
259 | 259 |
260 // Called by ShillPropertyHandler when a watched service property changes. | 260 // Called by ShillPropertyHandler when a watched service property changes. |
261 virtual void UpdateNetworkServiceProperty( | 261 virtual void UpdateNetworkServiceProperty( |
262 const std::string& service_path, | 262 const std::string& service_path, |
263 const std::string& key, | 263 const std::string& key, |
264 const base::Value& value) OVERRIDE; | 264 const base::Value& value) override; |
265 | 265 |
266 // Called by ShillPropertyHandler when a watched device property changes. | 266 // Called by ShillPropertyHandler when a watched device property changes. |
267 virtual void UpdateDeviceProperty( | 267 virtual void UpdateDeviceProperty( |
268 const std::string& device_path, | 268 const std::string& device_path, |
269 const std::string& key, | 269 const std::string& key, |
270 const base::Value& value) OVERRIDE; | 270 const base::Value& value) override; |
271 | 271 |
272 // Called by ShillPropertyHandler when a watched network or device | 272 // Called by ShillPropertyHandler when a watched network or device |
273 // IPConfig property changes. | 273 // IPConfig property changes. |
274 virtual void UpdateIPConfigProperties( | 274 virtual void UpdateIPConfigProperties( |
275 ManagedState::ManagedType type, | 275 ManagedState::ManagedType type, |
276 const std::string& path, | 276 const std::string& path, |
277 const std::string& ip_config_path, | 277 const std::string& ip_config_path, |
278 const base::DictionaryValue& properties) OVERRIDE; | 278 const base::DictionaryValue& properties) override; |
279 | 279 |
280 // Called by ShillPropertyHandler when the portal check list manager property | 280 // Called by ShillPropertyHandler when the portal check list manager property |
281 // changes. | 281 // changes. |
282 virtual void CheckPortalListChanged( | 282 virtual void CheckPortalListChanged( |
283 const std::string& check_portal_list) OVERRIDE; | 283 const std::string& check_portal_list) override; |
284 | 284 |
285 // Called by ShillPropertyHandler when a technology list changes. | 285 // Called by ShillPropertyHandler when a technology list changes. |
286 virtual void TechnologyListChanged() OVERRIDE; | 286 virtual void TechnologyListChanged() override; |
287 | 287 |
288 // Called by |shill_property_handler_| when the service or device list has | 288 // Called by |shill_property_handler_| when the service or device list has |
289 // changed and all entries have been updated. This updates the list and | 289 // changed and all entries have been updated. This updates the list and |
290 // notifies observers. | 290 // notifies observers. |
291 virtual void ManagedStateListChanged( | 291 virtual void ManagedStateListChanged( |
292 ManagedState::ManagedType type) OVERRIDE; | 292 ManagedState::ManagedType type) override; |
293 | 293 |
294 // Called when the default network service changes. Sets default_network_path_ | 294 // Called when the default network service changes. Sets default_network_path_ |
295 // and notifies listeners. | 295 // and notifies listeners. |
296 virtual void DefaultNetworkServiceChanged( | 296 virtual void DefaultNetworkServiceChanged( |
297 const std::string& service_path) OVERRIDE; | 297 const std::string& service_path) override; |
298 | 298 |
299 // Called after construction. Called explicitly by tests after adding | 299 // Called after construction. Called explicitly by tests after adding |
300 // test observers. | 300 // test observers. |
301 void InitShillPropertyHandler(); | 301 void InitShillPropertyHandler(); |
302 | 302 |
303 private: | 303 private: |
304 typedef std::list<base::Closure> ScanCallbackList; | 304 typedef std::list<base::Closure> ScanCallbackList; |
305 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; | 305 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; |
306 typedef std::map<std::string, std::string> SpecifierGuidMap; | 306 typedef std::map<std::string, std::string> SpecifierGuidMap; |
307 friend class NetworkStateHandlerTest; | 307 friend class NetworkStateHandlerTest; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // Map of network specifiers to guids. Contains an entry for each | 393 // Map of network specifiers to guids. Contains an entry for each |
394 // NetworkState that is not saved in a profile. | 394 // NetworkState that is not saved in a profile. |
395 SpecifierGuidMap specifier_guid_map_; | 395 SpecifierGuidMap specifier_guid_map_; |
396 | 396 |
397 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); | 397 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); |
398 }; | 398 }; |
399 | 399 |
400 } // namespace chromeos | 400 } // namespace chromeos |
401 | 401 |
402 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ | 402 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
OLD | NEW |