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

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

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browsertest and removed unnecessary string for default values. Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/login_profile_policy_provider.h" 5 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 void LoginProfilePolicyProvider::RefreshPolicies() { 111 void LoginProfilePolicyProvider::RefreshPolicies() {
112 waiting_for_device_policy_refresh_ = true; 112 waiting_for_device_policy_refresh_ = true;
113 weak_factory_.InvalidateWeakPtrs(); 113 weak_factory_.InvalidateWeakPtrs();
114 device_policy_service_->RefreshPolicies(base::Bind( 114 device_policy_service_->RefreshPolicies(base::Bind(
115 &LoginProfilePolicyProvider::OnDevicePolicyRefreshDone, 115 &LoginProfilePolicyProvider::OnDevicePolicyRefreshDone,
116 weak_factory_.GetWeakPtr())); 116 weak_factory_.GetWeakPtr()));
117 } 117 }
118 118
119 PolicySource LoginProfilePolicyProvider::source() const {
Thiemo Nagel 2015/09/01 17:40:36 Remove.
fhorschig 2015/09/04 06:53:53 Done.
120 return POLICY_SOURCE_CLOUD;
121 }
122
119 void LoginProfilePolicyProvider::OnPolicyUpdated(const PolicyNamespace& ns, 123 void LoginProfilePolicyProvider::OnPolicyUpdated(const PolicyNamespace& ns,
120 const PolicyMap& previous, 124 const PolicyMap& previous,
121 const PolicyMap& current) { 125 const PolicyMap& current) {
122 if (ns == PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) 126 if (ns == PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
123 UpdateFromDevicePolicy(); 127 UpdateFromDevicePolicy();
124 } 128 }
125 129
126 void LoginProfilePolicyProvider::OnPolicyServiceInitialized( 130 void LoginProfilePolicyProvider::OnPolicyServiceInitialized(
127 PolicyDomain domain) { 131 PolicyDomain domain) {
128 if (domain == POLICY_DOMAIN_CHROME) 132 if (domain == POLICY_DOMAIN_CHROME)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ApplyValueAsMandatoryPolicy(policy_value.get(), 201 ApplyValueAsMandatoryPolicy(policy_value.get(),
198 key::kPowerManagementIdleSettings, 202 key::kPowerManagementIdleSettings,
199 &user_policy_map); 203 &user_policy_map);
200 } 204 }
201 } 205 }
202 206
203 UpdatePolicy(bundle.Pass()); 207 UpdatePolicy(bundle.Pass());
204 } 208 }
205 209
206 } // namespace policy 210 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698