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 // e.g. a |netmask| of 255.255.255.0 is converted to a prefixlen of 24 | 79 // e.g. a |netmask| of 255.255.255.0 is converted to a prefixlen of 24 |
80 CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask); | 80 CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask); |
81 | 81 |
82 // Parses |list|, which contains DictionaryValues and returns a vector of | 82 // Parses |list|, which contains DictionaryValues and returns a vector of |
83 // CellularScanResult in |scan_results|. Returns false if parsing fails, | 83 // CellularScanResult in |scan_results|. Returns false if parsing fails, |
84 // in which case the contents of |scan_results| will be undefined. | 84 // in which case the contents of |scan_results| will be undefined. |
85 CHROMEOS_EXPORT bool ParseCellularScanResults( | 85 CHROMEOS_EXPORT bool ParseCellularScanResults( |
86 const base::ListValue& list, std::vector<CellularScanResult>* scan_results); | 86 const base::ListValue& list, std::vector<CellularScanResult>* scan_results); |
87 | 87 |
88 // Retrieves the list of network services and translates each into a list of | 88 // Retrieves the list of network services and translates each into a list of |
89 // ONC dictionaries using TranslateShillServiceToONCPart. | 89 // ONC dictionaries using TranslateShillServiceToONCPart. |pattern|, |
90 // |configured_only|, and |visible_only| are passed to | |
91 // NetworkStateHandler::GetFavoriteListByType, and |limit| is used to limit | |
92 // the number of results. | |
90 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( | 93 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
tbarzic
2014/05/13 19:02:58
suggestion: GetNetworkListAsONC may be more suitab
| |
91 NetworkTypePattern pattern); | 94 NetworkTypePattern pattern, |
95 bool configured_only, | |
96 bool visible_only, | |
97 int limit); | |
92 | 98 |
93 } // namespace network_util | 99 } // namespace network_util |
94 } // namespace chromeos | 100 } // namespace chromeos |
95 | 101 |
96 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ | 102 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ |
OLD | NEW |