| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // ManagedState overrides | 38 // ManagedState overrides |
| 39 // If you change this method, update GetProperties too. | 39 // If you change this method, update GetProperties too. |
| 40 virtual bool PropertyChanged(const std::string& key, | 40 virtual bool PropertyChanged(const std::string& key, |
| 41 const base::Value& value) override; | 41 const base::Value& value) override; |
| 42 virtual bool InitialPropertiesReceived( | 42 virtual bool InitialPropertiesReceived( |
| 43 const base::DictionaryValue& properties) override; | 43 const base::DictionaryValue& properties) override; |
| 44 virtual void GetStateProperties( | 44 virtual void GetStateProperties( |
| 45 base::DictionaryValue* dictionary) const override; | 45 base::DictionaryValue* dictionary) const override; |
| 46 | 46 |
| 47 // Like GetStateProperties, but only sets properties needed for configuration |
| 48 // i.e. no Strength or other properties associated only with visible networks. |
| 49 void GetConfigurationStateProperties(base::DictionaryValue* dictionary) const; |
| 50 |
| 47 void IPConfigPropertiesChanged(const base::DictionaryValue& properties); | 51 void IPConfigPropertiesChanged(const base::DictionaryValue& properties); |
| 48 | 52 |
| 49 // Returns true, if the network requires a service activation. | 53 // Returns true, if the network requires a service activation. |
| 50 bool RequiresActivation() const; | 54 bool RequiresActivation() const; |
| 51 | 55 |
| 52 // Accessors | 56 // Accessors |
| 53 bool visible() const { return visible_; } | 57 bool visible() const { return visible_; } |
| 54 const std::string& security() const { return security_; } | 58 const std::string& security() const { return security_; } |
| 55 const std::string& device_path() const { return device_path_; } | 59 const std::string& device_path() const { return device_path_; } |
| 56 const std::string& guid() const { return guid_; } | 60 const std::string& guid() const { return guid_; } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Helpers (used e.g. when a state or error is cached) | 124 // Helpers (used e.g. when a state or error is cached) |
| 121 static bool StateIsConnected(const std::string& connection_state); | 125 static bool StateIsConnected(const std::string& connection_state); |
| 122 static bool StateIsConnecting(const std::string& connection_state); | 126 static bool StateIsConnecting(const std::string& connection_state); |
| 123 static bool ErrorIsValid(const std::string& error); | 127 static bool ErrorIsValid(const std::string& error); |
| 124 | 128 |
| 125 private: | 129 private: |
| 126 friend class MobileActivatorTest; | 130 friend class MobileActivatorTest; |
| 127 friend class NetworkStateHandler; | 131 friend class NetworkStateHandler; |
| 128 friend class NetworkChangeNotifierChromeosUpdateTest; | 132 friend class NetworkChangeNotifierChromeosUpdateTest; |
| 129 | 133 |
| 134 // Helper method for Get*Properties, gets network sepcific properties. |
| 135 void GetNetworkStateProperties(base::DictionaryValue* dictionary) const; |
| 136 |
| 137 // Helper method for GetStateProperties, gets additional properties |
| 138 // associated with visible networks, e.g. Strength. |
| 139 void GetVisibleStateProperties(base::DictionaryValue* dictionary) const; |
| 140 |
| 141 |
| 130 // Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. | 142 // Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. |
| 131 // Returns true if |name_| changes. | 143 // Returns true if |name_| changes. |
| 132 bool UpdateName(const base::DictionaryValue& properties); | 144 bool UpdateName(const base::DictionaryValue& properties); |
| 133 | 145 |
| 134 // Set to true if the network is a member of Manager.Services. | 146 // Set to true if the network is a member of Manager.Services. |
| 135 bool visible_; | 147 bool visible_; |
| 136 | 148 |
| 137 // Network Service properties. Avoid adding any additional properties here. | 149 // Network Service properties. Avoid adding any additional properties here. |
| 138 // Instead use NetworkConfigurationHandler::GetProperties() to asynchronously | 150 // Instead use NetworkConfigurationHandler::GetProperties() to asynchronously |
| 139 // request properties from Shill. | 151 // request properties from Shill. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler | 192 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler |
| 181 // provides proxy configuration. crbug.com/241775 | 193 // provides proxy configuration. crbug.com/241775 |
| 182 base::DictionaryValue proxy_config_; | 194 base::DictionaryValue proxy_config_; |
| 183 | 195 |
| 184 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 196 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
| 185 }; | 197 }; |
| 186 | 198 |
| 187 } // namespace chromeos | 199 } // namespace chromeos |
| 188 | 200 |
| 189 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 201 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| OLD | NEW |