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

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

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "components/policy/core/common/policy_pref_names.h" 42 #include "components/policy/core/common/policy_pref_names.h"
43 #include "components/policy/core/common/schema.h" 43 #include "components/policy/core/common/schema.h"
44 #include "components/policy/policy_constants.h" 44 #include "components/policy/policy_constants.h"
45 #include "components/prefs/pref_value_map.h" 45 #include "components/prefs/pref_value_map.h"
46 #include "components/search_engines/default_search_policy_handler.h" 46 #include "components/search_engines/default_search_policy_handler.h"
47 #include "components/signin/core/common/signin_pref_names.h" 47 #include "components/signin/core/common/signin_pref_names.h"
48 #include "components/ssl_config/ssl_config_prefs.h" 48 #include "components/ssl_config/ssl_config_prefs.h"
49 #include "components/sync/driver/sync_policy_handler.h" 49 #include "components/sync/driver/sync_policy_handler.h"
50 #include "components/translate/core/common/translate_pref_names.h" 50 #include "components/translate/core/common/translate_pref_names.h"
51 #include "components/variations/pref_names.h" 51 #include "components/variations/pref_names.h"
52 #include "extensions/features/features.h"
52 53
53 #if BUILDFLAG(ANDROID_JAVA_UI) 54 #if BUILDFLAG(ANDROID_JAVA_UI)
54 #include "chrome/browser/search/contextual_search_policy_handler_android.h" 55 #include "chrome/browser/search/contextual_search_policy_handler_android.h"
55 #endif 56 #endif
56 57
57 #if defined(OS_CHROMEOS) 58 #if defined(OS_CHROMEOS)
58 #include "ash/common/accessibility_types.h" 59 #include "ash/common/accessibility_types.h"
59 #include "chrome/browser/chromeos/platform_keys/key_permissions_policy_handler.h " 60 #include "chrome/browser/chromeos/platform_keys/key_permissions_policy_handler.h "
60 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h " 61 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h "
61 #include "chrome/browser/policy/default_geolocation_policy_handler.h" 62 #include "chrome/browser/policy/default_geolocation_policy_handler.h"
62 #include "chromeos/chromeos_pref_names.h" 63 #include "chromeos/chromeos_pref_names.h"
63 #include "chromeos/dbus/power_policy_controller.h" 64 #include "chromeos/dbus/power_policy_controller.h"
64 #include "components/drive/drive_pref_names.h" 65 #include "components/drive/drive_pref_names.h"
65 #include "components/user_manager/user.h" 66 #include "components/user_manager/user.h"
66 #include "components/user_manager/user_manager.h" 67 #include "components/user_manager/user_manager.h"
67 #endif 68 #endif
68 69
69 #if !defined(OS_ANDROID) 70 #if !defined(OS_ANDROID)
70 #include "chrome/browser/download/download_dir_policy_handler.h" 71 #include "chrome/browser/download/download_dir_policy_handler.h"
71 #endif 72 #endif
72 73
73 #if defined(ENABLE_EXTENSIONS) 74 #if BUILDFLAG(ENABLE_EXTENSIONS)
74 #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handle r.h" 75 #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handle r.h"
75 #include "chrome/browser/extensions/extension_management_constants.h" 76 #include "chrome/browser/extensions/extension_management_constants.h"
76 #include "chrome/browser/extensions/policy_handlers.h" 77 #include "chrome/browser/extensions/policy_handlers.h"
77 #include "extensions/browser/pref_names.h" 78 #include "extensions/browser/pref_names.h"
78 #include "extensions/common/manifest.h" 79 #include "extensions/common/manifest.h"
79 #endif 80 #endif
80 81
81 #if defined(ENABLE_PLUGINS) 82 #if defined(ENABLE_PLUGINS)
82 #include "chrome/browser/plugins/plugin_policy_handler.h" 83 #include "chrome/browser/plugins/plugin_policy_handler.h"
83 #endif 84 #endif
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 #endif // defined(ENABLE_MEDIA_ROUTER) 411 #endif // defined(ENABLE_MEDIA_ROUTER)
411 #if defined(ENABLE_WEBRTC) 412 #if defined(ENABLE_WEBRTC)
412 { key::kWebRtcUdpPortRange, 413 { key::kWebRtcUdpPortRange,
413 prefs::kWebRTCUDPPortRange, 414 prefs::kWebRTCUDPPortRange,
414 base::Value::TYPE_STRING }, 415 base::Value::TYPE_STRING },
415 #endif // defined(ENABLE_WEBRTC) 416 #endif // defined(ENABLE_WEBRTC)
416 #if !defined(OS_MACOSX) 417 #if !defined(OS_MACOSX)
417 { key::kFullscreenAllowed, 418 { key::kFullscreenAllowed,
418 prefs::kFullscreenAllowed, 419 prefs::kFullscreenAllowed,
419 base::Value::TYPE_BOOLEAN }, 420 base::Value::TYPE_BOOLEAN },
420 #if defined(ENABLE_EXTENSIONS) 421 #if BUILDFLAG(ENABLE_EXTENSIONS)
421 { key::kFullscreenAllowed, 422 { key::kFullscreenAllowed,
422 extensions::pref_names::kAppFullscreenAllowed, 423 extensions::pref_names::kAppFullscreenAllowed,
423 base::Value::TYPE_BOOLEAN }, 424 base::Value::TYPE_BOOLEAN },
424 #endif // defined(ENABLE_EXTENSIONS) 425 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
425 #endif // !defined(OS_MACOSX) 426 #endif // !defined(OS_MACOSX)
426 427
427 #if defined(OS_CHROMEOS) 428 #if defined(OS_CHROMEOS)
428 { key::kChromeOsLockOnIdleSuspend, 429 { key::kChromeOsLockOnIdleSuspend,
429 prefs::kEnableAutoScreenLock, 430 prefs::kEnableAutoScreenLock,
430 base::Value::TYPE_BOOLEAN }, 431 base::Value::TYPE_BOOLEAN },
431 { key::kChromeOsReleaseChannel, 432 { key::kChromeOsReleaseChannel,
432 prefs::kChromeOsReleaseChannel, 433 prefs::kChromeOsReleaseChannel,
433 base::Value::TYPE_STRING }, 434 base::Value::TYPE_STRING },
434 { key::kDriveDisabled, 435 { key::kDriveDisabled,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 base::MakeUnique<base::FundamentalValue>( 683 base::MakeUnique<base::FundamentalValue>(
683 enabled ? safe_search_util::YOUTUBE_RESTRICT_MODERATE 684 enabled ? safe_search_util::YOUTUBE_RESTRICT_MODERATE
684 : safe_search_util::YOUTUBE_RESTRICT_OFF)); 685 : safe_search_util::YOUTUBE_RESTRICT_OFF));
685 } 686 }
686 } 687 }
687 688
688 private: 689 private:
689 DISALLOW_COPY_AND_ASSIGN(ForceYouTubeSafetyModePolicyHandler); 690 DISALLOW_COPY_AND_ASSIGN(ForceYouTubeSafetyModePolicyHandler);
690 }; 691 };
691 692
692 #if defined(ENABLE_EXTENSIONS) 693 #if BUILDFLAG(ENABLE_EXTENSIONS)
693 void GetExtensionAllowedTypesMap( 694 void GetExtensionAllowedTypesMap(
694 std::vector<std::unique_ptr<StringMappingListPolicyHandler::MappingEntry>>* 695 std::vector<std::unique_ptr<StringMappingListPolicyHandler::MappingEntry>>*
695 result) { 696 result) {
696 // Mapping from extension type names to Manifest::Type. 697 // Mapping from extension type names to Manifest::Type.
697 for (size_t index = 0; 698 for (size_t index = 0;
698 index < extensions::schema_constants::kAllowedTypesMapSize; 699 index < extensions::schema_constants::kAllowedTypesMapSize;
699 ++index) { 700 ++index) {
700 const extensions::schema_constants::AllowedTypesMapEntry& entry = 701 const extensions::schema_constants::AllowedTypesMapEntry& entry =
701 extensions::schema_constants::kAllowedTypesMap[index]; 702 extensions::schema_constants::kAllowedTypesMap[index];
702 result->push_back( 703 result->push_back(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 handlers->AddHandler(base::MakeUnique<JavascriptPolicyHandler>()); 765 handlers->AddHandler(base::MakeUnique<JavascriptPolicyHandler>());
765 handlers->AddHandler(base::MakeUnique<NetworkPredictionPolicyHandler>()); 766 handlers->AddHandler(base::MakeUnique<NetworkPredictionPolicyHandler>());
766 handlers->AddHandler(base::MakeUnique<RestoreOnStartupPolicyHandler>()); 767 handlers->AddHandler(base::MakeUnique<RestoreOnStartupPolicyHandler>());
767 handlers->AddHandler(base::MakeUnique<syncer::SyncPolicyHandler>()); 768 handlers->AddHandler(base::MakeUnique<syncer::SyncPolicyHandler>());
768 769
769 handlers->AddHandler(base::MakeUnique<StringMappingListPolicyHandler>( 770 handlers->AddHandler(base::MakeUnique<StringMappingListPolicyHandler>(
770 key::kEnableDeprecatedWebPlatformFeatures, 771 key::kEnableDeprecatedWebPlatformFeatures,
771 prefs::kEnableDeprecatedWebPlatformFeatures, 772 prefs::kEnableDeprecatedWebPlatformFeatures,
772 base::Bind(GetDeprecatedFeaturesMap))); 773 base::Bind(GetDeprecatedFeaturesMap)));
773 774
774 #if defined(ENABLE_EXTENSIONS) 775 #if BUILDFLAG(ENABLE_EXTENSIONS)
775 handlers->AddHandler(base::MakeUnique<extensions::ExtensionListPolicyHandler>( 776 handlers->AddHandler(base::MakeUnique<extensions::ExtensionListPolicyHandler>(
776 key::kExtensionInstallWhitelist, 777 key::kExtensionInstallWhitelist,
777 extensions::pref_names::kInstallAllowList, false)); 778 extensions::pref_names::kInstallAllowList, false));
778 handlers->AddHandler(base::MakeUnique<extensions::ExtensionListPolicyHandler>( 779 handlers->AddHandler(base::MakeUnique<extensions::ExtensionListPolicyHandler>(
779 key::kExtensionInstallBlacklist, extensions::pref_names::kInstallDenyList, 780 key::kExtensionInstallBlacklist, extensions::pref_names::kInstallDenyList,
780 true)); 781 true));
781 handlers->AddHandler( 782 handlers->AddHandler(
782 base::MakeUnique<extensions::ExtensionInstallForcelistPolicyHandler>()); 783 base::MakeUnique<extensions::ExtensionInstallForcelistPolicyHandler>());
783 handlers->AddHandler( 784 handlers->AddHandler(
784 base::MakeUnique<extensions::ExtensionURLPatternListPolicyHandler>( 785 base::MakeUnique<extensions::ExtensionURLPatternListPolicyHandler>(
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 #endif // defined(OS_CHROMEOS) 926 #endif // defined(OS_CHROMEOS)
926 927
927 #if defined(ENABLE_PLUGINS) 928 #if defined(ENABLE_PLUGINS)
928 handlers->AddHandler(base::MakeUnique<PluginPolicyHandler>()); 929 handlers->AddHandler(base::MakeUnique<PluginPolicyHandler>());
929 #endif // defined(ENABLE_PLUGINS) 930 #endif // defined(ENABLE_PLUGINS)
930 931
931 return handlers; 932 return handlers;
932 } 933 }
933 934
934 } // namespace policy 935 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698