Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/arc/arc_backup_restore_policy_handler.h" | |
| 6 | |
| 7 #include "base/values.h" | |
| 8 #include "chrome/common/pref_names.h" | |
| 9 #include "components/policy/core/common/policy_map.h" | |
| 10 #include "components/prefs/pref_value_map.h" | |
| 11 #include "policy/policy_constants.h" | |
| 12 | |
| 13 namespace arc { | |
| 14 | |
| 15 ArcBackupRestorePolicyHandler::ArcBackupRestorePolicyHandler() | |
| 16 : policy::TypeCheckingPolicyHandler(policy::key::kArcBackupRestoreEnabled, | |
| 17 base::Value::TYPE_BOOLEAN) {} | |
|
Yusuke Sato
2016/07/11 03:01:06
nit: s/{}/= default;/
Sergey Poromov
2016/07/11 14:35:14
It's not possible for this constructor :(
| |
| 18 | |
| 19 ArcBackupRestorePolicyHandler::~ArcBackupRestorePolicyHandler() {} | |
|
Yusuke Sato
2016/07/11 03:01:06
same
Sergey Poromov
2016/07/11 14:35:14
Done.
| |
| 20 | |
| 21 void ArcBackupRestorePolicyHandler::ApplyPolicySettings( | |
| 22 const policy::PolicyMap& policies, | |
| 23 PrefValueMap* prefs) { | |
| 24 const base::Value* value = policies.GetValue(policy_name()); | |
| 25 if (value) { | |
| 26 bool backup_restore_enabled; | |
| 27 value->GetAsBoolean(&backup_restore_enabled); | |
|
Yusuke Sato
2016/07/11 03:01:06
Can you initialize backup_restore_enabled (with fa
Sergey Poromov
2016/07/11 14:35:14
Done.
| |
| 28 prefs->SetBoolean(prefs::kArcBackupRestoreEnabled, backup_restore_enabled); | |
| 29 prefs->SetBoolean(prefs::kArcBackupRestoreManaged, true); | |
| 30 } else { | |
| 31 prefs->SetBoolean(prefs::kArcBackupRestoreManaged, false); | |
| 32 } | |
| 33 } | |
| 34 | |
| 35 } // namespace arc | |
| OLD | NEW |