Index: chromeos/network/network_state.h |
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h |
index b5f73761ae7e63cf5a9f36e9abfc0762bb2aa4fd..8e28488bed8303096a37c986ac0503d2b810b5e4 100644 |
--- a/chromeos/network/network_state.h |
+++ b/chromeos/network/network_state.h |
@@ -28,7 +28,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
const std::string& technology() const { return technology_; } |
const std::string& ip_address() const { return ip_address_; } |
const std::string& device_path() const { return device_path_; } |
- const std::string& state() const { return state_; } |
+ const std::string& connection_state() const { return connection_state_; } |
const std::string& error() const { return error_; } |
const std::string& activation_state() const { return activation_state_; } |
const std::string& roaming() const { return roaming_; } |
@@ -37,9 +37,20 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
bool IsConnectedState() const; |
bool IsConnectingState() const; |
+ // Returns true if |type_| == |match_type|, or it matches one of the |
+ // following special match types: |
+ // * kMatchTypeDefault to match any network |
+ // * kMatchTypeNonVirtual to match non virtual networks |
+ // * kMatchTypeWireless to match wireless networks |
+ bool MatchesType(const std::string& match_type) const; |
+ |
// Helpers (used e.g. when a state is cached) |
- static bool StateIsConnected(const std::string& state); |
- static bool StateIsConnecting(const std::string& state); |
+ static bool StateIsConnected(const std::string& connection_state); |
+ static bool StateIsConnecting(const std::string& connection_state); |
+ |
+ static const char kMatchTypeDefault[]; |
+ static const char kMatchTypeWireless[]; |
+ static const char kMatchTypeNonVirtual[]; |
private: |
friend class NetworkStateHandler; |
@@ -53,7 +64,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
std::string security_; |
std::string device_path_; |
std::string ip_address_; |
- std::string state_; |
+ std::string connection_state_; |
std::string error_; |
// Wireless properties |
int signal_strength_; |