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 |
11 // functions provided by this header. | 11 // functions provided by this header. |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "chromeos/chromeos_export.h" | 21 #include "chromeos/chromeos_export.h" |
| 22 #include "components/onc/onc_constants.h" |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class ListValue; | 25 class ListValue; |
25 } | 26 } |
26 | 27 |
27 namespace chromeos { | 28 namespace chromeos { |
28 | 29 |
29 class NetworkState; | 30 class NetworkState; |
30 class NetworkTypePattern; | 31 class NetworkTypePattern; |
31 | 32 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // dictionaries using TranslateShillServiceToONCPart. |limit| is used to limit | 104 // dictionaries using TranslateShillServiceToONCPart. |limit| is used to limit |
104 // the number of results. If |debugging_properties| is true then also include | 105 // the number of results. If |debugging_properties| is true then also include |
105 // additional debugging properties (used in release code for chrome://network). | 106 // additional debugging properties (used in release code for chrome://network). |
106 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( | 107 CHROMEOS_EXPORT scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
107 NetworkTypePattern pattern, | 108 NetworkTypePattern pattern, |
108 bool configured_only, | 109 bool configured_only, |
109 bool visible_only, | 110 bool visible_only, |
110 int limit, | 111 int limit, |
111 bool debugging_properties); | 112 bool debugging_properties); |
112 | 113 |
| 114 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> TranslateShillPropertiesToONC( |
| 115 const std::string& service_path, |
| 116 const base::DictionaryValue& shill_properties, |
| 117 ::onc::ONCSource onc_source); |
| 118 |
113 // Returns the Shill type corresponding to ONC |type| or an empty string if | 119 // Returns the Shill type corresponding to ONC |type| or an empty string if |
114 // there is no match. Only valid for ethernet, wifi, wimax, cellular, and vpn. | 120 // there is no match. Only valid for ethernet, wifi, wimax, cellular, and vpn. |
115 CHROMEOS_EXPORT std::string TranslateONCTypeToShill(const std::string& type); | 121 CHROMEOS_EXPORT std::string TranslateONCTypeToShill(const std::string& type); |
116 | 122 |
117 // Inverse of TranslateONCTypeToShill. | 123 // Inverse of TranslateONCTypeToShill. |
118 CHROMEOS_EXPORT std::string TranslateShillTypeToONC(const std::string& type); | 124 CHROMEOS_EXPORT std::string TranslateShillTypeToONC(const std::string& type); |
119 | 125 |
120 } // namespace network_util | 126 } // namespace network_util |
121 } // namespace chromeos | 127 } // namespace chromeos |
122 | 128 |
123 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ | 129 #endif // CHROMEOS_NETWORK_NETWORK_UTIL_H_ |
OLD | NEW |