| 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 #ifndef CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return policy_guid_; | 71 return policy_guid_; |
| 72 } | 72 } |
| 73 void set_policy_guid(const std::string& guid) { | 73 void set_policy_guid(const std::string& guid) { |
| 74 policy_guid_ = guid; | 74 policy_guid_ = guid; |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Fills in |dict| with the currently configured values. This will write the | 77 // Fills in |dict| with the currently configured values. This will write the |
| 78 // keys appropriate for Network::ui_data() as defined below (kKeyXXX). | 78 // keys appropriate for Network::ui_data() as defined below (kKeyXXX). |
| 79 void FillDictionary(base::DictionaryValue* dict) const; | 79 void FillDictionary(base::DictionaryValue* dict) const; |
| 80 | 80 |
| 81 // Creates a NetworkUIData object from |onc_network|, which has to be a valid |
| 82 // ONC NetworkConfiguration dictionary. |
| 83 // This function is used to create the "UIData" field of the Shill |
| 84 // configuration. |
| 85 static scoped_ptr<NetworkUIData> CreateFromONC( |
| 86 onc::ONCSource onc_source, |
| 87 const base::DictionaryValue& onc_network); |
| 88 |
| 81 // Key for storing source of the ONC network. | 89 // Key for storing source of the ONC network. |
| 82 static const char kKeyONCSource[]; | 90 static const char kKeyONCSource[]; |
| 83 | 91 |
| 84 // Key for storing the certificate pattern. | 92 // Key for storing the certificate pattern. |
| 85 static const char kKeyCertificatePattern[]; | 93 static const char kKeyCertificatePattern[]; |
| 86 | 94 |
| 87 // Key for storing the certificate type. | 95 // Key for storing the certificate type. |
| 88 static const char kKeyCertificateType[]; | 96 static const char kKeyCertificateType[]; |
| 89 | 97 |
| 90 // Key for storing the user settings. | 98 // Key for storing the user settings. |
| 91 static const char kKeyUserSettings[]; | 99 static const char kKeyUserSettings[]; |
| 92 | 100 |
| 93 private: | 101 private: |
| 94 CertificatePattern certificate_pattern_; | 102 CertificatePattern certificate_pattern_; |
| 95 onc::ONCSource onc_source_; | 103 onc::ONCSource onc_source_; |
| 96 ClientCertType certificate_type_; | 104 ClientCertType certificate_type_; |
| 97 scoped_ptr<base::DictionaryValue> user_settings_; | 105 scoped_ptr<base::DictionaryValue> user_settings_; |
| 98 std::string policy_guid_; | 106 std::string policy_guid_; |
| 99 }; | 107 }; |
| 100 | 108 |
| 101 // Creates a NetworkUIData object from |onc_network|, which has to be a valid | |
| 102 // ONC NetworkConfiguration dictionary. | |
| 103 // | |
| 104 // This function is used to create the "UIData" field of the Shill | |
| 105 // configuration. | |
| 106 CHROMEOS_EXPORT scoped_ptr<NetworkUIData> CreateUIDataFromONC( | |
| 107 onc::ONCSource onc_source, | |
| 108 const base::DictionaryValue& onc_network); | |
| 109 | |
| 110 } // namespace chromeos | 109 } // namespace chromeos |
| 111 | 110 |
| 112 #endif // CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ | 111 #endif // CHROMEOS_NETWORK_NETWORK_UI_DATA_H_ |
| OLD | NEW |