OLD | NEW |
---|---|
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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "components/user_manager/user.h" | 43 #include "components/user_manager/user.h" |
44 #include "components/user_manager/user_manager.h" | 44 #include "components/user_manager/user_manager.h" |
45 #endif | 45 #endif |
46 | 46 |
47 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 47 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
48 #include "chrome/browser/download/download_dir_policy_handler.h" | 48 #include "chrome/browser/download/download_dir_policy_handler.h" |
49 #endif | 49 #endif |
50 | 50 |
51 #if defined(ENABLE_EXTENSIONS) | 51 #if defined(ENABLE_EXTENSIONS) |
52 #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handle r.h" | 52 #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handle r.h" |
53 #include "chrome/browser/extensions/extension_management_constants.h" | |
53 #include "chrome/browser/extensions/policy_handlers.h" | 54 #include "chrome/browser/extensions/policy_handlers.h" |
54 #include "extensions/browser/pref_names.h" | 55 #include "extensions/browser/pref_names.h" |
55 #include "extensions/common/manifest.h" | 56 #include "extensions/common/manifest.h" |
56 #endif | 57 #endif |
57 | 58 |
58 namespace policy { | 59 namespace policy { |
59 | 60 |
60 namespace { | 61 namespace { |
61 | 62 |
62 // List of policy types to preference names. This is used for simple policies | 63 // List of policy types to preference names. This is used for simple policies |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 { key::kBrowserAddPersonEnabled, | 487 { key::kBrowserAddPersonEnabled, |
487 prefs::kBrowserAddPersonEnabled, | 488 prefs::kBrowserAddPersonEnabled, |
488 base::Value::TYPE_BOOLEAN }, | 489 base::Value::TYPE_BOOLEAN }, |
489 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) | 490 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |
490 }; | 491 }; |
491 | 492 |
492 #if defined(ENABLE_EXTENSIONS) | 493 #if defined(ENABLE_EXTENSIONS) |
493 void GetExtensionAllowedTypesMap( | 494 void GetExtensionAllowedTypesMap( |
494 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { | 495 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { |
495 // Mapping from extension type names to Manifest::Type. | 496 // Mapping from extension type names to Manifest::Type. |
496 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | 497 for (const extensions::schema_constants::AllowedTypesMapEntry* it = |
497 "extension", scoped_ptr<base::Value>(new base::FundamentalValue( | 498 extensions::schema_constants::kAllowedTypesMap; |
498 extensions::Manifest::TYPE_EXTENSION)))); | 499 it->name; |
499 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | 500 ++it) { |
Joao da Silva
2014/09/18 15:23:54
Needs to be updated to use an int iterator and kAl
binjin
2014/09/18 15:49:04
Done.
| |
500 "theme", scoped_ptr<base::Value>(new base::FundamentalValue( | 501 result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
501 extensions::Manifest::TYPE_THEME)))); | 502 it->name, |
502 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | 503 scoped_ptr<base::Value>( |
503 "user_script", scoped_ptr<base::Value>(new base::FundamentalValue( | 504 new base::FundamentalValue(it->manifest_type)))); |
504 extensions::Manifest::TYPE_USER_SCRIPT)))); | 505 } |
505 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | |
506 "hosted_app", scoped_ptr<base::Value>(new base::FundamentalValue( | |
507 extensions::Manifest::TYPE_HOSTED_APP)))); | |
508 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | |
509 "legacy_packaged_app", scoped_ptr<base::Value>(new base::FundamentalValue( | |
510 extensions::Manifest::TYPE_LEGACY_PACKAGED_APP)))); | |
511 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | |
512 "platform_app", scoped_ptr<base::Value>(new base::FundamentalValue( | |
513 extensions::Manifest::TYPE_PLATFORM_APP)))); | |
514 } | 506 } |
515 #endif | 507 #endif |
516 | 508 |
517 #if !defined(OS_IOS) | 509 #if !defined(OS_IOS) |
518 void GetDeprecatedFeaturesMap( | 510 void GetDeprecatedFeaturesMap( |
519 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { | 511 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { |
520 // Maps feature tags as specified in policy to the corresponding switch to | 512 // Maps feature tags as specified in policy to the corresponding switch to |
521 // re-enable them. | 513 // re-enable them. |
522 // TODO: Remove after 2015-04-30 per http://crbug.com/374782. | 514 // TODO: Remove after 2015-04-30 per http://crbug.com/374782. |
523 result->push_back(new StringMappingListPolicyHandler::MappingEntry( | 515 result->push_back(new StringMappingListPolicyHandler::MappingEntry( |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
792 chrome_schema, | 784 chrome_schema, |
793 SCHEMA_STRICT, | 785 SCHEMA_STRICT, |
794 SimpleSchemaValidatingPolicyHandler::RECOMMENDED_ALLOWED, | 786 SimpleSchemaValidatingPolicyHandler::RECOMMENDED_ALLOWED, |
795 SimpleSchemaValidatingPolicyHandler::MANDATORY_PROHIBITED))); | 787 SimpleSchemaValidatingPolicyHandler::MANDATORY_PROHIBITED))); |
796 #endif // defined(OS_CHROMEOS) | 788 #endif // defined(OS_CHROMEOS) |
797 | 789 |
798 return handlers.Pass(); | 790 return handlers.Pass(); |
799 } | 791 } |
800 | 792 |
801 } // namespace policy | 793 } // namespace policy |
OLD | NEW |