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

Side by Side Diff: chrome/browser/policy/configuration_policy_handler_chromeos.cc

Issue 11975015: This adds a private extension API to use for simple networking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Converting to ONC Created 7 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) 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 "chrome/browser/policy/configuration_policy_handler_chromeos.h" 5 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 return base::Value::CreateStringValue(json_string); 138 return base::Value::CreateStringValue(json_string);
139 } 139 }
140 140
141 // static 141 // static
142 void NetworkConfigurationPolicyHandler::MaskSensitiveValues( 142 void NetworkConfigurationPolicyHandler::MaskSensitiveValues(
143 base::DictionaryValue* network_dict) { 143 base::DictionaryValue* network_dict) {
144 // Paths of the properties to be replaced by the placeholder. Each entry 144 // Paths of the properties to be replaced by the placeholder. Each entry
145 // specifies dictionary key paths. 145 // specifies dictionary key paths.
146 static const int kMaxComponents = 3; 146 static const int kMaxComponents = 3;
147 static const char* kFilteredSettings[][kMaxComponents] = { 147 static const char* kFilteredSettings[][kMaxComponents] = {
148 { onc::kEthernet, onc::ethernet::kEAP, onc::eap::kPassword }, 148 { onc::network_config::kEthernet, onc::ethernet::kEAP,
149 { onc::kVPN, onc::vpn::kIPsec, onc::vpn::kPSK }, 149 onc::eap::kPassword },
150 { onc::kVPN, onc::vpn::kL2TP, onc::vpn::kPassword }, 150 { onc::network_config::kVPN, onc::vpn::kIPsec, onc::vpn::kPSK },
151 { onc::kVPN, onc::vpn::kOpenVPN, onc::vpn::kPassword }, 151 { onc::network_config::kVPN, onc::vpn::kL2TP, onc::vpn::kPassword },
152 { onc::kVPN, onc::vpn::kOpenVPN, onc::vpn::kTLSAuthContents }, 152 { onc::network_config::kVPN, onc::vpn::kOpenVPN, onc::vpn::kPassword },
153 { onc::kWiFi, onc::wifi::kEAP, onc::eap::kPassword }, 153 { onc::network_config::kVPN, onc::vpn::kOpenVPN,
154 { onc::kWiFi, onc::wifi::kPassphrase }, 154 onc::vpn::kTLSAuthContents },
155 { onc::network_config::kWiFi, onc::wifi::kEAP, onc::eap::kPassword },
156 { onc::network_config::kWiFi, onc::wifi::kPassphrase },
155 }; 157 };
156 158
157 // Placeholder to insert in place of the filtered setting. 159 // Placeholder to insert in place of the filtered setting.
158 static const char kPlaceholder[] = "********"; 160 static const char kPlaceholder[] = "********";
159 161
160 for (size_t i = 0; i < arraysize(kFilteredSettings); ++i) { 162 for (size_t i = 0; i < arraysize(kFilteredSettings); ++i) {
161 const char** path = kFilteredSettings[i]; 163 const char** path = kFilteredSettings[i];
162 base::DictionaryValue* dict = network_dict; 164 base::DictionaryValue* dict = network_dict;
163 int j = 0; 165 int j = 0;
164 for (j = 0; path[j + 1] != NULL && j + 1 < kMaxComponents; ++j) { 166 for (j = 0; path[j + 1] != NULL && j + 1 < kMaxComponents; ++j) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 base::DictionaryValue* app_dict = new base::DictionaryValue(); 198 base::DictionaryValue* app_dict = new base::DictionaryValue();
197 app_dict->SetString(ash::kPinnedAppsPrefAppIDPath, id); 199 app_dict->SetString(ash::kPinnedAppsPrefAppIDPath, id);
198 pinned_apps_list->Append(app_dict); 200 pinned_apps_list->Append(app_dict);
199 } 201 }
200 } 202 }
201 prefs->SetValue(pref_path(), pinned_apps_list); 203 prefs->SetValue(pref_path(), pinned_apps_list);
202 } 204 }
203 } 205 }
204 206
205 } // namespace policy 207 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698