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

Side by Side Diff: chrome/browser/chromeos/network_settings/onc_utils.h

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit tests Created 8 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_
6 #define CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11
12 namespace base {
13 class DictionaryValue;
14 }
15
16 namespace chromeos {
17 namespace onc {
18
19 // Parses |json| according to the JSON format. If |json| is a JSON formatted
20 // dictionary, the function returns the dictionary as a DictionaryValue and
21 // doesn't modify |error|. Otherwise returns NULL and sets |error| to a
22 // translated error message.
23 scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson(
24 const std::string& json,
25 std::string* error);
26
27 // Decrypt the given EncryptedConfiguration |onc| (see the ONC specification)
28 // using |passphrase|. The resulting UnencryptedConfiguration is returned and
29 // |error| is not modified. If an error occurs, returns NULL and if additionally
30 // |error| is not NULL, |error| is set to a user readable error message.
31 scoped_ptr<base::DictionaryValue> Decrypt(const std::string& passphrase,
32 const base::DictionaryValue& onc,
33 std::string* error);
34
35 } // chromeos
36 } // onc
37
38 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698