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

Side by Side Diff: components/policy/core/common/cloud/component_cloud_policy_store.cc

Issue 1348903007: Revert of Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "components/policy/core/common/cloud/component_cloud_policy_store.h" 5 #include "components/policy/core/common/cloud/component_cloud_policy_store.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 12 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
13 #include "components/policy/core/common/cloud/cloud_policy_validator.h" 13 #include "components/policy/core/common/cloud/cloud_policy_validator.h"
14 #include "components/policy/core/common/external_data_fetcher.h" 14 #include "components/policy/core/common/external_data_fetcher.h"
15 #include "components/policy/core/common/policy_map.h" 15 #include "components/policy/core/common/policy_map.h"
16 #include "components/policy/core/common/policy_types.h"
17 #include "crypto/sha2.h" 16 #include "crypto/sha2.h"
18 #include "policy/proto/chrome_extension_policy.pb.h" 17 #include "policy/proto/chrome_extension_policy.pb.h"
19 #include "policy/proto/device_management_backend.pb.h" 18 #include "policy/proto/device_management_backend.pb.h"
20 #include "url/gurl.h" 19 #include "url/gurl.h"
21 20
22 namespace em = enterprise_management; 21 namespace em = enterprise_management;
23 22
24 namespace policy { 23 namespace policy {
25 24
26 namespace { 25 namespace {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 PolicyLevel level = POLICY_LEVEL_MANDATORY; 346 PolicyLevel level = POLICY_LEVEL_MANDATORY;
348 std::string level_string; 347 std::string level_string;
349 if (description->GetStringWithoutPathExpansion(kLevel, &level_string) && 348 if (description->GetStringWithoutPathExpansion(kLevel, &level_string) &&
350 level_string == kRecommended) { 349 level_string == kRecommended) {
351 level = POLICY_LEVEL_RECOMMENDED; 350 level = POLICY_LEVEL_RECOMMENDED;
352 } 351 }
353 352
354 // If policy for components is ever used for device-level settings then 353 // If policy for components is ever used for device-level settings then
355 // this must support a configurable scope; assuming POLICY_SCOPE_USER is 354 // this must support a configurable scope; assuming POLICY_SCOPE_USER is
356 // fine for now. 355 // fine for now.
357 policy->Set(it.key(), level, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, 356 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL);
358 value.release(), nullptr);
359 } 357 }
360 358
361 return true; 359 return true;
362 } 360 }
363 361
364 } // namespace policy 362 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698