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

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

Issue 1775023002: Enterprise policy to prevent queries to the Quirks Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix display unit test Created 4 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/device_policy_decoder_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 POLICY_SOURCE_CLOUD, 826 POLICY_SOURCE_CLOUD,
827 new base::FundamentalValue(container.block_devmode()), 827 new base::FundamentalValue(container.block_devmode()),
828 NULL); 828 NULL);
829 } 829 }
830 } 830 }
831 831
832 if (policy.has_extension_cache_size()) { 832 if (policy.has_extension_cache_size()) {
833 const em::ExtensionCacheSizeProto& container(policy.extension_cache_size()); 833 const em::ExtensionCacheSizeProto& container(policy.extension_cache_size());
834 if (container.has_extension_cache_size()) { 834 if (container.has_extension_cache_size()) {
835 policies->Set( 835 policies->Set(
836 key::kExtensionCacheSize, POLICY_LEVEL_MANDATORY, 836 key::kExtensionCacheSize,
837 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, 837 POLICY_LEVEL_MANDATORY,
838 POLICY_SCOPE_MACHINE,
839 POLICY_SOURCE_CLOUD,
838 DecodeIntegerValue(container.extension_cache_size()).release(), 840 DecodeIntegerValue(container.extension_cache_size()).release(),
839 nullptr); 841 nullptr);
840 } 842 }
841 } 843 }
842 844
843 if (policy.has_login_screen_domain_auto_complete()) { 845 if (policy.has_login_screen_domain_auto_complete()) {
844 const em::LoginScreenDomainAutoCompleteProto& container( 846 const em::LoginScreenDomainAutoCompleteProto& container(
845 policy.login_screen_domain_auto_complete()); 847 policy.login_screen_domain_auto_complete());
846 policies->Set( 848 policies->Set(
847 key::kDeviceLoginScreenDomainAutoComplete, POLICY_LEVEL_MANDATORY, 849 key::kDeviceLoginScreenDomainAutoComplete,
848 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, 850 POLICY_LEVEL_MANDATORY,
851 POLICY_SCOPE_MACHINE,
852 POLICY_SOURCE_CLOUD,
849 new base::StringValue(container.login_screen_domain_auto_complete()), 853 new base::StringValue(container.login_screen_domain_auto_complete()),
850 nullptr); 854 nullptr);
851 } 855 }
852 856
853 if (policy.has_display_rotation_default()) { 857 if (policy.has_display_rotation_default()) {
854 const em::DisplayRotationDefaultProto& container( 858 const em::DisplayRotationDefaultProto& container(
855 policy.display_rotation_default()); 859 policy.display_rotation_default());
856 policies->Set( 860 policies->Set(
857 key::kDisplayRotationDefault, 861 key::kDisplayRotationDefault,
858 POLICY_LEVEL_MANDATORY, 862 POLICY_LEVEL_MANDATORY,
(...skipping 16 matching lines...) Expand all
875 } 879 }
876 if (entry->has_product_id()) { 880 if (entry->has_product_id()) {
877 ids->SetString("pid", base::StringPrintf("%04X", entry->product_id())); 881 ids->SetString("pid", base::StringPrintf("%04X", entry->product_id()));
878 } 882 }
879 whitelist->Append(ids); 883 whitelist->Append(ids);
880 } 884 }
881 policies->Set(key::kUsbDetachableWhitelist, POLICY_LEVEL_MANDATORY, 885 policies->Set(key::kUsbDetachableWhitelist, POLICY_LEVEL_MANDATORY,
882 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, whitelist, 886 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, whitelist,
883 nullptr); 887 nullptr);
884 } 888 }
889
890 if (policy.has_quirks_download_enabled()) {
891 const em::DeviceQuirksDownloadEnabledProto& container(
892 policy.quirks_download_enabled());
893 if (container.has_quirks_download_enabled()) {
894 policies->Set(
895 key::kDeviceQuirksDownloadEnabled,
896 POLICY_LEVEL_MANDATORY,
897 POLICY_SCOPE_MACHINE,
898 POLICY_SOURCE_CLOUD,
899 new base::FundamentalValue(container.quirks_download_enabled()),
900 nullptr);
901 }
902 }
885 } 903 }
886 904
887 } // namespace 905 } // namespace
888 906
889 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, 907 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy,
890 PolicyMap* policies) { 908 PolicyMap* policies) {
891 // Decode the various groups of policies. 909 // Decode the various groups of policies.
892 DecodeLoginPolicies(policy, policies); 910 DecodeLoginPolicies(policy, policies);
893 DecodeNetworkPolicies(policy, policies); 911 DecodeNetworkPolicies(policy, policies);
894 DecodeReportingPolicies(policy, policies); 912 DecodeReportingPolicies(policy, policies);
895 DecodeAutoUpdatePolicies(policy, policies); 913 DecodeAutoUpdatePolicies(policy, policies);
896 DecodeAccessibilityPolicies(policy, policies); 914 DecodeAccessibilityPolicies(policy, policies);
897 DecodeGenericPolicies(policy, policies); 915 DecodeGenericPolicies(policy, policies);
898 } 916 }
899 917
900 } // namespace policy 918 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698