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 "chrome/browser/chromeos/net/onc_utils.h" | 5 #include "chrome/browser/chromeos/net/onc_utils.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // crbug.com/457936 | 221 // crbug.com/457936 |
222 scoped_ptr<base::DictionaryValue> shill_dict = | 222 scoped_ptr<base::DictionaryValue> shill_dict = |
223 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, | 223 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, |
224 *normalized_network); | 224 *normalized_network); |
225 | 225 |
226 scoped_ptr<NetworkUIData> ui_data( | 226 scoped_ptr<NetworkUIData> ui_data( |
227 NetworkUIData::CreateFromONC(::onc::ONC_SOURCE_USER_IMPORT)); | 227 NetworkUIData::CreateFromONC(::onc::ONC_SOURCE_USER_IMPORT)); |
228 base::DictionaryValue ui_data_dict; | 228 base::DictionaryValue ui_data_dict; |
229 ui_data->FillDictionary(&ui_data_dict); | 229 ui_data->FillDictionary(&ui_data_dict); |
230 std::string ui_data_json; | 230 std::string ui_data_json; |
231 base::JSONWriter::Write(&ui_data_dict, &ui_data_json); | 231 base::JSONWriter::Write(ui_data_dict, &ui_data_json); |
232 shill_dict->SetStringWithoutPathExpansion(shill::kUIDataProperty, | 232 shill_dict->SetStringWithoutPathExpansion(shill::kUIDataProperty, |
233 ui_data_json); | 233 ui_data_json); |
234 | 234 |
235 shill_dict->SetStringWithoutPathExpansion(shill::kProfileProperty, | 235 shill_dict->SetStringWithoutPathExpansion(shill::kProfileProperty, |
236 profile->path); | 236 profile->path); |
237 | 237 |
238 std::string type; | 238 std::string type; |
239 shill_dict->GetStringWithoutPathExpansion(shill::kTypeProperty, &type); | 239 shill_dict->GetStringWithoutPathExpansion(shill::kTypeProperty, &type); |
240 NetworkConfigurationHandler* config_handler = | 240 NetworkConfigurationHandler* config_handler = |
241 NetworkHandler::Get()->network_configuration_handler(); | 241 NetworkHandler::Get()->network_configuration_handler(); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 const PrefService* local_state_prefs, | 452 const PrefService* local_state_prefs, |
453 const NetworkState& network) { | 453 const NetworkState& network) { |
454 ::onc::ONCSource ignored_onc_source; | 454 ::onc::ONCSource ignored_onc_source; |
455 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( | 455 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( |
456 profile_prefs, local_state_prefs, network, &ignored_onc_source); | 456 profile_prefs, local_state_prefs, network, &ignored_onc_source); |
457 return policy != NULL; | 457 return policy != NULL; |
458 } | 458 } |
459 | 459 |
460 } // namespace onc | 460 } // namespace onc |
461 } // namespace chromeos | 461 } // namespace chromeos |
OLD | NEW |