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

Side by Side Diff: chrome/browser/policy/device_policy_cache.cc

Issue 7147015: Move user cloud policy to BrowserProcess (was 6979011) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + address comments Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/policy/device_policy_cache.h" 5 #include "chrome/browser/policy/device_policy_cache.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/task.h" 10 #include "base/task.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/chromeos/cros_settings_names.h" 12 #include "chrome/browser/chromeos/cros_settings_names.h"
13 #include "chrome/browser/chromeos/login/ownership_service.h" 13 #include "chrome/browser/chromeos/login/ownership_service.h"
14 #include "chrome/browser/chromeos/login/signed_settings_helper.h" 14 #include "chrome/browser/chromeos/login/signed_settings_helper.h"
Joao da Silva 2011/06/29 11:36:17 Nit: signed_settings_helper.h already included fro
gfeher 2011/06/29 12:53:07 Done.
15 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 15 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
16 #include "chrome/browser/policy/configuration_policy_pref_store.h" 16 #include "chrome/browser/policy/configuration_policy_pref_store.h"
17 #include "chrome/browser/policy/device_policy_identity_strategy.h" 17 #include "chrome/browser/policy/device_policy_identity_strategy.h"
18 #include "chrome/browser/policy/enterprise_install_attributes.h" 18 #include "chrome/browser/policy/enterprise_install_attributes.h"
19 #include "chrome/browser/policy/policy_map.h" 19 #include "chrome/browser/policy/policy_map.h"
20 #include "chrome/browser/policy/proto/device_management_backend.pb.h" 20 #include "chrome/browser/policy/proto/device_management_backend.pb.h"
21 #include "chrome/browser/policy/proto/device_management_constants.h" 21 #include "chrome/browser/policy/proto/device_management_constants.h"
22 #include "chrome/browser/policy/proto/device_management_local.pb.h" 22 #include "chrome/browser/policy/proto/device_management_local.pb.h"
23 #include "content/browser/browser_thread.h" 23 #include "content/browser/browser_thread.h"
24 #include "policy/configuration_policy_type.h" 24 #include "policy/configuration_policy_type.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 policy, 174 policy,
175 callback_factory_.NewCallback( 175 callback_factory_.NewCallback(
176 &DevicePolicyCache::PolicyStoreOpCompleted)); 176 &DevicePolicyCache::PolicyStoreOpCompleted));
177 } 177 }
178 178
179 void DevicePolicyCache::SetUnmanaged() { 179 void DevicePolicyCache::SetUnmanaged() {
180 LOG(WARNING) << "Tried to set DevicePolicyCache to 'unmanaged'!"; 180 LOG(WARNING) << "Tried to set DevicePolicyCache to 'unmanaged'!";
181 // This is not supported for DevicePolicyCache. 181 // This is not supported for DevicePolicyCache.
182 } 182 }
183 183
184 bool DevicePolicyCache::IsReady() {
185 return initialization_complete() || !starting_up_;
186 }
187
184 void DevicePolicyCache::OnRetrievePolicyCompleted( 188 void DevicePolicyCache::OnRetrievePolicyCompleted(
185 chromeos::SignedSettings::ReturnCode code, 189 chromeos::SignedSettings::ReturnCode code,
186 const em::PolicyFetchResponse& policy) { 190 const em::PolicyFetchResponse& policy) {
187 DCHECK(CalledOnValidThread()); 191 DCHECK(CalledOnValidThread());
188 if (starting_up_) { 192 if (starting_up_) {
189 starting_up_ = false; 193 starting_up_ = false;
190 if (code == chromeos::SignedSettings::NOT_FOUND || 194 if (code == chromeos::SignedSettings::NOT_FOUND ||
191 code == chromeos::SignedSettings::KEY_UNAVAILABLE || 195 code == chromeos::SignedSettings::KEY_UNAVAILABLE ||
192 !policy.has_policy_data()) { 196 !policy.has_policy_data()) {
193 InformNotifier(CloudPolicySubsystem::UNENROLLED, 197 InformNotifier(CloudPolicySubsystem::UNENROLLED,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 Value::CreateStringValue(container.proxy_pac_url())); 299 Value::CreateStringValue(container.proxy_pac_url()));
296 } 300 }
297 if (container.has_proxy_bypass_list()) { 301 if (container.has_proxy_bypass_list()) {
298 recommended->Set(kPolicyProxyBypassList, 302 recommended->Set(kPolicyProxyBypassList,
299 Value::CreateStringValue(container.proxy_bypass_list())); 303 Value::CreateStringValue(container.proxy_bypass_list()));
300 } 304 }
301 } 305 }
302 } 306 }
303 307
304 } // namespace policy 308 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698