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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void GetDeviceList(DeviceStateList* list) const; | 184 void GetDeviceList(DeviceStateList* list) const; |
185 | 185 |
186 // Like GetDeviceList() but only returns networks with matching |type|. | 186 // Like GetDeviceList() but only returns networks with matching |type|. |
187 void GetDeviceListByType(const NetworkTypePattern& type, | 187 void GetDeviceListByType(const NetworkTypePattern& type, |
188 DeviceStateList* list) const; | 188 DeviceStateList* list) const; |
189 | 189 |
190 // Requests a network scan. This may trigger updates to the network | 190 // Requests a network scan. This may trigger updates to the network |
191 // list, which will trigger the appropriate observer calls. | 191 // list, which will trigger the appropriate observer calls. |
192 void RequestScan() const; | 192 void RequestScan() const; |
193 | 193 |
194 // Request a scan if not scanning and run |callback| when the Scanning state | 194 // Requests a scan if not scanning and runs |callback| when the Scanning state |
195 // for any Device of network type |type| completes. | 195 // for any Device of network type |type| completes. |
196 void WaitForScan(const std::string& type, const base::Closure& callback); | 196 void WaitForScan(const std::string& type, const base::Closure& callback); |
197 | 197 |
198 // Request a network scan then signal Shill to connect to the best available | 198 // Requests a network scan then signals Shill to connect to the best available |
199 // networks when completed. | 199 // wifi network when completed. |
200 void ConnectToBestWifiNetwork(); | 200 void ConnectToBestWifiNetwork(); |
201 | 201 |
202 // Request an update for an existing NetworkState, e.g. after configuring | 202 // Requests an update for an existing NetworkState, e.g. after configuring |
203 // a network. This is a no-op if an update request is already pending. To | 203 // a network. This is a no-op if an update request is already pending. To |
204 // ensure that a change is picked up, this must be called after Shill | 204 // ensure that a change is picked up, this must be called after Shill |
205 // acknowledged it (e.g. in the callback of a SetProperties). | 205 // acknowledged it (e.g. in the callback of a SetProperties). |
206 // When the properties are received, NetworkPropertiesUpdated will be | 206 // When the properties are received, NetworkPropertiesUpdated will be |
207 // signaled for each member of |observers_|, regardless of whether any | 207 // signaled for each member of |observers_|, regardless of whether any |
208 // properties actually changed. | 208 // properties actually changed. |
209 void RequestUpdateForNetwork(const std::string& service_path); | 209 void RequestUpdateForNetwork(const std::string& service_path); |
210 | 210 |
211 // Clear the last_error value for the NetworkState for |service_path|. | 211 // Clears the last_error value for the NetworkState for |service_path|. |
212 void ClearLastErrorForNetwork(const std::string& service_path); | 212 void ClearLastErrorForNetwork(const std::string& service_path); |
213 | 213 |
214 // Set the list of devices on which portal check is enabled. | 214 // Sets the list of devices on which portal check is enabled. |
215 void SetCheckPortalList(const std::string& check_portal_list); | 215 void SetCheckPortalList(const std::string& check_portal_list); |
216 | 216 |
| 217 // Sets the Manager.WakeOnLan property. Note: we do not track this state, we |
| 218 // only set it. |
| 219 void SetWakeOnLanEnabled(bool enabled); |
| 220 |
217 const std::string& GetCheckPortalListForTest() const { | 221 const std::string& GetCheckPortalListForTest() const { |
218 return check_portal_list_; | 222 return check_portal_list_; |
219 } | 223 } |
220 | 224 |
221 // Returns the NetworkState of the EthernetEAP service, which contains the | 225 // Returns the NetworkState of the EthernetEAP service, which contains the |
222 // EAP parameters used by the ethernet with |service_path|. If |service_path| | 226 // EAP parameters used by the ethernet with |service_path|. If |service_path| |
223 // doesn't refer to an ethernet service or if the ethernet service is not | 227 // doesn't refer to an ethernet service or if the ethernet service is not |
224 // connected using EAP, returns NULL. | 228 // connected using EAP, returns NULL. |
225 const NetworkState* GetEAPForEthernet(const std::string& service_path); | 229 const NetworkState* GetEAPForEthernet(const std::string& service_path); |
226 | 230 |
227 const std::string& default_network_path() const { | 231 const std::string& default_network_path() const { |
228 return default_network_path_; | 232 return default_network_path_; |
229 } | 233 } |
230 | 234 |
231 // Construct and initialize an instance for testing. | 235 // Constructs and initializes an instance for testing. |
232 static NetworkStateHandler* InitializeForTest(); | 236 static NetworkStateHandler* InitializeForTest(); |
233 | 237 |
234 // Default set of comma separated interfaces on which to enable | 238 // Default set of comma separated interfaces on which to enable |
235 // portal checking. | 239 // portal checking. |
236 static const char kDefaultCheckPortalList[]; | 240 static const char kDefaultCheckPortalList[]; |
237 | 241 |
238 protected: | 242 protected: |
239 friend class NetworkHandler; | 243 friend class NetworkHandler; |
240 NetworkStateHandler(); | 244 NetworkStateHandler(); |
241 | 245 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // Map of network specifiers to guids. Contains an entry for each | 397 // Map of network specifiers to guids. Contains an entry for each |
394 // NetworkState that is not saved in a profile. | 398 // NetworkState that is not saved in a profile. |
395 SpecifierGuidMap specifier_guid_map_; | 399 SpecifierGuidMap specifier_guid_map_; |
396 | 400 |
397 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); | 401 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); |
398 }; | 402 }; |
399 | 403 |
400 } // namespace chromeos | 404 } // namespace chromeos |
401 | 405 |
402 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ | 406 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ |
OLD | NEW |