| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHILL_PROPERTY_UTIL_H_ | 5 #ifndef CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
| 6 #define CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ | 6 #define CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class DictionaryValue; | 14 class DictionaryValue; |
| 15 class Value; | 15 class Value; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 class NetworkUIData; | 20 class NetworkUIData; |
| 21 | 21 |
| 22 namespace shill_property_util { | 22 namespace shill_property_util { |
| 23 | 23 |
| 24 // Sets the |ssid| in |properties|. | 24 // Sets the |ssid| in |properties|. |
| 25 CHROMEOS_EXPORT void SetSSID(const std::string ssid, | 25 CHROMEOS_EXPORT void SetSSID(const std::string ssid, |
| 26 base::DictionaryValue* properties); | 26 base::DictionaryValue* properties); |
| 27 | 27 |
| 28 // Returns the SSID from |properties| in UTF-8 encoding. If |unknown_encoding| | 28 // Returns the SSID from |properties| in UTF-8 encoding. If |verbose_logging| is |
| 29 // is not NULL, it is set to whether the SSID is of unknown encoding. | 29 // true, detailed DEBUG log events will be added to the device event log. If |
| 30 // |unknown_encoding| != nullptr, it is set to whether the SSID is of unknown |
| 31 // encoding. |
| 30 CHROMEOS_EXPORT std::string GetSSIDFromProperties( | 32 CHROMEOS_EXPORT std::string GetSSIDFromProperties( |
| 31 const base::DictionaryValue& properties, | 33 const base::DictionaryValue& properties, |
| 34 bool verbose_logging, |
| 32 bool* unknown_encoding); | 35 bool* unknown_encoding); |
| 33 | 36 |
| 34 // Returns the GUID (if available), SSID, or Name from |properties|. Only used | 37 // Returns the GUID (if available), SSID, or Name from |properties|. Only used |
| 35 // for logging and debugging. | 38 // for logging and debugging. |
| 36 CHROMEOS_EXPORT std::string GetNetworkIdFromProperties( | 39 CHROMEOS_EXPORT std::string GetNetworkIdFromProperties( |
| 37 const base::DictionaryValue& properties); | 40 const base::DictionaryValue& properties); |
| 38 | 41 |
| 39 // Returns the name for the network represented by the Shill |properties|. For | 42 // Returns the name for the network represented by the Shill |properties|. For |
| 40 // WiFi it refers to the HexSSID. | 43 // WiFi it refers to the HexSSID. |
| 41 CHROMEOS_EXPORT std::string GetNameFromProperties( | 44 CHROMEOS_EXPORT std::string GetNameFromProperties( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Parses |value| (which should be a Dictionary). Returns true and sets | 88 // Parses |value| (which should be a Dictionary). Returns true and sets |
| 86 // |home_provider_id| if |value| was succesfully parsed. | 89 // |home_provider_id| if |value| was succesfully parsed. |
| 87 bool GetHomeProviderFromProperty(const base::Value& value, | 90 bool GetHomeProviderFromProperty(const base::Value& value, |
| 88 std::string* home_provider_id); | 91 std::string* home_provider_id); |
| 89 | 92 |
| 90 } // namespace shill_property_util | 93 } // namespace shill_property_util |
| 91 | 94 |
| 92 } // namespace chromeos | 95 } // namespace chromeos |
| 93 | 96 |
| 94 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ | 97 #endif // CHROMEOS_NETWORK_SHILL_PROPERTY_UTIL_H_ |
| OLD | NEW |