OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/managed_network_configuration_handler.h" | 5 #include "chromeos/network/managed_network_configuration_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chromeos/network/network_state.h" | 30 #include "chromeos/network/network_state.h" |
31 #include "chromeos/network/network_state_handler.h" | 31 #include "chromeos/network/network_state_handler.h" |
32 #include "chromeos/network/network_ui_data.h" | 32 #include "chromeos/network/network_ui_data.h" |
33 #include "chromeos/network/onc/onc_constants.h" | 33 #include "chromeos/network/onc/onc_constants.h" |
34 #include "chromeos/network/onc/onc_merger.h" | 34 #include "chromeos/network/onc/onc_merger.h" |
35 #include "chromeos/network/onc/onc_signature.h" | 35 #include "chromeos/network/onc/onc_signature.h" |
36 #include "chromeos/network/onc/onc_translator.h" | 36 #include "chromeos/network/onc/onc_translator.h" |
37 #include "chromeos/network/onc/onc_utils.h" | 37 #include "chromeos/network/onc/onc_utils.h" |
38 #include "chromeos/network/onc/onc_validator.h" | 38 #include "chromeos/network/onc/onc_validator.h" |
39 #include "dbus/object_path.h" | 39 #include "dbus/object_path.h" |
| 40 #include "net/cert/x509_certificate.h" |
40 #include "third_party/cros_system_api/dbus/service_constants.h" | 41 #include "third_party/cros_system_api/dbus/service_constants.h" |
41 | 42 |
42 namespace chromeos { | 43 namespace chromeos { |
43 | 44 |
44 namespace { | 45 namespace { |
45 | 46 |
46 // These are error strings used for error callbacks. None of these error | 47 // These are error strings used for error callbacks. None of these error |
47 // messages are user-facing: they should only appear in logs. | 48 // messages are user-facing: they should only appear in logs. |
48 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; | 49 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; |
49 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; | 50 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } else { | 191 } else { |
191 NOTREACHED(); | 192 NOTREACHED(); |
192 onc_source = onc::ONC_SOURCE_NONE; | 193 onc_source = onc::ONC_SOURCE_NONE; |
193 } | 194 } |
194 | 195 |
195 RemoveFakeCredentials(onc::kNetworkConfigurationSignature, | 196 RemoveFakeCredentials(onc::kNetworkConfigurationSignature, |
196 effective.get()); | 197 effective.get()); |
197 | 198 |
198 effective->SetStringWithoutPathExpansion(onc::network_config::kGUID, guid); | 199 effective->SetStringWithoutPathExpansion(onc::network_config::kGUID, guid); |
199 | 200 |
| 201 net::CertificateList server_and_ca_certs; |
| 202 // TODO(pneubeck): Obtain list of server/ca certificates here. |
| 203 |
200 scoped_ptr<base::DictionaryValue> shill_dictionary( | 204 scoped_ptr<base::DictionaryValue> shill_dictionary( |
201 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, | 205 onc::TranslateONCObjectToShill( |
202 *effective)); | 206 &onc::kNetworkConfigurationSignature, |
| 207 *effective, |
| 208 base::Bind(&onc::GetPEMEncodedCertFromFingerprint, |
| 209 server_and_ca_certs))); |
203 | 210 |
204 shill_dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 211 shill_dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
205 profile.path); | 212 profile.path); |
206 | 213 |
207 scoped_ptr<NetworkUIData> ui_data; | 214 scoped_ptr<NetworkUIData> ui_data; |
208 if (policy) | 215 if (policy) |
209 ui_data = NetworkUIData::CreateFromONC(onc_source, *policy); | 216 ui_data = NetworkUIData::CreateFromONC(onc_source, *policy); |
210 else | 217 else |
211 ui_data.reset(new NetworkUIData()); | 218 ui_data.reset(new NetworkUIData()); |
212 | 219 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 NetworkStateHandler* network_state_handler, | 915 NetworkStateHandler* network_state_handler, |
909 NetworkProfileHandler* network_profile_handler, | 916 NetworkProfileHandler* network_profile_handler, |
910 NetworkConfigurationHandler* network_configuration_handler) { | 917 NetworkConfigurationHandler* network_configuration_handler) { |
911 network_state_handler_ = network_state_handler; | 918 network_state_handler_ = network_state_handler; |
912 network_profile_handler_ = network_profile_handler; | 919 network_profile_handler_ = network_profile_handler; |
913 network_configuration_handler_ = network_configuration_handler; | 920 network_configuration_handler_ = network_configuration_handler; |
914 network_profile_handler_->AddObserver(this); | 921 network_profile_handler_->AddObserver(this); |
915 } | 922 } |
916 | 923 |
917 } // namespace chromeos | 924 } // namespace chromeos |
OLD | NEW |