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

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

Issue 2257103002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Placeholder to insert in place of the filtered setting. 299 // Placeholder to insert in place of the filtered setting.
300 const char kPlaceholder[] = "********"; 300 const char kPlaceholder[] = "********";
301 301
302 toplevel_dict = chromeos::onc::MaskCredentialsInOncObject( 302 toplevel_dict = chromeos::onc::MaskCredentialsInOncObject(
303 chromeos::onc::kToplevelConfigurationSignature, 303 chromeos::onc::kToplevelConfigurationSignature,
304 *toplevel_dict, 304 *toplevel_dict,
305 kPlaceholder); 305 kPlaceholder);
306 306
307 base::JSONWriter::WriteWithOptions( 307 base::JSONWriter::WriteWithOptions(
308 *toplevel_dict, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json_string); 308 *toplevel_dict, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json_string);
309 return base::WrapUnique(new base::StringValue(json_string)); 309 return base::MakeUnique<base::StringValue>(json_string);
310 } 310 }
311 311
312 PinnedLauncherAppsPolicyHandler::PinnedLauncherAppsPolicyHandler() 312 PinnedLauncherAppsPolicyHandler::PinnedLauncherAppsPolicyHandler()
313 : ExtensionListPolicyHandler(key::kPinnedLauncherApps, 313 : ExtensionListPolicyHandler(key::kPinnedLauncherApps,
314 prefs::kPolicyPinnedLauncherApps, 314 prefs::kPolicyPinnedLauncherApps,
315 false) {} 315 false) {}
316 316
317 PinnedLauncherAppsPolicyHandler::~PinnedLauncherAppsPolicyHandler() {} 317 PinnedLauncherAppsPolicyHandler::~PinnedLauncherAppsPolicyHandler() {}
318 318
319 void PinnedLauncherAppsPolicyHandler::ApplyPolicySettings( 319 void PinnedLauncherAppsPolicyHandler::ApplyPolicySettings(
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 479
480 value = GetValue(dict, kScreenLockDelayAC); 480 value = GetValue(dict, kScreenLockDelayAC);
481 if (value) 481 if (value)
482 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value)); 482 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, std::move(value));
483 value = GetValue(dict, kScreenLockDelayBattery); 483 value = GetValue(dict, kScreenLockDelayBattery);
484 if (value) 484 if (value)
485 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value)); 485 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, std::move(value));
486 } 486 }
487 487
488 } // namespace policy 488 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698