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

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

Issue 23451044: Add an Ethernet EAP policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 2 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_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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // only on the UI thread). 161 // only on the UI thread).
162 void GetDeviceList(DeviceStateList* list) const; 162 void GetDeviceList(DeviceStateList* list) const;
163 163
164 // Sets |list| to contain the list of favorite (aka "preferred") networks. 164 // Sets |list| to contain the list of favorite (aka "preferred") networks.
165 // See GetNetworkList() for usage, and notes for |favorite_list_|. 165 // See GetNetworkList() for usage, and notes for |favorite_list_|.
166 // Favorites that are visible have the same path() as the entries in 166 // Favorites that are visible have the same path() as the entries in
167 // GetNetworkList(), so GetNetworkState() can be used to determine if a 167 // GetNetworkList(), so GetNetworkState() can be used to determine if a
168 // favorite is visible and retrieve the complete properties (and vice-versa). 168 // favorite is visible and retrieve the complete properties (and vice-versa).
169 void GetFavoriteList(FavoriteStateList* list) const; 169 void GetFavoriteList(FavoriteStateList* list) const;
170 170
171 // Like GetFavoriteList() but only returns favorites with matching |type|.
172 void GetFavoriteListByType(const NetworkTypePattern& type,
173 FavoriteStateList* list) const;
174
171 // Finds and returns a favorite state by |service_path| or NULL if not found. 175 // Finds and returns a favorite state by |service_path| or NULL if not found.
172 const FavoriteState* GetFavoriteState(const std::string& service_path) const; 176 const FavoriteState* GetFavoriteState(const std::string& service_path) const;
173 177
174 // Requests a network scan. This may trigger updates to the network 178 // Requests a network scan. This may trigger updates to the network
175 // list, which will trigger the appropriate observer calls. 179 // list, which will trigger the appropriate observer calls.
176 void RequestScan() const; 180 void RequestScan() const;
177 181
178 // Request a scan if not scanning and run |callback| when the Scanning state 182 // Request a scan if not scanning and run |callback| when the Scanning state
179 // for any Device of network type |type| completes. 183 // for any Device of network type |type| completes.
180 void WaitForScan(const std::string& type, const base::Closure& callback); 184 void WaitForScan(const std::string& type, const base::Closure& callback);
(...skipping 16 matching lines...) Expand all
197 // existing networks. 201 // existing networks.
198 void RequestUpdateForAllNetworks(); 202 void RequestUpdateForAllNetworks();
199 203
200 // Set the list of devices on which portal check is enabled. 204 // Set the list of devices on which portal check is enabled.
201 void SetCheckPortalList(const std::string& check_portal_list); 205 void SetCheckPortalList(const std::string& check_portal_list);
202 206
203 const std::string& GetCheckPortalListForTest() const { 207 const std::string& GetCheckPortalListForTest() const {
204 return check_portal_list_; 208 return check_portal_list_;
205 } 209 }
206 210
211 // Returns the FavoriteState of the EthernetEAP service, which contains the
212 // EAP parameters used by the ethernet with |service_path|. If |service_path|
213 // doesn't refer to an ethernet service or if the ethernet service is not
214 // connected using EAP, returns NULL.
215 const FavoriteState* GetEAPForEthernet(const std::string& service_path) const;
216
207 // Generates a DictionaryValue of all NetworkState properties. Currently 217 // Generates a DictionaryValue of all NetworkState properties. Currently
208 // provided for debugging purposes only. 218 // provided for debugging purposes only.
209 void GetNetworkStatePropertiesForTest( 219 void GetNetworkStatePropertiesForTest(
210 base::DictionaryValue* dictionary) const; 220 base::DictionaryValue* dictionary) const;
211 221
212 // Construct and initialize an instance for testing. 222 // Construct and initialize an instance for testing.
213 static NetworkStateHandler* InitializeForTest(); 223 static NetworkStateHandler* InitializeForTest();
214 224
215 // Default set of comma separated interfaces on which to enable 225 // Default set of comma separated interfaces on which to enable
216 // portal checking. 226 // portal checking.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Helper function to notify observers. Calls CheckDefaultNetworkChanged(). 308 // Helper function to notify observers. Calls CheckDefaultNetworkChanged().
299 void OnNetworkConnectionStateChanged(NetworkState* network); 309 void OnNetworkConnectionStateChanged(NetworkState* network);
300 310
301 // If the default network changed returns true and sets 311 // If the default network changed returns true and sets
302 // |default_network_path_|. 312 // |default_network_path_|.
303 bool CheckDefaultNetworkChanged(); 313 bool CheckDefaultNetworkChanged();
304 314
305 // Logs an event and notifies observers. 315 // Logs an event and notifies observers.
306 void OnDefaultNetworkChanged(); 316 void OnDefaultNetworkChanged();
307 317
308 // Notifies observers and updates connecting_network_. 318 // Notifies observers about changes to |network|.
309 void NetworkPropertiesUpdated(const NetworkState* network); 319 void NetworkPropertiesUpdated(const NetworkState* network);
310 320
311 // Called whenever Device.Scanning state transitions to false. 321 // Called whenever Device.Scanning state transitions to false.
312 void ScanCompleted(const std::string& type); 322 void ScanCompleted(const std::string& type);
313 323
314 // Returns the technology type for |type|. 324 // Returns the technology type for |type|.
315 std::string GetTechnologyForType(const NetworkTypePattern& type) const; 325 std::string GetTechnologyForType(const NetworkTypePattern& type) const;
316 326
317 // Shill property handler instance, owned by this class. 327 // Shill property handler instance, owned by this class.
318 scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_; 328 scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_;
(...skipping 20 matching lines...) Expand all
339 349
340 // Callbacks to run when a scan for the technology type completes. 350 // Callbacks to run when a scan for the technology type completes.
341 ScanCompleteCallbackMap scan_complete_callbacks_; 351 ScanCompleteCallbackMap scan_complete_callbacks_;
342 352
343 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); 353 DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler);
344 }; 354 };
345 355
346 } // namespace chromeos 356 } // namespace chromeos
347 357
348 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_ 358 #endif // CHROMEOS_NETWORK_NETWORK_STATE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698