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 CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // For ONC file format, see: http://dev.chromium.org/chromium-os/ | 46 // For ONC file format, see: http://dev.chromium.org/chromium-os/ |
47 // chromiumos-design-docs/open-network-configuration | 47 // chromiumos-design-docs/open-network-configuration |
48 class OncNetworkParser : public NetworkParser { | 48 class OncNetworkParser : public NetworkParser { |
49 public: | 49 public: |
50 typedef bool (*ParserPointer)(OncNetworkParser*, | 50 typedef bool (*ParserPointer)(OncNetworkParser*, |
51 PropertyIndex, | 51 PropertyIndex, |
52 const base::Value&, | 52 const base::Value&, |
53 Network*); | 53 Network*); |
54 | 54 |
55 OncNetworkParser(const std::string& onc_blob, | 55 OncNetworkParser(const std::string& onc_blob, |
| 56 const std::string& passphrase, |
56 NetworkUIData::ONCSource onc_source); | 57 NetworkUIData::ONCSource onc_source); |
57 virtual ~OncNetworkParser(); | 58 virtual ~OncNetworkParser(); |
58 static const EnumMapper<PropertyIndex>* property_mapper(); | 59 static const EnumMapper<PropertyIndex>* property_mapper(); |
59 | 60 |
60 // Returns the number of networks in the "NetworkConfigs" list. | 61 // Returns the number of networks in the "NetworkConfigs" list. |
61 int GetNetworkConfigsSize() const; | 62 int GetNetworkConfigsSize() const; |
62 | 63 |
63 // Returns the network configuration dictionary for the nth network. CHECKs if | 64 // Returns the network configuration dictionary for the nth network. CHECKs if |
64 // |n| is out of range and returns NULL on parse errors. | 65 // |n| is out of range and returns NULL on parse errors. |
65 const base::DictionaryValue* GetNetworkConfig(int n); | 66 const base::DictionaryValue* GetNetworkConfig(int n); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 scoped_refptr<net::X509Certificate> ParseServerOrCaCertificate( | 141 scoped_refptr<net::X509Certificate> ParseServerOrCaCertificate( |
141 int cert_index, | 142 int cert_index, |
142 const std::string& cert_type, | 143 const std::string& cert_type, |
143 const std::string& guid, | 144 const std::string& guid, |
144 base::DictionaryValue* certificate); | 145 base::DictionaryValue* certificate); |
145 scoped_refptr<net::X509Certificate> ParseClientCertificate( | 146 scoped_refptr<net::X509Certificate> ParseClientCertificate( |
146 int cert_index, | 147 int cert_index, |
147 const std::string& guid, | 148 const std::string& guid, |
148 base::DictionaryValue* certificate); | 149 base::DictionaryValue* certificate); |
149 | 150 |
| 151 base::DictionaryValue* Decrypt(const std::string& passphrase, |
| 152 base::DictionaryValue* root); |
| 153 |
150 // Error message from the JSON parser, if applicable. | 154 // Error message from the JSON parser, if applicable. |
151 std::string parse_error_; | 155 std::string parse_error_; |
152 | 156 |
153 // Where the ONC blob comes from. | 157 // Where the ONC blob comes from. |
154 NetworkUIData::ONCSource onc_source_; | 158 NetworkUIData::ONCSource onc_source_; |
155 | 159 |
156 scoped_ptr<base::DictionaryValue> root_dict_; | 160 scoped_ptr<base::DictionaryValue> root_dict_; |
157 base::ListValue* network_configs_; | 161 base::ListValue* network_configs_; |
158 base::ListValue* certificates_; | 162 base::ListValue* certificates_; |
159 | 163 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 const base::Value& value, | 238 const base::Value& value, |
235 Network* network); | 239 Network* network); |
236 | 240 |
237 private: | 241 private: |
238 DISALLOW_COPY_AND_ASSIGN(OncVirtualNetworkParser); | 242 DISALLOW_COPY_AND_ASSIGN(OncVirtualNetworkParser); |
239 }; | 243 }; |
240 | 244 |
241 } // namespace chromeos | 245 } // namespace chromeos |
242 | 246 |
243 #endif // CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ | 247 #endif // CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ |
OLD | NEW |