| 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 #include "chromeos/network/network_util.h" | 5 #include "chromeos/network/network_util.h" |
| 6 | 6 |
| 7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chromeos/network/network_state.h" | 10 #include "chromeos/network/network_state.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return true; | 140 return true; |
| 141 } | 141 } |
| 142 | 142 |
| 143 scoped_ptr<base::DictionaryValue> TranslateNetworkStateToONC( | 143 scoped_ptr<base::DictionaryValue> TranslateNetworkStateToONC( |
| 144 const NetworkState* network) { | 144 const NetworkState* network) { |
| 145 // Get the properties from the NetworkState. | 145 // Get the properties from the NetworkState. |
| 146 base::DictionaryValue shill_dictionary; | 146 base::DictionaryValue shill_dictionary; |
| 147 network->GetStateProperties(&shill_dictionary); | 147 network->GetStateProperties(&shill_dictionary); |
| 148 | 148 |
| 149 scoped_ptr<base::DictionaryValue> onc_dictionary = | 149 scoped_ptr<base::DictionaryValue> onc_dictionary = |
| 150 TranslateShillServiceToONCPart( | 150 TranslateShillServiceToONCPart(shill_dictionary, |
| 151 shill_dictionary, &onc::kNetworkWithStateSignature); | 151 ::onc::ONC_SOURCE_UNKNOWN, |
| 152 &onc::kNetworkWithStateSignature); |
| 152 return onc_dictionary.Pass(); | 153 return onc_dictionary.Pass(); |
| 153 } | 154 } |
| 154 | 155 |
| 155 scoped_ptr<base::ListValue> TranslateNetworkListToONC( | 156 scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
| 156 NetworkTypePattern pattern, | 157 NetworkTypePattern pattern, |
| 157 bool configured_only, | 158 bool configured_only, |
| 158 bool visible_only, | 159 bool visible_only, |
| 159 int limit, | 160 int limit, |
| 160 bool debugging_properties) { | 161 bool debugging_properties) { |
| 161 NetworkStateHandler::NetworkStateList network_states; | 162 NetworkStateHandler::NetworkStateList network_states; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 185 std::string TranslateONCTypeToShill(const std::string& onc_type) { | 186 std::string TranslateONCTypeToShill(const std::string& onc_type) { |
| 186 if (onc_type == ::onc::network_type::kEthernet) | 187 if (onc_type == ::onc::network_type::kEthernet) |
| 187 return shill::kTypeEthernet; | 188 return shill::kTypeEthernet; |
| 188 std::string shill_type; | 189 std::string shill_type; |
| 189 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); | 190 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); |
| 190 return shill_type; | 191 return shill_type; |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace network_util | 194 } // namespace network_util |
| 194 } // namespace chromeos | 195 } // namespace chromeos |
| OLD | NEW |