| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 std::string GetNetmask() const; | 98 std::string GetNetmask() const; |
| 99 | 99 |
| 100 // Helpers (used e.g. when a state is cached) | 100 // Helpers (used e.g. when a state is cached) |
| 101 static bool StateIsConnected(const std::string& connection_state); | 101 static bool StateIsConnected(const std::string& connection_state); |
| 102 static bool StateIsConnecting(const std::string& connection_state); | 102 static bool StateIsConnecting(const std::string& connection_state); |
| 103 | 103 |
| 104 // Helper to return a full prefixed version of an IPConfig property | 104 // Helper to return a full prefixed version of an IPConfig property |
| 105 // key. | 105 // key. |
| 106 static std::string IPConfigProperty(const char* key); | 106 static std::string IPConfigProperty(const char* key); |
| 107 | 107 |
| 108 // Sets |out| to the UIData specified by |value|. Returns true if successfully | |
| 109 // parsed. | |
| 110 static bool GetUIDataFromValue(const base::Value& value, NetworkUIData* out); | |
| 111 | |
| 112 // Generates a name from properties."Wifi.HexSSID" if present, otherwise | |
| 113 // validates properties.Name and returns a valid utf8 version. | |
| 114 static std::string GetNameFromProperties( | |
| 115 const std::string& service_path, | |
| 116 const base::DictionaryValue& properties); | |
| 117 | 108 |
| 118 private: | 109 private: |
| 119 friend class NetworkStateHandler; | 110 friend class NetworkStateHandler; |
| 120 friend class NetworkChangeNotifierChromeosUpdateTest; | 111 friend class NetworkChangeNotifierChromeosUpdateTest; |
| 121 | 112 |
| 122 // Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. | 113 // Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. |
| 123 // Returns true if |name_| changes. | 114 // Returns true if |name_| changes. |
| 124 bool UpdateName(const base::DictionaryValue& properties); | 115 bool UpdateName(const base::DictionaryValue& properties); |
| 125 | 116 |
| 126 // TODO(gauravsh): Audit the list of properties that we are caching. We should | 117 // TODO(gauravsh): Audit the list of properties that we are caching. We should |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Whether a deprecated CaCertNSS property of this network is set. Required | 156 // Whether a deprecated CaCertNSS property of this network is set. Required |
| 166 // for migration to PEM. | 157 // for migration to PEM. |
| 167 bool has_ca_cert_nss_; | 158 bool has_ca_cert_nss_; |
| 168 | 159 |
| 169 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 160 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
| 170 }; | 161 }; |
| 171 | 162 |
| 172 } // namespace chromeos | 163 } // namespace chromeos |
| 173 | 164 |
| 174 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 165 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| OLD | NEW |