diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 01:33:02 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 01:33:02 +0000 |
commit | 577b22d07f94432f2f9a3f15f2354dc026d70ba5 (patch) | |
tree | 2d32856e81de98eeadb14172154e838d5e107ed5 /chromeos/network/network_state.h | |
parent | c54a9aee2c1cb79f919b55e7ccaadfa5dba594f2 (diff) | |
download | chromium_src-577b22d07f94432f2f9a3f15f2354dc026d70ba5.zip chromium_src-577b22d07f94432f2f9a3f15f2354dc026d70ba5.tar.gz chromium_src-577b22d07f94432f2f9a3f15f2354dc026d70ba5.tar.bz2 |
NetworkState cleanup, pass properties to InitialPropertiesReceived
Some NetworkState cleanup.
This passes the complete dictionary of properties to NetworkState::
InitialPropertesReceived() so that they can be processed without having
to parse and store each individual property.
Also renames technology_ to network_technology_ to match the Shill terminology (and reduce confusion with type_ which is really technology type).
BUG=263978
R=pneubeck@chromium.org
Review URL: https://codereview.chromium.org/21030006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/network_state.h')
-rw-r--r-- | chromeos/network/network_state.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h index fa011c9..8278e5f 100644 --- a/chromeos/network/network_state.h +++ b/chromeos/network/network_state.h @@ -30,7 +30,8 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { // If you change this method, update GetProperties too. virtual bool PropertyChanged(const std::string& key, const base::Value& value) OVERRIDE; - virtual void InitialPropertiesReceived() OVERRIDE; + virtual bool InitialPropertiesReceived( + const base::DictionaryValue& properties) OVERRIDE; // Fills |dictionary| with the state properties. All the properties that are // accepted by PropertyChanged are stored in |dictionary|, no other values are @@ -66,7 +67,9 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { bool passphrase_required() const { return passphrase_required_; } const FrequencyList& wifi_frequencies() const { return wifi_frequencies_; } // Cellular property accessors - const std::string& technology() const { return technology_; } + const std::string& network_technology() const { + return network_technology_; + } const std::string& activation_state() const { return activation_state_; } const std::string& roaming() const { return roaming_; } bool activate_over_non_cellular_networks() const { @@ -78,11 +81,15 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { const std::string& post_method() const { return post_method_; } const std::string& post_data() const { return post_data_; } + // Returns true if |connection_state_| is a connected/connecting state. bool IsConnectedState() const; bool IsConnectingState() const; + // Returns true if the ONC source is a device or user policy. bool IsManaged() const; - bool IsShared() const; + + // Returns true if the network properties are stored in a user profile. + bool IsPrivate() const; // Returns a comma separated string of name servers. std::string GetDnsServersAsString() const; @@ -109,8 +116,9 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { friend class NetworkStateHandler; friend class NetworkChangeNotifierChromeosUpdateTest; - // Updates the name from hex_ssid_ if provided, and validates name_. - void UpdateName(); + // Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. + // Returns true if |name_| changes. + bool UpdateName(const base::DictionaryValue& properties); // TODO(gauravsh): Audit the list of properties that we are caching. We should // only be doing this for commonly accessed properties. crbug.com/252553 @@ -140,12 +148,10 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { int signal_strength_; bool connectable_; // Wifi properties - std::string hex_ssid_; - std::string country_code_; bool passphrase_required_; FrequencyList wifi_frequencies_; // Cellular properties - std::string technology_; + std::string network_technology_; std::string activation_state_; std::string roaming_; bool activate_over_non_cellular_networks_; |