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 27 matching lines...) Expand all Loading... |
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 "third_party/cros_system_api/dbus/service_constants.h" | 40 #include "third_party/cros_system_api/dbus/service_constants.h" |
41 | 41 |
42 namespace chromeos { | 42 namespace chromeos { |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 // These are error strings used for error callbacks. None of these error | 46 // These are error strings used for error callbacks. None of these error |
47 // messages are user-facing: they should only appear in logs. | 47 // messages are user-facing: they should only appear in logs. |
| 48 const char kCertificatesNotLoadedMessage[] = "Certificates not loaded."; |
| 49 const char kCertificatesNotLoaded[] = "Error.CertificatesNotLoaded"; |
48 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; | 50 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; |
49 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; | 51 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; |
50 const char kNetworkAlreadyConfiguredMessage[] = | 52 const char kNetworkAlreadyConfiguredMessage[] = |
51 "Network is already configured."; | 53 "Network is already configured."; |
52 const char kNetworkAlreadyConfigured[] = "Error.NetworkAlreadyConfigured"; | 54 const char kNetworkAlreadyConfigured[] = "Error.NetworkAlreadyConfigured"; |
53 const char kPoliciesNotInitializedMessage[] = "Policies not initialized."; | 55 const char kPoliciesNotInitializedMessage[] = "Policies not initialized."; |
54 const char kPoliciesNotInitialized[] = "Error.PoliciesNotInitialized"; | 56 const char kPoliciesNotInitialized[] = "Error.PoliciesNotInitialized"; |
55 const char kProfileNotInitializedMessage[] = "Profile not initialized."; | 57 const char kProfileNotInitializedMessage[] = "Profile not initialized."; |
56 const char kProfileNotInitialized[] = "Error.ProflieNotInitialized"; | 58 const char kProfileNotInitialized[] = "Error.ProflieNotInitialized"; |
57 const char kSetOnUnconfiguredNetworkMessage[] = | 59 const char kSetOnUnconfiguredNetworkMessage[] = |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } else { | 192 } else { |
191 NOTREACHED(); | 193 NOTREACHED(); |
192 onc_source = onc::ONC_SOURCE_NONE; | 194 onc_source = onc::ONC_SOURCE_NONE; |
193 } | 195 } |
194 | 196 |
195 RemoveFakeCredentials(onc::kNetworkConfigurationSignature, | 197 RemoveFakeCredentials(onc::kNetworkConfigurationSignature, |
196 effective.get()); | 198 effective.get()); |
197 | 199 |
198 effective->SetStringWithoutPathExpansion(onc::network_config::kGUID, guid); | 200 effective->SetStringWithoutPathExpansion(onc::network_config::kGUID, guid); |
199 | 201 |
| 202 net::CertificateList server_and_ca_certs; |
| 203 // TODO(pneubeck): Obtain list of server/ca certificates here. |
| 204 |
200 scoped_ptr<base::DictionaryValue> shill_dictionary( | 205 scoped_ptr<base::DictionaryValue> shill_dictionary( |
201 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, | 206 onc::TranslateONCObjectToShill( |
202 *effective)); | 207 &onc::kNetworkConfigurationSignature, |
| 208 *effective, |
| 209 base::Bind(&onc::GetPEMEncodedCertFromFingerprint, |
| 210 server_and_ca_certs))); |
203 | 211 |
204 shill_dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 212 shill_dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
205 profile.path); | 213 profile.path); |
206 | 214 |
207 scoped_ptr<NetworkUIData> ui_data; | 215 scoped_ptr<NetworkUIData> ui_data; |
208 if (policy) | 216 if (policy) |
209 ui_data = NetworkUIData::CreateFromONC(onc_source, *policy); | 217 ui_data = NetworkUIData::CreateFromONC(onc_source, *policy); |
210 else | 218 else |
211 ui_data.reset(new NetworkUIData()); | 219 ui_data.reset(new NetworkUIData()); |
212 | 220 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 NetworkStateHandler* network_state_handler, | 916 NetworkStateHandler* network_state_handler, |
909 NetworkProfileHandler* network_profile_handler, | 917 NetworkProfileHandler* network_profile_handler, |
910 NetworkConfigurationHandler* network_configuration_handler) { | 918 NetworkConfigurationHandler* network_configuration_handler) { |
911 network_state_handler_ = network_state_handler; | 919 network_state_handler_ = network_state_handler; |
912 network_profile_handler_ = network_profile_handler; | 920 network_profile_handler_ = network_profile_handler; |
913 network_configuration_handler_ = network_configuration_handler; | 921 network_configuration_handler_ = network_configuration_handler; |
914 network_profile_handler_->AddObserver(this); | 922 network_profile_handler_->AddObserver(this); |
915 } | 923 } |
916 | 924 |
917 } // namespace chromeos | 925 } // namespace chromeos |
OLD | NEW |