Index: chromeos/network/network_state.cc |
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc |
index c87bdcb4763c9fdef56f09f60e16360a7e83b9d1..8441eeebbc8d735db830e98e1fe1157aca9f6841 100644 |
--- a/chromeos/network/network_state.cc |
+++ b/chromeos/network/network_state.cc |
@@ -9,6 +9,10 @@ |
namespace chromeos { |
+const char NetworkState::kMatchTypeDefault[] = "default"; |
+const char NetworkState::kMatchTypeWireless[] = "wireless"; |
+const char NetworkState::kMatchTypeNonVirtual[] = "non-virtual"; |
+ |
NetworkState::NetworkState(const std::string& path) |
: ManagedState(MANAGED_TYPE_NETWORK, path), |
signal_strength_(0) { |
@@ -49,6 +53,15 @@ bool NetworkState::IsConnectingState() const { |
return StateIsConnecting(state_); |
} |
+bool NetworkState::MatchesType(const std::string& match_type) const { |
+ return ((match_type == kMatchTypeDefault) || |
+ (match_type == type()) || |
+ (match_type == kMatchTypeNonVirtual && |
+ type() != flimflam::kTypeVPN) || |
+ (match_type == kMatchTypeWireless && |
+ type() != flimflam::kTypeEthernet && type() != flimflam::kTypeVPN)); |
+} |
+ |
// static |
bool NetworkState::StateIsConnected(const std::string& state) { |
return (state == flimflam::kStateReady || |