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

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

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/user_policy_cache.h" 5 #include "chrome/browser/policy/user_policy_cache.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/policy/profile_policy_connector.h"
15 #include "chrome/browser/policy/configuration_policy_pref_store.h" 17 #include "chrome/browser/policy/configuration_policy_pref_store.h"
16 #include "chrome/browser/policy/policy_map.h" 18 #include "chrome/browser/policy/policy_map.h"
17 #include "chrome/browser/policy/proto/cloud_policy.pb.h" 19 #include "chrome/browser/policy/proto/cloud_policy.pb.h"
18 #include "chrome/browser/policy/proto/device_management_local.pb.h" 20 #include "chrome/browser/policy/proto/device_management_local.pb.h"
19 #include "chrome/browser/policy/proto/old_generic_format.pb.h" 21 #include "chrome/browser/policy/proto/old_generic_format.pb.h"
20 #include "content/browser/browser_thread.h" 22 #include "content/browser/browser_thread.h"
21 #include "policy/configuration_policy_type.h" 23 #include "policy/configuration_policy_type.h"
22 24
23 namespace policy { 25 namespace policy {
24 26
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 ++named_value) { 259 ++named_value) {
258 if (named_value->has_value()) { 260 if (named_value->has_value()) {
259 Value* decoded_value = DecodeValue(named_value->value()); 261 Value* decoded_value = DecodeValue(named_value->value());
260 if (decoded_value) 262 if (decoded_value)
261 result.Set(named_value->name(), decoded_value); 263 result.Set(named_value->name(), decoded_value);
262 } 264 }
263 } 265 }
264 // Hack: Let one of the providers do the transformation from DictionaryValue 266 // Hack: Let one of the providers do the transformation from DictionaryValue
265 // to PolicyMap, since they have the required code anyway. 267 // to PolicyMap, since they have the required code anyway.
266 PolicyMapProxy map_proxy(mandatory); 268 PolicyMapProxy map_proxy(mandatory);
267 GetManagedPolicyProvider()->ApplyPolicyValueTree(&result, &map_proxy); 269 g_browser_process->user_policy_connector()->GetManagedCloudProvider()->
270 ApplyPolicyValueTree(&result, &map_proxy);
268 } 271 }
269 272
270 Value* UserPolicyCache::DecodeIntegerValue( 273 Value* UserPolicyCache::DecodeIntegerValue(
271 google::protobuf::int64 value) const { 274 google::protobuf::int64 value) const {
272 if (value < std::numeric_limits<int>::min() || 275 if (value < std::numeric_limits<int>::min() ||
273 value > std::numeric_limits<int>::max()) { 276 value > std::numeric_limits<int>::max()) {
274 LOG(WARNING) << "Integer value " << value 277 LOG(WARNING) << "Integer value " << value
275 << " out of numeric limits, ignoring."; 278 << " out of numeric limits, ignoring.";
276 return NULL; 279 return NULL;
277 } 280 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 return list; 344 return list;
342 } 345 }
343 default: 346 default:
344 NOTREACHED() << "Unhandled value type"; 347 NOTREACHED() << "Unhandled value type";
345 } 348 }
346 349
347 return NULL; 350 return NULL;
348 } 351 }
349 352
350 } // namespace policy 353 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698