Index: chromeos/network/network_state_handler.h |
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h |
index 99398bc90124f766cb8d7f79bf9aeb7d128155fb..2866d3c4b0d5330da04eec2151f96ba7286a54c9 100644 |
--- a/chromeos/network/network_state_handler.h |
+++ b/chromeos/network/network_state_handler.h |
@@ -91,7 +91,8 @@ class CHROMEOS_EXPORT NetworkStateHandler |
const tracked_objects::Location& from_here); |
// Returns the state for technology |type|. Only |
- // NetworkTypePattern::Primitive, ::Mobile and ::Ethernet are supported. |
+ // NetworkTypePattern::Primitive, ::Mobile, ::Ethernet, and ::Tether are |
+ // supported. |
TechnologyState GetTechnologyState(const NetworkTypePattern& type) const; |
bool IsTechnologyAvailable(const NetworkTypePattern& type) const { |
return GetTechnologyState(type) != TECHNOLOGY_UNAVAILABLE; |
@@ -181,6 +182,15 @@ class CHROMEOS_EXPORT NetworkStateHandler |
int limit, |
NetworkStateList* list); |
+ // Sets |list| to contain the list of "tether" networks. If |limit| > 0, that |
+ // will determine the number of results; pass 0 for no limit. The returned |
+ // list contains a copy of NetworkState pointers which should not be stored or |
+ // used beyond the scope of the calling function (i.e. they may later become |
+ // invalid, but only on the UI thread). |
+ // NOTE: See AddTetherNetworkState for more information about "tether" |
+ // networks. |
+ void GetTetherNetworkList(int limit, NetworkStateList* list); |
+ |
// Finds and returns the NetworkState associated with |service_path| or NULL |
// if not found. If |configured_only| is true, only returns saved entries |
// (IsInProfile is true). |
@@ -194,14 +204,15 @@ class CHROMEOS_EXPORT NetworkStateHandler |
// Creates a "tether" NetworkState that has no underlying shill type or |
// service. When initially created, it does not actually represent a real |
- // network. Generates and returns a guid to be used to refer to and fetch this |
- // NetworkState in the future. |
+ // network. The |guid| provided must be non-empty. If a network with |guid| |
+ // already exists, this method will do nothing. Use the provided |guid| to |
+ // refer to and fetch this NetworkState in the future. |
// NOTE: only GetNetworkStateFromGuid is supported to fetch "tether" |
// NetworkStates. |
- const std::string CreateTetherNetworkState(const std::string& name); |
+ void AddTetherNetworkState(const std::string& guid, const std::string& name); |
- // Remove a "tether" NetworkState, using the same guid that was returned by |
- // CreateTetherNetworkState. |
+ // Remove a "tether" NetworkState, using the same |guid| passed to |
+ // AddTetherNetworkState. |
void RemoveTetherNetworkState(const std::string& guid); |
// Sets |list| to contain the list of devices. The returned list contains |