Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/chromeos/cros/onc_network_parser.h

Issue 8949056: This adds support for encrypted ONC import (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More Review Changes Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 scoped_refptr<net::X509Certificate> ParseServerOrCaCertificate( 137 scoped_refptr<net::X509Certificate> ParseServerOrCaCertificate(
137 int cert_index, 138 int cert_index,
138 const std::string& cert_type, 139 const std::string& cert_type,
139 const std::string& guid, 140 const std::string& guid,
140 base::DictionaryValue* certificate); 141 base::DictionaryValue* certificate);
141 scoped_refptr<net::X509Certificate> ParseClientCertificate( 142 scoped_refptr<net::X509Certificate> ParseClientCertificate(
142 int cert_index, 143 int cert_index,
143 const std::string& guid, 144 const std::string& guid,
144 base::DictionaryValue* certificate); 145 base::DictionaryValue* certificate);
145 146
147 base::DictionaryValue* Decrypt(const std::string& passphrase,
148 base::DictionaryValue* root);
149
146 // Error message from the JSON parser, if applicable. 150 // Error message from the JSON parser, if applicable.
147 std::string parse_error_; 151 std::string parse_error_;
148 152
149 // Where the ONC blob comes from. 153 // Where the ONC blob comes from.
150 NetworkUIData::ONCSource onc_source_; 154 NetworkUIData::ONCSource onc_source_;
151 155
152 scoped_ptr<base::DictionaryValue> root_dict_; 156 scoped_ptr<base::DictionaryValue> root_dict_;
153 base::ListValue* network_configs_; 157 base::ListValue* network_configs_;
154 base::ListValue* certificates_; 158 base::ListValue* certificates_;
155 159
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 const base::Value& value, 234 const base::Value& value,
231 Network* network); 235 Network* network);
232 236
233 private: 237 private:
234 DISALLOW_COPY_AND_ASSIGN(OncVirtualNetworkParser); 238 DISALLOW_COPY_AND_ASSIGN(OncVirtualNetworkParser);
235 }; 239 };
236 240
237 } // namespace chromeos 241 } // namespace chromeos
238 242
239 #endif // CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_ 243 #endif // CHROME_BROWSER_CHROMEOS_CROS_ONC_NETWORK_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698