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 "apps/shell/common/shell_extensions_client.h" | 5 #include "apps/shell/common/shell_extensions_client.h" |
6 | 6 |
7 #include "apps/shell/common/api/generated_schemas.h" | 7 #include "apps/shell/common/api/generated_schemas.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "extensions/common/api/generated_schemas.h" | 10 #include "extensions/common/api/generated_schemas.h" |
11 #include "extensions/common/api/sockets/sockets_manifest_handler.h" | 11 #include "extensions/common/api/sockets/sockets_manifest_handler.h" |
12 #include "extensions/common/common_manifest_handlers.h" | 12 #include "extensions/common/common_manifest_handlers.h" |
13 #include "extensions/common/features/api_feature.h" | 13 #include "extensions/common/features/api_feature.h" |
14 #include "extensions/common/features/base_feature_provider.h" | 14 #include "extensions/common/features/base_feature_provider.h" |
15 #include "extensions/common/features/json_feature_provider_source.h" | 15 #include "extensions/common/features/json_feature_provider_source.h" |
16 #include "extensions/common/features/manifest_feature.h" | 16 #include "extensions/common/features/manifest_feature.h" |
17 #include "extensions/common/features/permission_feature.h" | 17 #include "extensions/common/features/permission_feature.h" |
18 #include "extensions/common/features/simple_feature.h" | 18 #include "extensions/common/features/simple_feature.h" |
19 #include "extensions/common/manifest_handler.h" | 19 #include "extensions/common/manifest_handler.h" |
20 #include "extensions/common/manifest_handlers/icons_handler.h" | |
20 #include "extensions/common/permissions/permission_message_provider.h" | 21 #include "extensions/common/permissions/permission_message_provider.h" |
21 #include "extensions/common/permissions/permissions_info.h" | 22 #include "extensions/common/permissions/permissions_info.h" |
22 #include "extensions/common/permissions/permissions_provider.h" | 23 #include "extensions/common/permissions/permissions_provider.h" |
23 #include "extensions/common/url_pattern_set.h" | 24 #include "extensions/common/url_pattern_set.h" |
24 #include "grit/app_shell_resources.h" | 25 #include "grit/app_shell_resources.h" |
25 #include "grit/extensions_resources.h" | 26 #include "grit/extensions_resources.h" |
26 | 27 |
27 using extensions::APIPermissionInfo; | 28 using extensions::APIPermissionInfo; |
28 using extensions::APIPermissionSet; | 29 using extensions::APIPermissionSet; |
29 using extensions::BaseFeatureProvider; | 30 using extensions::BaseFeatureProvider; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 } | 99 } |
99 | 100 |
100 void ShellExtensionsClient::Initialize() { | 101 void ShellExtensionsClient::Initialize() { |
101 extensions::RegisterCommonManifestHandlers(); | 102 extensions::RegisterCommonManifestHandlers(); |
102 | 103 |
103 // TODO(rockot): API manifest handlers which move out to src/extensions | 104 // TODO(rockot): API manifest handlers which move out to src/extensions |
104 // should either end up in RegisterCommonManifestHandlers or some new | 105 // should either end up in RegisterCommonManifestHandlers or some new |
105 // initialization step specifically for API manifest handlers. | 106 // initialization step specifically for API manifest handlers. |
106 (new extensions::SocketsManifestHandler)->Register(); | 107 (new extensions::SocketsManifestHandler)->Register(); |
107 | 108 |
109 // TODO(mukai): Why not icons handler in common? | |
110 (new extensions::IconsHandler)->Register(); | |
oshima
2014/06/19 23:06:22
I'll leave this to james
| |
111 | |
108 extensions::ManifestHandler::FinalizeRegistration(); | 112 extensions::ManifestHandler::FinalizeRegistration(); |
109 // TODO(jamescook): Do we need to whitelist any extensions? | 113 // TODO(jamescook): Do we need to whitelist any extensions? |
110 | 114 |
111 extensions::PermissionsInfo::GetInstance()->AddProvider( | 115 extensions::PermissionsInfo::GetInstance()->AddProvider( |
112 extensions_api_permissions_); | 116 extensions_api_permissions_); |
113 } | 117 } |
114 | 118 |
115 const extensions::PermissionMessageProvider& | 119 const extensions::PermissionMessageProvider& |
116 ShellExtensionsClient::GetPermissionMessageProvider() const { | 120 ShellExtensionsClient::GetPermissionMessageProvider() const { |
117 NOTIMPLEMENTED(); | 121 NOTIMPLEMENTED(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 return extensions::core_api::GeneratedSchemas::Get(name); | 211 return extensions::core_api::GeneratedSchemas::Get(name); |
208 } | 212 } |
209 | 213 |
210 void ShellExtensionsClient::RegisterAPISchemaResources( | 214 void ShellExtensionsClient::RegisterAPISchemaResources( |
211 extensions::ExtensionAPI* api) const { | 215 extensions::ExtensionAPI* api) const { |
212 } | 216 } |
213 | 217 |
214 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { return true; } | 218 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { return true; } |
215 | 219 |
216 } // namespace apps | 220 } // namespace apps |
OLD | NEW |