| 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_UTIL_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_UTIL_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_UTIL_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_UTIL_H_ |
| 7 | 7 |
| 8 // This header is introduced to make it easy to switch from chromeos_network.cc | 8 // This header is introduced to make it easy to switch from chromeos_network.cc |
| 9 // to Chrome's own DBus code. crosbug.com/16557 | 9 // to Chrome's own DBus code. crosbug.com/16557 |
| 10 // All calls to functions in chromeos_network.h should be made through | 10 // All calls to functions in chromeos_network.h should be made through |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Converts a |netmask| to a prefixlen. (for IPv4 only) | 79 // Converts a |netmask| to a prefixlen. (for IPv4 only) |
| 80 // e.g. a |netmask| of 255.255.255.0 is converted to a prefixlen of 24 | 80 // e.g. a |netmask| of 255.255.255.0 is converted to a prefixlen of 24 |
| 81 CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask); | 81 CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask); |
| 82 | 82 |
| 83 // Parses |list|, which contains DictionaryValues and returns a vector of | 83 // Parses |list|, which contains DictionaryValues and returns a vector of |
| 84 // CellularScanResult in |scan_results|. Returns false if parsing fails, | 84 // CellularScanResult in |scan_results|. Returns false if parsing fails, |
| 85 // in which case the contents of |scan_results| will be undefined. | 85 // in which case the contents of |scan_results| will be undefined. |
| 86 CHROMEOS_EXPORT bool ParseCellularScanResults( | 86 CHROMEOS_EXPORT bool ParseCellularScanResults( |
| 87 const base::ListValue& list, std::vector<CellularScanResult>* scan_results); | 87 const base::ListValue& list, std::vector<CellularScanResult>* scan_results); |
| 88 | 88 |
| 89 // Retrieves the list of visible network services by passing |pattern| to | 89 // Retrieves the list of visible network services by passing |pattern|, |
| 90 // NetworkStateHandler::GetNetworkListByType() and translates each into a list | 90 // |configured_only|, and |visible_only| to NetworkStateHandler:: |
| 91 // of ONC dictionaries using TranslateShillServiceToONCPart. | 91 // GetNetworkListByType(). Translates the result into a list of ONC |
| 92 // dictionaries using TranslateShillServiceToONCPart. |limit| is used to limit |
| 93 // the number of results. |
| 92 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( | 94 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
| 93 NetworkTypePattern pattern); | 95 NetworkTypePattern pattern, |
| 96 bool configured_only, |
| 97 bool visible_only, |
| 98 int limit); |
| 94 | 99 |
| 95 } // namespace network_util | 100 } // namespace network_util |
| 96 } // namespace chromeos | 101 } // namespace chromeos |
| 97 | 102 |
| 98 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ | 103 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ |
| OLD | NEW |