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

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: Browsertest now checks one translated string. Refactoring according to review. 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 } 84 }
85 85
86 } // namespace 86 } // namespace
87 87
88 LoginProfilePolicyProvider::LoginProfilePolicyProvider( 88 LoginProfilePolicyProvider::LoginProfilePolicyProvider(
89 PolicyService* device_policy_service) 89 PolicyService* device_policy_service)
90 : device_policy_service_(device_policy_service), 90 : device_policy_service_(device_policy_service),
91 waiting_for_device_policy_refresh_(false), 91 waiting_for_device_policy_refresh_(false),
92 weak_factory_(this) { 92 weak_factory_(this) {
93 // Policies for profiles must be set by an admin and thus come from the cloud.
Thiemo Nagel 2015/09/07 15:18:57 How about "All Chrome OS policies are coming from
fhorschig 2015/09/07 15:59:35 Much easier. I like it.
94 source_ = POLICY_SOURCE_CLOUD;
93 } 95 }
94 96
95 LoginProfilePolicyProvider::~LoginProfilePolicyProvider() { 97 LoginProfilePolicyProvider::~LoginProfilePolicyProvider() {
96 } 98 }
97 99
98 void LoginProfilePolicyProvider::Init(SchemaRegistry* registry) { 100 void LoginProfilePolicyProvider::Init(SchemaRegistry* registry) {
99 ConfigurationPolicyProvider::Init(registry); 101 ConfigurationPolicyProvider::Init(registry);
100 device_policy_service_->AddObserver(POLICY_DOMAIN_CHROME, this); 102 device_policy_service_->AddObserver(POLICY_DOMAIN_CHROME, this);
101 if (device_policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME)) 103 if (device_policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME))
102 UpdateFromDevicePolicy(); 104 UpdateFromDevicePolicy();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ApplyValueAsMandatoryPolicy(policy_value.get(), 199 ApplyValueAsMandatoryPolicy(policy_value.get(),
198 key::kPowerManagementIdleSettings, 200 key::kPowerManagementIdleSettings,
199 &user_policy_map); 201 &user_policy_map);
200 } 202 }
201 } 203 }
202 204
203 UpdatePolicy(bundle.Pass()); 205 UpdatePolicy(bundle.Pass());
204 } 206 }
205 207
206 } // namespace policy 208 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698