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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // | 43 // |
| 44 // This class maps essential properties from the connection manager (Shill) for | 44 // This class maps essential properties from the connection manager (Shill) for |
| 45 // each visible network. It is not used to change the properties of services or | 45 // each visible network. It is not used to change the properties of services or |
| 46 // devices, only global (manager) properties. | 46 // devices, only global (manager) properties. |
| 47 // | 47 // |
| 48 // All getters return the currently cached properties. This class is expected to | 48 // All getters return the currently cached properties. This class is expected to |
| 49 // keep properties up to date by managing the appropriate Shill observers. | 49 // keep properties up to date by managing the appropriate Shill observers. |
| 50 // It will invoke its own more specific observer methods when the specified | 50 // It will invoke its own more specific observer methods when the specified |
| 51 // changes occur. | 51 // changes occur. |
| 52 // | 52 // |
| 53 // Some notes about NetworkState, FavoriteState, and GUIDs: | 53 // Some notes about NetworkState and GUIDs: |
| 54 // * A FavoriteState exists for all network services stored in a profile, and | 54 // * A NetworkState exists for all network services stored in a profile, and |
| 55 // all "visible" networks (physically connected networks like ethernet and | 55 // all "visible" networks (physically connected networks like ethernet and |
| 56 // cellular or in-range wifi networks). If the network is stored in a profile, | 56 // cellular or in-range wifi networks). If the network is stored in a profile, |
| 57 // FavoriteState.IsInProfile() will return true. | 57 // NetworkState.IsInProfile() will return true. |
| 58 // * A NetworkState exists for "visible" networks only. There will always be a | 58 // * "Visible" networks return true for NetworkState.IsVisible(). |
|
pneubeck (no reviews)
2014/06/11 12:44:56
IsVisible() -> visible()
stevenjb
2014/06/11 23:31:41
Done.
| |
| 59 // corresponding FavoriteState with the same service_path() property. | |
| 60 // * All networks saved to a profile will have a saved GUID that is persistent | 59 // * All networks saved to a profile will have a saved GUID that is persistent |
| 61 // across sessions. | 60 // across sessions. |
| 62 // * Networks that are not saved to a profile will have a GUID assigned when | 61 // * Networks that are not saved to a profile will have a GUID assigned when |
| 63 // the initial properties are received. The GUID will be consistent for | 62 // the initial properties are received. The GUID will be consistent for |
| 64 // the duration of a session, even if the network drops out and returns. | 63 // the duration of a session, even if the network drops out and returns. |
| 65 // * Both FavoriteState and NetworkState store the GUID. It will always be the | |
| 66 // same for the same network (i.e. entries with the same service_path()). | |
| 67 | 64 |
| 68 class CHROMEOS_EXPORT NetworkStateHandler | 65 class CHROMEOS_EXPORT NetworkStateHandler |
| 69 : public internal::ShillPropertyHandler::Listener { | 66 : public internal::ShillPropertyHandler::Listener { |
| 70 public: | 67 public: |
| 71 typedef std::vector<ManagedState*> ManagedStateList; | 68 typedef std::vector<ManagedState*> ManagedStateList; |
| 72 typedef std::vector<const NetworkState*> NetworkStateList; | 69 typedef std::vector<const NetworkState*> NetworkStateList; |
| 73 typedef std::vector<const DeviceState*> DeviceStateList; | 70 typedef std::vector<const DeviceState*> DeviceStateList; |
| 74 typedef std::vector<const FavoriteState*> FavoriteStateList; | |
| 75 | 71 |
| 76 enum TechnologyState { | 72 enum TechnologyState { |
| 77 TECHNOLOGY_UNAVAILABLE, | 73 TECHNOLOGY_UNAVAILABLE, |
| 78 TECHNOLOGY_AVAILABLE, | 74 TECHNOLOGY_AVAILABLE, |
| 79 TECHNOLOGY_UNINITIALIZED, | 75 TECHNOLOGY_UNINITIALIZED, |
| 80 TECHNOLOGY_ENABLING, | 76 TECHNOLOGY_ENABLING, |
| 81 TECHNOLOGY_ENABLED | 77 TECHNOLOGY_ENABLED |
| 82 }; | 78 }; |
| 83 | 79 |
| 84 virtual ~NetworkStateHandler(); | 80 virtual ~NetworkStateHandler(); |
| 85 | 81 |
| 86 // Add/remove observers. | 82 // Add/remove observers. |
| 87 void AddObserver(NetworkStateHandlerObserver* observer, | 83 void AddObserver(NetworkStateHandlerObserver* observer, |
| 88 const tracked_objects::Location& from_here); | 84 const tracked_objects::Location& from_here); |
| 89 void RemoveObserver(NetworkStateHandlerObserver* observer, | 85 void RemoveObserver(NetworkStateHandlerObserver* observer, |
| 90 const tracked_objects::Location& from_here); | 86 const tracked_objects::Location& from_here); |
| 91 | 87 |
| 92 // Requests all Manager properties, specifically to update the complete | |
| 93 // list of services which determines the list of Favorites. This should be | |
| 94 // called any time a new service is configured or a Profile is loaded. | |
| 95 void UpdateManagerProperties(); | |
| 96 | |
| 97 // Returns the state for technology |type|. Only | 88 // Returns the state for technology |type|. Only |
| 98 // NetworkTypePattern::Primitive, ::Mobile and ::Ethernet are supported. | 89 // NetworkTypePattern::Primitive, ::Mobile and ::Ethernet are supported. |
| 99 TechnologyState GetTechnologyState(const NetworkTypePattern& type) const; | 90 TechnologyState GetTechnologyState(const NetworkTypePattern& type) const; |
| 100 bool IsTechnologyAvailable(const NetworkTypePattern& type) const { | 91 bool IsTechnologyAvailable(const NetworkTypePattern& type) const { |
| 101 return GetTechnologyState(type) != TECHNOLOGY_UNAVAILABLE; | 92 return GetTechnologyState(type) != TECHNOLOGY_UNAVAILABLE; |
| 102 } | 93 } |
| 103 bool IsTechnologyEnabled(const NetworkTypePattern& type) const { | 94 bool IsTechnologyEnabled(const NetworkTypePattern& type) const { |
| 104 return GetTechnologyState(type) == TECHNOLOGY_ENABLED; | 95 return GetTechnologyState(type) == TECHNOLOGY_ENABLED; |
| 105 } | 96 } |
| 106 | 97 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 127 // value for each property. To receive notifications when a property changes, | 118 // value for each property. To receive notifications when a property changes, |
| 128 // observe this class and implement NetworkPropertyChanged(). | 119 // observe this class and implement NetworkPropertyChanged(). |
| 129 const NetworkState* GetNetworkState(const std::string& service_path) const; | 120 const NetworkState* GetNetworkState(const std::string& service_path) const; |
| 130 | 121 |
| 131 // Returns the default network (which includes VPNs) based on the Shill | 122 // Returns the default network (which includes VPNs) based on the Shill |
| 132 // Manager.DefaultNetwork property. Normally this is the same as | 123 // Manager.DefaultNetwork property. Normally this is the same as |
| 133 // ConnectedNetworkByType(NetworkTypePattern::Default()), but the timing might | 124 // ConnectedNetworkByType(NetworkTypePattern::Default()), but the timing might |
| 134 // differ. | 125 // differ. |
| 135 const NetworkState* DefaultNetwork() const; | 126 const NetworkState* DefaultNetwork() const; |
| 136 | 127 |
| 137 // Returns the FavoriteState associated to DefaultNetwork. Returns NULL if, | |
| 138 // and only if, DefaultNetwork returns NULL. | |
| 139 const FavoriteState* DefaultFavoriteNetwork() const; | |
| 140 | |
| 141 // Returns the primary connected network of matching |type|, otherwise NULL. | 128 // Returns the primary connected network of matching |type|, otherwise NULL. |
| 142 const NetworkState* ConnectedNetworkByType( | 129 const NetworkState* ConnectedNetworkByType( |
| 143 const NetworkTypePattern& type) const; | 130 const NetworkTypePattern& type) const; |
| 144 | 131 |
| 145 // Like ConnectedNetworkByType() but returns a connecting network or NULL. | 132 // Like ConnectedNetworkByType() but returns a connecting network or NULL. |
| 146 const NetworkState* ConnectingNetworkByType( | 133 const NetworkState* ConnectingNetworkByType( |
| 147 const NetworkTypePattern& type) const; | 134 const NetworkTypePattern& type) const; |
| 148 | 135 |
| 149 // Like ConnectedNetworkByType() but returns any matching network or NULL. | 136 // Like ConnectedNetworkByType() but returns any matching network or NULL. |
| 150 // Mostly useful for mobile networks where there is generally only one | 137 // Mostly useful for mobile networks where there is generally only one |
| 151 // network. Note: O(N). | 138 // network. Note: O(N). |
| 152 const NetworkState* FirstNetworkByType(const NetworkTypePattern& type) const; | 139 const NetworkState* FirstNetworkByType(const NetworkTypePattern& type) const; |
| 153 | 140 |
| 154 // Returns the aa:bb formatted hardware (MAC) address for the first connected | 141 // Returns the aa:bb formatted hardware (MAC) address for the first connected |
| 155 // network matching |type|, or an empty string if none is connected. | 142 // network matching |type|, or an empty string if none is connected. |
| 156 std::string FormattedHardwareAddressForType( | 143 std::string FormattedHardwareAddressForType( |
| 157 const NetworkTypePattern& type) const; | 144 const NetworkTypePattern& type) const; |
| 158 | 145 |
| 159 // Sets |list| to contain the list of networks. The returned list contains | 146 // Convenience method to call GetNetworkListByType(visible=true). |
| 160 // a copy of NetworkState pointers which should not be stored or used beyond | 147 void GetVisibleNetworkListByType(const NetworkTypePattern& type, |
| 161 // the scope of the calling function (i.e. they may later become invalid, but | 148 NetworkStateList* list) const; |
| 162 // only on the UI thread). | |
| 163 void GetNetworkList(NetworkStateList* list) const; | |
| 164 | 149 |
| 165 // Like GetNetworkList() but only returns networks with matching |type|. | 150 // Convenience method for GetVisibleNetworkListByType(All). |
|
pneubeck (no reviews)
2014/06/11 12:44:56
It's NetworkTypePattern::Default not All, although
stevenjb
2014/06/11 23:31:41
Yeah, I was going to add "All" to be synonymous bu
| |
| 151 void GetVisibleNetworkList(NetworkStateList* list) const; | |
| 152 | |
| 153 // Sets |list| to contain the list of networks with matching |type| and the | |
| 154 // following properties: | |
| 155 // |configured_only| - if true only include networks where IsInProfile is true | |
| 156 // |visible_only| - if true only include networks in the visible Services list | |
| 157 // |limit| - if > 0 limits the number of results. | |
| 158 // The returned list contains a copy of NetworkState pointers which should not | |
| 159 // be stored or used beyond the scope of the calling function (i.e. they may | |
| 160 // later become invalid, but only on the UI thread). | |
| 166 void GetNetworkListByType(const NetworkTypePattern& type, | 161 void GetNetworkListByType(const NetworkTypePattern& type, |
| 162 bool configured_only, | |
| 163 bool visible_only, | |
| 164 int limit, | |
| 167 NetworkStateList* list) const; | 165 NetworkStateList* list) const; |
| 168 | 166 |
| 167 // Finds and returns the NetworkState associated with |service_path| or NULL | |
| 168 // if not found. If |configured_only| is true, only returns saved entries | |
| 169 // (IsInProfile is true). | |
| 170 const NetworkState* GetNetworkStateFromServicePath( | |
| 171 const std::string& service_path, | |
| 172 bool configured_only) const; | |
| 173 | |
| 174 // Finds and returns the NetworkState associated with |guid| or NULL if not | |
| 175 // found. This returns all entries (IsInProfile() may be true or false). | |
| 176 const NetworkState* GetNetworkStateFromGuid(const std::string& guid) const; | |
| 177 | |
| 169 // Sets |list| to contain the list of devices. The returned list contains | 178 // Sets |list| to contain the list of devices. The returned list contains |
| 170 // a copy of DeviceState pointers which should not be stored or used beyond | 179 // a copy of DeviceState pointers which should not be stored or used beyond |
| 171 // the scope of the calling function (i.e. they may later become invalid, but | 180 // the scope of the calling function (i.e. they may later become invalid, but |
| 172 // only on the UI thread). | 181 // only on the UI thread). |
| 173 void GetDeviceList(DeviceStateList* list) const; | 182 void GetDeviceList(DeviceStateList* list) const; |
| 174 | 183 |
| 175 // Like GetDeviceList() but only returns networks with matching |type|. | 184 // Like GetDeviceList() but only returns networks with matching |type|. |
| 176 void GetDeviceListByType(const NetworkTypePattern& type, | 185 void GetDeviceListByType(const NetworkTypePattern& type, |
| 177 DeviceStateList* list) const; | 186 DeviceStateList* list) const; |
| 178 | 187 |
| 179 // Sets |list| to contain the list of favorite (aka "preferred") networks. | |
| 180 // See GetNetworkList() for usage, and notes for |favorite_list_|. | |
| 181 // Favorites that are visible have the same path() as the entries in | |
| 182 // GetNetworkList(), so GetNetworkState() can be used to determine if a | |
| 183 // favorite is visible and retrieve the complete properties (and vice-versa). | |
| 184 void GetFavoriteList(FavoriteStateList* list) const; | |
| 185 | |
| 186 // Like GetFavoriteList() but only returns favorites with matching |type| and | |
| 187 // the following properties: | |
| 188 // |configured_only| - if true only include networks where IsInProfile is true | |
| 189 // |visible_only| - if true only include networks in the visible Services list | |
| 190 // |limit| - if > 0 limits the number of results. | |
| 191 void GetFavoriteListByType(const NetworkTypePattern& type, | |
| 192 bool configured_only, | |
| 193 bool visible_only, | |
| 194 int limit, | |
| 195 FavoriteStateList* list) const; | |
| 196 | |
| 197 // Finds and returns the FavoriteState associated with |service_path| or NULL | |
| 198 // if not found. If |configured_only| is true, only returns saved entries | |
| 199 // (IsInProfile is true). | |
| 200 const FavoriteState* GetFavoriteStateFromServicePath( | |
| 201 const std::string& service_path, | |
| 202 bool configured_only) const; | |
| 203 | |
| 204 // Finds and returns the FavoriteState associated with |guid| or NULL if not | |
| 205 // found. This returns all entries (IsInProfile() may be true or false). | |
| 206 const FavoriteState* GetFavoriteStateFromGuid(const std::string& guid) const; | |
| 207 | |
| 208 // Requests a network scan. This may trigger updates to the network | 188 // Requests a network scan. This may trigger updates to the network |
| 209 // list, which will trigger the appropriate observer calls. | 189 // list, which will trigger the appropriate observer calls. |
| 210 void RequestScan() const; | 190 void RequestScan() const; |
| 211 | 191 |
| 212 // Request a scan if not scanning and run |callback| when the Scanning state | 192 // Request a scan if not scanning and run |callback| when the Scanning state |
| 213 // for any Device of network type |type| completes. | 193 // for any Device of network type |type| completes. |
| 214 void WaitForScan(const std::string& type, const base::Closure& callback); | 194 void WaitForScan(const std::string& type, const base::Closure& callback); |
| 215 | 195 |
| 216 // Request a network scan then signal Shill to connect to the best available | 196 // Request a network scan then signal Shill to connect to the best available |
| 217 // networks when completed. | 197 // networks when completed. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 229 // Clear the last_error value for the NetworkState for |service_path|. | 209 // Clear the last_error value for the NetworkState for |service_path|. |
| 230 void ClearLastErrorForNetwork(const std::string& service_path); | 210 void ClearLastErrorForNetwork(const std::string& service_path); |
| 231 | 211 |
| 232 // Set the list of devices on which portal check is enabled. | 212 // Set the list of devices on which portal check is enabled. |
| 233 void SetCheckPortalList(const std::string& check_portal_list); | 213 void SetCheckPortalList(const std::string& check_portal_list); |
| 234 | 214 |
| 235 const std::string& GetCheckPortalListForTest() const { | 215 const std::string& GetCheckPortalListForTest() const { |
| 236 return check_portal_list_; | 216 return check_portal_list_; |
| 237 } | 217 } |
| 238 | 218 |
| 239 // Returns the FavoriteState of the EthernetEAP service, which contains the | 219 // Returns the NetworkState of the EthernetEAP service, which contains the |
| 240 // EAP parameters used by the ethernet with |service_path|. If |service_path| | 220 // EAP parameters used by the ethernet with |service_path|. If |service_path| |
| 241 // doesn't refer to an ethernet service or if the ethernet service is not | 221 // doesn't refer to an ethernet service or if the ethernet service is not |
| 242 // connected using EAP, returns NULL. | 222 // connected using EAP, returns NULL. |
| 243 const FavoriteState* GetEAPForEthernet(const std::string& service_path) const; | 223 const NetworkState* GetEAPForEthernet(const std::string& service_path) const; |
| 244 | 224 |
| 245 const std::string& default_network_path() const { | 225 const std::string& default_network_path() const { |
| 246 return default_network_path_; | 226 return default_network_path_; |
| 247 } | 227 } |
| 248 | 228 |
| 249 // Construct and initialize an instance for testing. | 229 // Construct and initialize an instance for testing. |
| 250 static NetworkStateHandler* InitializeForTest(); | 230 static NetworkStateHandler* InitializeForTest(); |
| 251 | 231 |
| 252 // Default set of comma separated interfaces on which to enable | 232 // Default set of comma separated interfaces on which to enable |
| 253 // portal checking. | 233 // portal checking. |
| 254 static const char kDefaultCheckPortalList[]; | 234 static const char kDefaultCheckPortalList[]; |
| 255 | 235 |
| 256 protected: | 236 protected: |
| 257 friend class NetworkHandler; | 237 friend class NetworkHandler; |
| 258 NetworkStateHandler(); | 238 NetworkStateHandler(); |
| 259 | 239 |
| 260 // ShillPropertyHandler::Listener overrides. | 240 // ShillPropertyHandler::Listener overrides. |
| 261 | 241 |
| 262 // This adds new entries to the managed list specified by |type| and deletes | 242 // This adds new entries to |network_list_| or |device_list_| and deletes any |
| 263 // any entries that are no longer in the list. | 243 // entries that are no longer in the list. |
| 264 virtual void UpdateManagedList(ManagedState::ManagedType type, | 244 virtual void UpdateManagedList(ManagedState::ManagedType type, |
| 265 const base::ListValue& entries) OVERRIDE; | 245 const base::ListValue& entries) OVERRIDE; |
| 266 | 246 |
| 247 // Updates the visibility if entries in |network_list_|. This should not | |
|
pneubeck (no reviews)
2014/06/11 12:44:56
typo 'if entries' ?
maybe should have been 'with
stevenjb
2014/06/11 23:31:41
'of' :)
| |
| 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 | |
| 267 // The list of profiles changed (i.e. a user has logged in). Re-request | 252 // The list of profiles changed (i.e. a user has logged in). Re-request |
| 268 // properties for all services since they may have changed. | 253 // properties for all services since they may have changed. |
| 269 virtual void ProfileListChanged() OVERRIDE; | 254 virtual void ProfileListChanged() OVERRIDE; |
| 270 | 255 |
| 271 // Parses the properties for the network service or device. Mostly calls | 256 // Parses the properties for the network service or device. Mostly calls |
| 272 // managed->PropertyChanged(key, value) for each dictionary entry. | 257 // managed->PropertyChanged(key, value) for each dictionary entry. |
| 273 virtual void UpdateManagedStateProperties( | 258 virtual void UpdateManagedStateProperties( |
| 274 ManagedState::ManagedType type, | 259 ManagedState::ManagedType type, |
| 275 const std::string& path, | 260 const std::string& path, |
| 276 const base::DictionaryValue& properties) OVERRIDE; | 261 const base::DictionaryValue& properties) OVERRIDE; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; | 309 typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap; |
| 325 typedef std::map<std::string, std::string> SpecifierGuidMap; | 310 typedef std::map<std::string, std::string> SpecifierGuidMap; |
| 326 friend class NetworkStateHandlerTest; | 311 friend class NetworkStateHandlerTest; |
| 327 FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub); | 312 FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub); |
| 328 | 313 |
| 329 // NetworkState specific method for UpdateManagedStateProperties which | 314 // NetworkState specific method for UpdateManagedStateProperties which |
| 330 // notifies observers. | 315 // notifies observers. |
| 331 void UpdateNetworkStateProperties(NetworkState* network, | 316 void UpdateNetworkStateProperties(NetworkState* network, |
| 332 const base::DictionaryValue& properties); | 317 const base::DictionaryValue& properties); |
| 333 | 318 |
| 334 // Ensure a valid GUID for FavoriteState and update the NetworkState GUID from | 319 // Ensure a valid GUID for NetworkState. |
| 335 // the corresponding FavoriteState if necessary. | 320 void UpdateGuid(NetworkState* network); |
| 336 void UpdateGuid(ManagedState* managed); | |
| 337 | 321 |
| 338 // Sends DeviceListChanged() to observers and logs an event. | 322 // Sends DeviceListChanged() to observers and logs an event. |
| 339 void NotifyDeviceListChanged(); | 323 void NotifyDeviceListChanged(); |
| 340 | 324 |
| 341 // Non-const getters for managed entries. These are const so that they can | 325 // Non-const getters for managed entries. These are const so that they can |
| 342 // be called by Get[Network|Device]State, even though they return non-const | 326 // be called by Get[Network|Device]State, even though they return non-const |
| 343 // pointers. | 327 // pointers. |
| 344 DeviceState* GetModifiableDeviceState(const std::string& device_path) const; | 328 DeviceState* GetModifiableDeviceState(const std::string& device_path) const; |
| 345 NetworkState* GetModifiableNetworkState( | 329 NetworkState* GetModifiableNetworkState( |
| 346 const std::string& service_path) const; | 330 const std::string& service_path) const; |
| 347 FavoriteState* GetModifiableFavoriteState( | |
| 348 const std::string& service_path) const; | |
| 349 ManagedState* GetModifiableManagedState(const ManagedStateList* managed_list, | 331 ManagedState* GetModifiableManagedState(const ManagedStateList* managed_list, |
| 350 const std::string& path) const; | 332 const std::string& path) const; |
| 351 | 333 |
| 352 // Gets the list specified by |type|. | 334 // Gets the list specified by |type|. |
| 353 ManagedStateList* GetManagedList(ManagedState::ManagedType type); | 335 ManagedStateList* GetManagedList(ManagedState::ManagedType type); |
| 354 | 336 |
| 355 // Helper function to notify observers. Calls CheckDefaultNetworkChanged(). | 337 // Helper function to notify observers. Calls CheckDefaultNetworkChanged(). |
| 356 void OnNetworkConnectionStateChanged(NetworkState* network); | 338 void OnNetworkConnectionStateChanged(NetworkState* network); |
| 357 | 339 |
| 358 // Notifies observers when the default network or its properties change. | 340 // Notifies observers when the default network or its properties change. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 374 | 356 |
| 375 // Shill property handler instance, owned by this class. | 357 // Shill property handler instance, owned by this class. |
| 376 scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_; | 358 scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_; |
| 377 | 359 |
| 378 // Observer list | 360 // Observer list |
| 379 ObserverList<NetworkStateHandlerObserver> observers_; | 361 ObserverList<NetworkStateHandlerObserver> observers_; |
| 380 | 362 |
| 381 // List of managed network states | 363 // List of managed network states |
| 382 ManagedStateList network_list_; | 364 ManagedStateList network_list_; |
| 383 | 365 |
| 384 // List of managed favorite states; this list includes all entries in | |
| 385 // Manager.ServiceCompleteList, but only entries with a non-empty Profile | |
| 386 // property are returned in GetFavoriteList(). | |
| 387 ManagedStateList favorite_list_; | |
| 388 | |
| 389 // List of managed device states | 366 // List of managed device states |
| 390 ManagedStateList device_list_; | 367 ManagedStateList device_list_; |
| 391 | 368 |
| 392 // Keeps track of the default network for notifying observers when it changes. | 369 // Keeps track of the default network for notifying observers when it changes. |
| 393 std::string default_network_path_; | 370 std::string default_network_path_; |
| 394 | 371 |
| 395 // List of interfaces on which portal check is enabled. | 372 // List of interfaces on which portal check is enabled. |
| 396 std::string check_portal_list_; | 373 std::string check_portal_list_; |
| 397 | 374 |
| 398 // Callbacks to run when a scan for the technology type completes. | 375 // Callbacks to run when a scan for the technology type completes. |
| 399 ScanCompleteCallbackMap scan_complete_callbacks_; | 376 ScanCompleteCallbackMap scan_complete_callbacks_; |
| 400 | 377 |
| 401 // Map of network specifiers to guids. Contains an entry for each | 378 // Map of network specifiers to guids. Contains an entry for each |
| 402 // FavoriteState that is not saved in a profile. | 379 // NetworkState that is not saved in a profile. |
| 403 SpecifierGuidMap specifier_guid_map_; | 380 SpecifierGuidMap specifier_guid_map_; |
| 404 | 381 |
| 405 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); | 382 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); |
| 406 }; | 383 }; |
| 407 | 384 |
| 408 } // namespace chromeos | 385 } // namespace chromeos |
| 409 | 386 |
| 410 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ | 387 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
| OLD | NEW |