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

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

Issue 2928823003: Make it possible to build without enable_supervised_users.
Patch Set: Does it still compile with the feature enabled? Created 3 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
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/policy/configuration_policy_handler_list_factory.h" 5 #include "chrome/browser/policy/configuration_policy_handler_list_factory.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/browser/net/disk_cache_dir_policy_handler.h" 18 #include "chrome/browser/net/disk_cache_dir_policy_handler.h"
19 #include "chrome/browser/net/safe_search_util.h" 19 #include "chrome/browser/net/safe_search_util.h"
20 #include "chrome/browser/policy/file_selection_dialogs_policy_handler.h" 20 #include "chrome/browser/policy/file_selection_dialogs_policy_handler.h"
21 #include "chrome/browser/policy/javascript_policy_handler.h" 21 #include "chrome/browser/policy/javascript_policy_handler.h"
22 #include "chrome/browser/policy/managed_bookmarks_policy_handler.h" 22 #include "chrome/browser/policy/managed_bookmarks_policy_handler.h"
23 #include "chrome/browser/policy/network_prediction_policy_handler.h" 23 #include "chrome/browser/policy/network_prediction_policy_handler.h"
24 #include "chrome/browser/profiles/guest_mode_policy_handler.h" 24 #include "chrome/browser/profiles/guest_mode_policy_handler.h"
25 #include "chrome/browser/profiles/incognito_mode_policy_handler.h" 25 #include "chrome/browser/profiles/incognito_mode_policy_handler.h"
26 #include "chrome/browser/sessions/restore_on_startup_policy_handler.h" 26 #include "chrome/browser/sessions/restore_on_startup_policy_handler.h"
27 #include "chrome/browser/supervised_user/supervised_user_creation_policy_handler .h"
28 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
29 #include "chrome/common/features.h" 28 #include "chrome/common/features.h"
30 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
31 #include "components/bookmarks/common/bookmark_pref_names.h" 30 #include "components/bookmarks/common/bookmark_pref_names.h"
32 #include "components/browsing_data/core/pref_names.h" 31 #include "components/browsing_data/core/pref_names.h"
33 #include "components/certificate_transparency/pref_names.h" 32 #include "components/certificate_transparency/pref_names.h"
34 #include "components/content_settings/core/common/pref_names.h" 33 #include "components/content_settings/core/common/pref_names.h"
35 #include "components/metrics/metrics_pref_names.h" 34 #include "components/metrics/metrics_pref_names.h"
36 #include "components/network_time/network_time_pref_names.h" 35 #include "components/network_time/network_time_pref_names.h"
37 #include "components/ntp_snippets/pref_names.h" 36 #include "components/ntp_snippets/pref_names.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #endif 89 #endif
91 90
92 #if BUILDFLAG(ENABLE_PLUGINS) 91 #if BUILDFLAG(ENABLE_PLUGINS)
93 #include "chrome/browser/plugins/plugin_policy_handler.h" 92 #include "chrome/browser/plugins/plugin_policy_handler.h"
94 #endif 93 #endif
95 94
96 #if BUILDFLAG(ENABLE_SPELLCHECK) 95 #if BUILDFLAG(ENABLE_SPELLCHECK)
97 #include "components/spellcheck/browser/pref_names.h" 96 #include "components/spellcheck/browser/pref_names.h"
98 #endif 97 #endif
99 98
99 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
100 #include "chrome/browser/supervised_user/supervised_user_creation_policy_handler .h"
101 #endif
102
100 namespace policy { 103 namespace policy {
101 104
102 namespace { 105 namespace {
103 106
104 // List of policy types to preference names. This is used for simple policies 107 // List of policy types to preference names. This is used for simple policies
105 // that directly map to a single preference. 108 // that directly map to a single preference.
106 // clang-format off 109 // clang-format off
107 const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { 110 const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
108 { key::kHomepageLocation, 111 { key::kHomepageLocation,
109 prefs::kHomePage, 112 prefs::kHomePage,
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 handlers->AddHandler(base::MakeUnique<DiskCacheDirPolicyHandler>()); 911 handlers->AddHandler(base::MakeUnique<DiskCacheDirPolicyHandler>());
909 912
910 handlers->AddHandler( 913 handlers->AddHandler(
911 base::MakeUnique<extensions::NativeMessagingHostListPolicyHandler>( 914 base::MakeUnique<extensions::NativeMessagingHostListPolicyHandler>(
912 key::kNativeMessagingWhitelist, 915 key::kNativeMessagingWhitelist,
913 extensions::pref_names::kNativeMessagingWhitelist, false)); 916 extensions::pref_names::kNativeMessagingWhitelist, false));
914 handlers->AddHandler( 917 handlers->AddHandler(
915 base::MakeUnique<extensions::NativeMessagingHostListPolicyHandler>( 918 base::MakeUnique<extensions::NativeMessagingHostListPolicyHandler>(
916 key::kNativeMessagingBlacklist, 919 key::kNativeMessagingBlacklist,
917 extensions::pref_names::kNativeMessagingBlacklist, true)); 920 extensions::pref_names::kNativeMessagingBlacklist, true));
921 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
918 handlers->AddHandler(base::MakeUnique<SupervisedUserCreationPolicyHandler>()); 922 handlers->AddHandler(base::MakeUnique<SupervisedUserCreationPolicyHandler>());
923 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS)
919 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 924 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
920 925
921 #if !defined(OS_ANDROID) 926 #if !defined(OS_ANDROID)
922 handlers->AddHandler(base::WrapUnique(new DownloadDirPolicyHandler)); 927 handlers->AddHandler(base::WrapUnique(new DownloadDirPolicyHandler));
923 handlers->AddHandler(base::MakeUnique<LocalSyncPolicyHandler>()); 928 handlers->AddHandler(base::MakeUnique<LocalSyncPolicyHandler>());
924 929
925 handlers->AddHandler(base::MakeUnique<SimpleSchemaValidatingPolicyHandler>( 930 handlers->AddHandler(base::MakeUnique<SimpleSchemaValidatingPolicyHandler>(
926 key::kRegisteredProtocolHandlers, 931 key::kRegisteredProtocolHandlers,
927 prefs::kPolicyRegisteredProtocolHandlers, chrome_schema, SCHEMA_STRICT, 932 prefs::kPolicyRegisteredProtocolHandlers, chrome_schema, SCHEMA_STRICT,
928 SimpleSchemaValidatingPolicyHandler::RECOMMENDED_ALLOWED, 933 SimpleSchemaValidatingPolicyHandler::RECOMMENDED_ALLOWED,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 #endif // defined(OS_CHROMEOS) 1046 #endif // defined(OS_CHROMEOS)
1042 1047
1043 #if BUILDFLAG(ENABLE_PLUGINS) 1048 #if BUILDFLAG(ENABLE_PLUGINS)
1044 handlers->AddHandler(base::MakeUnique<PluginPolicyHandler>()); 1049 handlers->AddHandler(base::MakeUnique<PluginPolicyHandler>());
1045 #endif // BUILDFLAG(ENABLE_PLUGINS) 1050 #endif // BUILDFLAG(ENABLE_PLUGINS)
1046 1051
1047 return handlers; 1052 return handlers;
1048 } 1053 }
1049 1054
1050 } // namespace policy 1055 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698