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/cros/network_library_impl_base.h" | 5 #include "chrome/browser/chromeos/cros/network_library_impl_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "chrome/browser/chromeos/cros/network_constants.h" | 13 #include "chrome/browser/chromeos/cros/network_constants.h" |
14 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
15 #include "chrome/browser/chromeos/net/onc_utils.h" | 15 #include "chrome/browser/chromeos/net/onc_utils.h" |
16 #include "chrome/browser/chromeos/network_login_observer.h" | 16 #include "chrome/browser/chromeos/network_login_observer.h" |
| 17 #include "chromeos/network/network_ui_data.h" |
17 #include "chromeos/network/onc/onc_certificate_importer.h" | 18 #include "chromeos/network/onc/onc_certificate_importer.h" |
18 #include "chromeos/network/onc/onc_constants.h" | 19 #include "chromeos/network/onc/onc_constants.h" |
19 #include "chromeos/network/onc/onc_normalizer.h" | 20 #include "chromeos/network/onc/onc_normalizer.h" |
20 #include "chromeos/network/onc/onc_signature.h" | 21 #include "chromeos/network/onc/onc_signature.h" |
21 #include "chromeos/network/onc/onc_translator.h" | 22 #include "chromeos/network/onc/onc_translator.h" |
22 #include "chromeos/network/onc/onc_utils.h" | 23 #include "chromeos/network/onc/onc_utils.h" |
23 #include "chromeos/network/onc/onc_validator.h" | 24 #include "chromeos/network/onc/onc_validator.h" |
24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
25 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN. | 26 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN. |
26 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 onc::ConvertOncProxySettingsToProxyConfig(*proxy_settings); | 1231 onc::ConvertOncProxySettingsToProxyConfig(*proxy_settings); |
1231 std::string proxy_json; | 1232 std::string proxy_json; |
1232 base::JSONWriter::Write(proxy_config.get(), &proxy_json); | 1233 base::JSONWriter::Write(proxy_config.get(), &proxy_json); |
1233 shill_dict->SetStringWithoutPathExpansion( | 1234 shill_dict->SetStringWithoutPathExpansion( |
1234 flimflam::kProxyConfigProperty, | 1235 flimflam::kProxyConfigProperty, |
1235 proxy_json); | 1236 proxy_json); |
1236 } | 1237 } |
1237 | 1238 |
1238 // Set the UIData. | 1239 // Set the UIData. |
1239 scoped_ptr<NetworkUIData> ui_data = | 1240 scoped_ptr<NetworkUIData> ui_data = |
1240 onc::CreateUIData(source, *normalized_network); | 1241 chromeos::CreateUIDataFromONC(source, *normalized_network); |
1241 base::DictionaryValue ui_data_dict; | 1242 base::DictionaryValue ui_data_dict; |
1242 ui_data->FillDictionary(&ui_data_dict); | 1243 ui_data->FillDictionary(&ui_data_dict); |
1243 std::string ui_data_json; | 1244 std::string ui_data_json; |
1244 base::JSONWriter::Write(&ui_data_dict, &ui_data_json); | 1245 base::JSONWriter::Write(&ui_data_dict, &ui_data_json); |
1245 shill_dict->SetStringWithoutPathExpansion(flimflam::kUIDataProperty, | 1246 shill_dict->SetStringWithoutPathExpansion(flimflam::kUIDataProperty, |
1246 ui_data_json); | 1247 ui_data_json); |
1247 | 1248 |
1248 // Set the appropriate profile for |source|. | 1249 // Set the appropriate profile for |source|. |
1249 if (profile != NULL) { | 1250 if (profile != NULL) { |
1250 shill_dict->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 1251 shill_dict->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 GetTpmInfo(); | 1799 GetTpmInfo(); |
1799 return tpm_slot_; | 1800 return tpm_slot_; |
1800 } | 1801 } |
1801 | 1802 |
1802 const std::string& NetworkLibraryImplBase::GetTpmPin() { | 1803 const std::string& NetworkLibraryImplBase::GetTpmPin() { |
1803 GetTpmInfo(); | 1804 GetTpmInfo(); |
1804 return tpm_pin_; | 1805 return tpm_pin_; |
1805 } | 1806 } |
1806 | 1807 |
1807 } // namespace chromeos | 1808 } // namespace chromeos |
OLD | NEW |