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

Unified Diff: chrome/browser/chromeos/cros/onc_network_parser.h

Issue 8804020: Set onc_source UI data parameter when importing ONC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle "Recommended" dictionary entry properly. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/cros/onc_network_parser.h
diff --git a/chrome/browser/chromeos/cros/onc_network_parser.h b/chrome/browser/chromeos/cros/onc_network_parser.h
index eb15efe74ccc22009d651cc68e3aa2e857316910..b32ebb9b460d59b1b1f3d2380d40428111203c51 100644
--- a/chrome/browser/chromeos/cros/onc_network_parser.h
+++ b/chrome/browser/chromeos/cros/onc_network_parser.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/chromeos/cros/network_parser.h"
+#include "chrome/browser/chromeos/cros/network_ui_data.h"
namespace base {
class DictionaryValue;
@@ -30,6 +31,7 @@ struct OncValueSignature {
const char* field;
PropertyIndex index;
base::Value::Type type;
+ const char* ui_data_key;
};
// This is the network parser that parses the data from an Open Network
@@ -45,7 +47,8 @@ class OncNetworkParser : public NetworkParser {
const base::Value&,
Network*);
- explicit OncNetworkParser(const std::string& onc_blob);
+ OncNetworkParser(const std::string& onc_blob,
+ NetworkUIData::ONCSource onc_source);
virtual ~OncNetworkParser();
static const EnumMapper<PropertyIndex>* property_mapper();
@@ -124,9 +127,17 @@ class OncNetworkParser : public NetworkParser {
int cert_index,
base::DictionaryValue* certificate);
+ // Fills in |network->ui_data()| for the properties in |signature|.
+ void ParseUIData(Network* network,
+ const base::DictionaryValue* dict,
+ OncValueSignature* signature) const;
+
// Error message from the JSON parser, if applicable.
std::string parse_error_;
+ // Where the ONC blob comes from.
+ NetworkUIData::ONCSource onc_source_;
+
scoped_ptr<base::DictionaryValue> root_dict_;
base::ListValue* network_configs_;
base::ListValue* certificates_;

Powered by Google App Engine
This is Rietveld 408576698