Index: chromeos/network/network_state.h |
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h |
index 3f64a07ae6b86bbf5388e8ff7f70ef282ecc8e5c..37c5d146aa770cbcdb4e4f2d3e2e12403544c97e 100644 |
--- a/chromeos/network/network_state.h |
+++ b/chromeos/network/network_state.h |
@@ -7,6 +7,10 @@ |
#include "chromeos/network/managed_state.h" |
+namespace base { |
+class DictionaryValue; |
+} |
+ |
namespace chromeos { |
// Simple class to provide network state information about a network service. |
@@ -19,20 +23,26 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
explicit NetworkState(const std::string& path); |
virtual ~NetworkState(); |
- // ManagedState overrides |
+ // ManagedState overrides. |
+ // If you change this method, update GetProperties too. |
stevenjb
2013/03/07 18:29:54
nit: We should probably describe this function too
pneubeck (no reviews)
2013/03/07 19:26:36
This function is already documented in the base cl
|
virtual bool PropertyChanged(const std::string& key, |
const base::Value& value) OVERRIDE; |
- // Accessors |
+ // Fills |dictionary| with the state properties. All the properties that are |
+ // accepted by PropertyChanged are stored in |dictionary|, no other values are |
+ // stored. |
+ void GetProperties(base::DictionaryValue* dictionary) const; |
+ |
+ // Accessors. |
const std::string& security() const { return security_; } |
const std::string& ip_address() const { return ip_address_; } |
const std::string& device_path() const { return device_path_; } |
const std::string& guid() const { return guid_; } |
const std::string& connection_state() const { return connection_state_; } |
const std::string& error() const { return error_; } |
- // Wireless property accessors |
+ // Wireless property accessors. |
int signal_strength() const { return signal_strength_; } |
- // Cellular property accessors |
+ // Cellular property accessors. |
const std::string& technology() const { return technology_; } |
const std::string& activation_state() const { return activation_state_; } |
const std::string& roaming() const { return roaming_; } |
@@ -40,7 +50,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
bool IsConnectedState() const; |
bool IsConnectingState() const; |
- // Helpers (used e.g. when a state is cached) |
+ // Helpers (used e.g. when a state is cached). |
static bool StateIsConnected(const std::string& connection_state); |
static bool StateIsConnecting(const std::string& connection_state); |
@@ -53,16 +63,16 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
ip_address_ = ip_address; |
} |
- // Common Network Service properties |
+ // Common Network Service properties. |
std::string security_; |
std::string device_path_; |
std::string guid_; |
std::string ip_address_; |
std::string connection_state_; |
std::string error_; |
- // Wireless properties |
+ // Wireless properties. |
int signal_strength_; |
- // Cellular properties |
+ // Cellular properties. |
std::string technology_; |
std::string activation_state_; |
std::string roaming_; |