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

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

Issue 100823007: Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS page encodings Created 7 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
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/chromeos/policy/configuration_policy_handler_chromeos.h " 5 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h "
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/magnifier/magnifier_constants.h" 10 #include "ash/magnifier/magnifier_constants.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 // Placeholder to insert in place of the filtered setting. 240 // Placeholder to insert in place of the filtered setting.
241 const char kPlaceholder[] = "********"; 241 const char kPlaceholder[] = "********";
242 242
243 toplevel_dict = chromeos::onc::MaskCredentialsInOncObject( 243 toplevel_dict = chromeos::onc::MaskCredentialsInOncObject(
244 chromeos::onc::kToplevelConfigurationSignature, 244 chromeos::onc::kToplevelConfigurationSignature,
245 *toplevel_dict, 245 *toplevel_dict,
246 kPlaceholder); 246 kPlaceholder);
247 247
248 base::JSONWriter::WriteWithOptions(toplevel_dict.get(), 248 base::JSONWriter::WriteWithOptions(toplevel_dict.get(),
249 base::JSONWriter::OPTIONS_DO_NOT_ESCAPE | 249 base::JSONWriter::OPTIONS_PRETTY_PRINT,
250 base::JSONWriter::OPTIONS_PRETTY_PRINT,
251 &json_string); 250 &json_string);
252 return base::Value::CreateStringValue(json_string); 251 return base::Value::CreateStringValue(json_string);
253 } 252 }
254 253
255 PinnedLauncherAppsPolicyHandler::PinnedLauncherAppsPolicyHandler() 254 PinnedLauncherAppsPolicyHandler::PinnedLauncherAppsPolicyHandler()
256 : ExtensionListPolicyHandler(key::kPinnedLauncherApps, 255 : ExtensionListPolicyHandler(key::kPinnedLauncherApps,
257 prefs::kPinnedLauncherApps, 256 prefs::kPinnedLauncherApps,
258 false) {} 257 false) {}
259 258
260 PinnedLauncherAppsPolicyHandler::~PinnedLauncherAppsPolicyHandler() {} 259 PinnedLauncherAppsPolicyHandler::~PinnedLauncherAppsPolicyHandler() {}
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 const base::Value* value = policies.GetValue(policy_name()); 344 const base::Value* value = policies.GetValue(policy_name());
346 if (value && EnsureInRange(value, NULL, NULL)) { 345 if (value && EnsureInRange(value, NULL, NULL)) {
347 if (!prefs->GetValue(prefs::kPowerAcIdleAction, NULL)) 346 if (!prefs->GetValue(prefs::kPowerAcIdleAction, NULL))
348 prefs->SetValue(prefs::kPowerAcIdleAction, value->DeepCopy()); 347 prefs->SetValue(prefs::kPowerAcIdleAction, value->DeepCopy());
349 if (!prefs->GetValue(prefs::kPowerBatteryIdleAction, NULL)) 348 if (!prefs->GetValue(prefs::kPowerBatteryIdleAction, NULL))
350 prefs->SetValue(prefs::kPowerBatteryIdleAction, value->DeepCopy()); 349 prefs->SetValue(prefs::kPowerBatteryIdleAction, value->DeepCopy());
351 } 350 }
352 } 351 }
353 352
354 } // namespace policy 353 } // namespace policy
OLDNEW
« no previous file with comments | « base/metrics/statistics_recorder.cc ('k') | chrome/browser/extensions/activity_log/activity_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698