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

Side by Side Diff: chromeos/network/onc/onc_utils.cc

Issue 552113002: Add ONC 'Source' configuration property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_279351_internet_options_9a
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/network/policy_applicator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chromeos/network/onc/onc_utils.h" 5 #include "chromeos/network/onc/onc_utils.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (new_root.get() == NULL) { 153 if (new_root.get() == NULL) {
154 ONC_LOG_ERROR("Property dictionary malformed."); 154 ONC_LOG_ERROR("Property dictionary malformed.");
155 return scoped_ptr<base::DictionaryValue>(); 155 return scoped_ptr<base::DictionaryValue>();
156 } 156 }
157 157
158 return new_root.Pass(); 158 return new_root.Pass();
159 } 159 }
160 160
161 std::string GetSourceAsString(ONCSource source) { 161 std::string GetSourceAsString(ONCSource source) {
162 switch (source) { 162 switch (source) {
163 case ONC_SOURCE_UNKNOWN:
164 return "unknown";
165 case ONC_SOURCE_NONE:
166 return "none";
163 case ONC_SOURCE_DEVICE_POLICY: 167 case ONC_SOURCE_DEVICE_POLICY:
164 return "device policy"; 168 return "device policy";
165 case ONC_SOURCE_USER_POLICY: 169 case ONC_SOURCE_USER_POLICY:
166 return "user policy"; 170 return "user policy";
167 case ONC_SOURCE_NONE:
168 return "none";
169 case ONC_SOURCE_USER_IMPORT: 171 case ONC_SOURCE_USER_IMPORT:
170 return "user import"; 172 return "user import";
171 } 173 }
172 NOTREACHED() << "unknown ONC source " << source; 174 NOTREACHED() << "unknown ONC source " << source;
173 return "unknown"; 175 return "unknown";
174 } 176 }
175 177
176 void ExpandField(const std::string& fieldname, 178 void ExpandField(const std::string& fieldname,
177 const StringSubstitution& substitution, 179 const StringSubstitution& substitution,
178 base::DictionaryValue* onc_object) { 180 base::DictionaryValue* onc_object) {
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 } 690 }
689 691
690 const base::ListValue* recommended_keys = NULL; 692 const base::ListValue* recommended_keys = NULL;
691 return (onc->GetList(recommended_property_key, &recommended_keys) && 693 return (onc->GetList(recommended_property_key, &recommended_keys) &&
692 recommended_keys->Find(base::StringValue(property_basename)) != 694 recommended_keys->Find(base::StringValue(property_basename)) !=
693 recommended_keys->end()); 695 recommended_keys->end());
694 } 696 }
695 697
696 } // namespace onc 698 } // namespace onc
697 } // namespace chromeos 699 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/network/policy_applicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698