Chromium Code Reviews| Index: chromeos/network/network_state_handler.h |
| diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h |
| index d695b40186a6ce12f9f59ee5e9654933304b9435..5cfc503ce03f98a946799279872ba5c0ada8b8ec 100644 |
| --- a/chromeos/network/network_state_handler.h |
| +++ b/chromeos/network/network_state_handler.h |
| @@ -69,6 +69,16 @@ class CHROMEOS_EXPORT NetworkStateHandler |
| typedef std::vector<const NetworkState*> NetworkStateList; |
| typedef std::vector<const DeviceState*> DeviceStateList; |
| + // Sorts Tether networks. Because sorting rules are determined by the Tether |
| + // component, a delegate is required to sort the list. |
| + class TetherNetworkListSorter { |
|
stevenjb
2017/06/21 20:59:04
This should probably have Delegate in the name, ma
Kyle Horimoto
2017/06/21 22:17:07
Done.
|
| + public: |
| + // Sorts the list so that the highest-priority networks are in the front of |
| + // the list. |
| + virtual void SortTetherNetworkList( |
| + ManagedStateList* tether_networks) const = 0; |
| + }; |
| + |
| enum TechnologyState { |
| TECHNOLOGY_UNAVAILABLE, |
| TECHNOLOGY_AVAILABLE, |
| @@ -267,6 +277,10 @@ class CHROMEOS_EXPORT NetworkStateHandler |
| // provided |guid| to "Connected". This will be reflected in the UI. |
| void SetTetherNetworkStateConnected(const std::string& guid); |
| + // Sets the sorting delegate for Tether networks. |
| + void SetTetherNetworkListSorter( |
| + const TetherNetworkListSorter* tether_network_list_sorter); |
|
stevenjb
2017/06/21 20:59:04
I wouldn't bother to check the tether technology s
Kyle Horimoto
2017/06/21 22:17:07
Done.
|
| + |
| // Sets |list| to contain the list of devices. The returned list contains |
| // a copy of DeviceState pointers which should not be stored or used beyond |
| // the scope of the calling function (i.e. they may later become invalid, but |
| @@ -523,6 +537,9 @@ class CHROMEOS_EXPORT NetworkStateHandler |
| TechnologyState tether_technology_state_ = |
| TechnologyState::TECHNOLOGY_UNAVAILABLE; |
| + // Not owned by this instance. |
| + const TetherNetworkListSorter* tether_network_list_sorter_ = nullptr; |
| + |
| // Ensure that Shutdown() gets called exactly once. |
| bool did_shutdown_ = false; |