Chromium Code Reviews| 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 friend class NetworkHandler; | 237 friend class NetworkHandler; |
| 238 NetworkStateHandler(); | 238 NetworkStateHandler(); |
| 239 | 239 |
| 240 // ShillPropertyHandler::Listener overrides. | 240 // ShillPropertyHandler::Listener overrides. |
| 241 | 241 |
| 242 // This adds new entries to |network_list_| or |device_list_| and deletes any | 242 // This adds new entries to |network_list_| or |device_list_| and deletes any |
| 243 // entries that are no longer in the list. | 243 // entries that are no longer in the list. |
| 244 virtual void UpdateManagedList(ManagedState::ManagedType type, | 244 virtual void UpdateManagedList(ManagedState::ManagedType type, |
| 245 const base::ListValue& entries) OVERRIDE; | 245 const base::ListValue& entries) OVERRIDE; |
| 246 | 246 |
| 247 // Updates the visibility of entries in |network_list_|. This should not | |
| 248 // contain entries that are not in |network_list_|. Any such entries will be | |
| 249 // ignored with an error message. | |
| 250 virtual void UpdateVisibleNetworks(const base::ListValue& entries) OVERRIDE; | |
| 251 | |
| 252 // The list of profiles changed (i.e. a user has logged in). Re-request | 247 // The list of profiles changed (i.e. a user has logged in). Re-request |
| 253 // properties for all services since they may have changed. | 248 // properties for all services since they may have changed. |
| 254 virtual void ProfileListChanged() OVERRIDE; | 249 virtual void ProfileListChanged() OVERRIDE; |
| 255 | 250 |
| 256 // Parses the properties for the network service or device. Mostly calls | 251 // Parses the properties for the network service or device. Mostly calls |
| 257 // managed->PropertyChanged(key, value) for each dictionary entry. | 252 // managed->PropertyChanged(key, value) for each dictionary entry. |
| 258 virtual void UpdateManagedStateProperties( | 253 virtual void UpdateManagedStateProperties( |
| 259 ManagedState::ManagedType type, | 254 ManagedState::ManagedType type, |
| 260 const std::string& path, | 255 const std::string& path, |
| 261 const base::DictionaryValue& properties) OVERRIDE; | 256 const base::DictionaryValue& properties) OVERRIDE; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 // test observers. | 299 // test observers. |
| 305 void InitShillPropertyHandler(); | 300 void InitShillPropertyHandler(); |
| 306 | 301 |
| 307 private: | 302 private: |
| 308 typedef std::list<base::Closure> ScanCallbackList; | 303 typedef std::list<base::Closure> ScanCallbackList; |
| 309 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; | 304 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; |
| 310 typedef std::map<std::string, std::string> SpecifierGuidMap; | 305 typedef std::map<std::string, std::string> SpecifierGuidMap; |
| 311 friend class NetworkStateHandlerTest; | 306 friend class NetworkStateHandlerTest; |
| 312 FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub); | 307 FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub); |
| 313 | 308 |
| 309 // Sort the network list and update UMA stats. | |
|
pneubeck (no reviews)
2014/06/16 14:38:15
Maybe either add a comment that this is only ever
stevenjb
2014/06/16 19:54:49
This is called directly by ManagedStateListChanged
| |
| 310 void UpdateNetworkList(); | |
| 311 | |
| 314 // NetworkState specific method for UpdateManagedStateProperties which | 312 // NetworkState specific method for UpdateManagedStateProperties which |
| 315 // notifies observers. | 313 // notifies observers. |
| 316 void UpdateNetworkStateProperties(NetworkState* network, | 314 void UpdateNetworkStateProperties(NetworkState* network, |
| 317 const base::DictionaryValue& properties); | 315 const base::DictionaryValue& properties); |
| 318 | 316 |
| 319 // Ensure a valid GUID for NetworkState. | 317 // Ensure a valid GUID for NetworkState. |
| 320 void UpdateGuid(NetworkState* network); | 318 void UpdateGuid(NetworkState* network); |
| 321 | 319 |
| 322 // Sends DeviceListChanged() to observers and logs an event. | 320 // Sends DeviceListChanged() to observers and logs an event. |
| 323 void NotifyDeviceListChanged(); | 321 void NotifyDeviceListChanged(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 // Map of network specifiers to guids. Contains an entry for each | 376 // Map of network specifiers to guids. Contains an entry for each |
| 379 // NetworkState that is not saved in a profile. | 377 // NetworkState that is not saved in a profile. |
| 380 SpecifierGuidMap specifier_guid_map_; | 378 SpecifierGuidMap specifier_guid_map_; |
| 381 | 379 |
| 382 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); | 380 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); |
| 383 }; | 381 }; |
| 384 | 382 |
| 385 } // namespace chromeos | 383 } // namespace chromeos |
| 386 | 384 |
| 387 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ | 385 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
| OLD | NEW |