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

Unified Diff: chromeos/network/network_ui_data.cc

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_ui_data.h ('k') | chromeos/network/onc/onc_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_ui_data.cc
diff --git a/chromeos/network/network_ui_data.cc b/chromeos/network/network_ui_data.cc
index 334589520eafb9eb458bffe0006c9e0410a880c7..a80ee3ecd5a47580fe5c09a490ebdd1fd7c2bffa 100644
--- a/chromeos/network/network_ui_data.cc
+++ b/chromeos/network/network_ui_data.cc
@@ -14,6 +14,7 @@ namespace chromeos {
const char NetworkUIData::kKeyONCSource[] = "onc_source";
const char NetworkUIData::kKeyCertificatePattern[] = "certificate_pattern";
const char NetworkUIData::kKeyCertificateType[] = "certificate_type";
+const char NetworkUIData::kKeyUserSettings[] = "user_settings";
namespace {
@@ -61,13 +62,27 @@ Enum StringToEnum(const StringEnumEntry<Enum>(& table)[N],
return fallback;
}
-}
+} // namespace
NetworkUIData::NetworkUIData()
: onc_source_(onc::ONC_SOURCE_NONE),
certificate_type_(CLIENT_CERT_TYPE_NONE) {
}
+NetworkUIData::NetworkUIData(const NetworkUIData& other) {
+ *this = other;
+}
+
+NetworkUIData& NetworkUIData::operator=(const NetworkUIData& other) {
+ certificate_pattern_ = other.certificate_pattern_;
+ onc_source_ = other.onc_source_;
+ certificate_type_ = other.certificate_type_;
+ if (other.user_settings_)
+ user_settings_.reset(other.user_settings_->DeepCopy());
+ policy_guid_ = other.policy_guid_;
+ return *this;
+}
+
NetworkUIData::NetworkUIData(const DictionaryValue& dict) {
std::string source;
dict.GetString(kKeyONCSource, &source);
@@ -88,6 +103,10 @@ NetworkUIData::NetworkUIData(const DictionaryValue& dict) {
certificate_type_ = CLIENT_CERT_TYPE_NONE;
}
}
+
+ const DictionaryValue* user_settings = NULL;
+ if (dict.GetDictionary(kKeyUserSettings, &user_settings))
+ user_settings_.reset(user_settings->DeepCopy());
}
NetworkUIData::~NetworkUIData() {
@@ -110,6 +129,9 @@ void NetworkUIData::FillDictionary(base::DictionaryValue* dict) const {
certificate_pattern_.CreateAsDictionary());
}
}
+ if (user_settings_)
+ dict->SetWithoutPathExpansion(kKeyUserSettings,
+ user_settings_->DeepCopy());
}
namespace {
« no previous file with comments | « chromeos/network/network_ui_data.h ('k') | chromeos/network/onc/onc_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698