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

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

Issue 2570353002: Enabled default policies in Device Local Accounts (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.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 "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Wait for the refresh to finish. 152 // Wait for the refresh to finish.
153 return; 153 return;
154 } 154 }
155 } else { 155 } else {
156 // Keep existing policy, but do send an update. 156 // Keep existing policy, but do send an update.
157 waiting_for_policy_refresh_ = false; 157 waiting_for_policy_refresh_ = false;
158 weak_factory_.InvalidateWeakPtrs(); 158 weak_factory_.InvalidateWeakPtrs();
159 bundle->CopyFrom(policies()); 159 bundle->CopyFrom(policies());
160 } 160 }
161 161
162 PolicyMap& chrome_policy =
163 bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
164 // Apply the defaults for policies that haven't been configured by the
165 // administrator given that this is an enterprise user.
166 SetEnterpriseUsersDefaults(&chrome_policy);
167
162 // Apply overrides. 168 // Apply overrides.
163 if (chrome_policy_overrides_) { 169 if (chrome_policy_overrides_) {
164 PolicyMap& chrome_policy =
165 bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
166 for (const auto& policy_override : *chrome_policy_overrides_) { 170 for (const auto& policy_override : *chrome_policy_overrides_) {
167 const PolicyMap::Entry& entry = policy_override.second; 171 const PolicyMap::Entry& entry = policy_override.second;
168 chrome_policy.Set(policy_override.first, entry.level, entry.scope, 172 chrome_policy.Set(policy_override.first, entry.level, entry.scope,
169 entry.source, entry.value->CreateDeepCopy(), nullptr); 173 entry.source, entry.value->CreateDeepCopy(), nullptr);
170 } 174 }
171 } 175 }
172 176
173 UpdatePolicy(std::move(bundle)); 177 UpdatePolicy(std::move(bundle));
174 } 178 }
175 179
176 } // namespace policy 180 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698