| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/test/test_extensions_client.h" | 5 #include "extensions/test/test_extensions_client.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "extensions/common/api/generated_schemas.h" | 8 #include "extensions/common/api/generated_schemas.h" |
| 9 #include "extensions/common/common_manifest_handlers.h" | 9 #include "extensions/common/common_manifest_handlers.h" |
| 10 #include "extensions/common/extension_urls.h" | 10 #include "extensions/common/extension_urls.h" |
| 11 #include "extensions/common/extensions_aliases.h" |
| 11 #include "extensions/common/features/api_feature.h" | 12 #include "extensions/common/features/api_feature.h" |
| 12 #include "extensions/common/features/behavior_feature.h" | 13 #include "extensions/common/features/behavior_feature.h" |
| 13 #include "extensions/common/features/feature_provider.h" | 14 #include "extensions/common/features/feature_provider.h" |
| 14 #include "extensions/common/features/json_feature_provider_source.h" | 15 #include "extensions/common/features/json_feature_provider_source.h" |
| 15 #include "extensions/common/features/manifest_feature.h" | 16 #include "extensions/common/features/manifest_feature.h" |
| 16 #include "extensions/common/features/permission_feature.h" | 17 #include "extensions/common/features/permission_feature.h" |
| 17 #include "extensions/common/manifest_handler.h" | 18 #include "extensions/common/manifest_handler.h" |
| 18 #include "extensions/common/permissions/extensions_api_permissions.h" | 19 #include "extensions/common/permissions/extensions_api_permissions.h" |
| 19 #include "extensions/common/permissions/permissions_info.h" | 20 #include "extensions/common/permissions/permissions_info.h" |
| 20 #include "extensions/common/url_pattern_set.h" | 21 #include "extensions/common/url_pattern_set.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void TestExtensionsClient::Initialize() { | 56 void TestExtensionsClient::Initialize() { |
| 56 // Registration could already be finalized in unit tests, where the utility | 57 // Registration could already be finalized in unit tests, where the utility |
| 57 // thread runs in-process. | 58 // thread runs in-process. |
| 58 if (!ManifestHandler::IsRegistrationFinalized()) { | 59 if (!ManifestHandler::IsRegistrationFinalized()) { |
| 59 RegisterCommonManifestHandlers(); | 60 RegisterCommonManifestHandlers(); |
| 60 ManifestHandler::FinalizeRegistration(); | 61 ManifestHandler::FinalizeRegistration(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 // Allow the core API permissions. | 64 // Allow the core API permissions. |
| 64 static ExtensionsAPIPermissions extensions_api_permissions; | 65 static ExtensionsAPIPermissions extensions_api_permissions; |
| 65 PermissionsInfo::GetInstance()->AddProvider(extensions_api_permissions); | 66 PermissionsInfo::GetInstance()->AddProvider(extensions_api_permissions, |
| 67 GetExtensionsPermissionAliases()); |
| 66 } | 68 } |
| 67 | 69 |
| 68 const PermissionMessageProvider& | 70 const PermissionMessageProvider& |
| 69 TestExtensionsClient::GetPermissionMessageProvider() const { | 71 TestExtensionsClient::GetPermissionMessageProvider() const { |
| 70 static TestPermissionMessageProvider provider; | 72 static TestPermissionMessageProvider provider; |
| 71 return provider; | 73 return provider; |
| 72 } | 74 } |
| 73 | 75 |
| 74 const std::string TestExtensionsClient::GetProductName() { | 76 const std::string TestExtensionsClient::GetProductName() { |
| 75 return "extensions_test"; | 77 return "extensions_test"; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( | 162 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( |
| 161 const Extension* extension) { | 163 const Extension* extension) { |
| 162 std::set<base::FilePath> result = | 164 std::set<base::FilePath> result = |
| 163 ExtensionsClient::GetBrowserImagePaths(extension); | 165 ExtensionsClient::GetBrowserImagePaths(extension); |
| 164 for (auto* filter : browser_image_filters_) | 166 for (auto* filter : browser_image_filters_) |
| 165 filter->Filter(extension, &result); | 167 filter->Filter(extension, &result); |
| 166 return result; | 168 return result; |
| 167 } | 169 } |
| 168 | 170 |
| 169 } // namespace extensions | 171 } // namespace extensions |
| OLD | NEW |