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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 it != network_states.end(); | 168 it != network_states.end(); |
169 ++it) { | 169 ++it) { |
170 scoped_ptr<base::DictionaryValue> onc_dictionary = | 170 scoped_ptr<base::DictionaryValue> onc_dictionary = |
171 TranslateNetworkStateToONC(*it); | 171 TranslateNetworkStateToONC(*it); |
172 | 172 |
173 if (debugging_properties) { | 173 if (debugging_properties) { |
174 onc_dictionary->SetBoolean("connectable", (*it)->connectable()); | 174 onc_dictionary->SetBoolean("connectable", (*it)->connectable()); |
175 onc_dictionary->SetBoolean("visible", (*it)->visible()); | 175 onc_dictionary->SetBoolean("visible", (*it)->visible()); |
176 onc_dictionary->SetString("profile_path", (*it)->profile_path()); | 176 onc_dictionary->SetString("profile_path", (*it)->profile_path()); |
177 onc_dictionary->SetString("service_path", (*it)->path()); | 177 onc_dictionary->SetString("service_path", (*it)->path()); |
178 std::string onc_source = (*it)->ui_data().GetONCSourceAsString(); | |
179 if (!onc_source.empty()) | |
180 onc_dictionary->SetString("onc_source", onc_source); | |
181 } | 178 } |
182 | 179 |
183 network_properties_list->Append(onc_dictionary.release()); | 180 network_properties_list->Append(onc_dictionary.release()); |
184 } | 181 } |
185 return network_properties_list.Pass(); | 182 return network_properties_list.Pass(); |
186 } | 183 } |
187 | 184 |
188 std::string TranslateONCTypeToShill(const std::string& onc_type) { | 185 std::string TranslateONCTypeToShill(const std::string& onc_type) { |
189 if (onc_type == ::onc::network_type::kEthernet) | 186 if (onc_type == ::onc::network_type::kEthernet) |
190 return shill::kTypeEthernet; | 187 return shill::kTypeEthernet; |
191 std::string shill_type; | 188 std::string shill_type; |
192 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); | 189 onc::TranslateStringToShill(onc::kNetworkTypeTable, onc_type, &shill_type); |
193 return shill_type; | 190 return shill_type; |
194 } | 191 } |
195 | 192 |
196 } // namespace network_util | 193 } // namespace network_util |
197 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |