diff options
author | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 06:41:29 +0000 |
---|---|---|
committer | rockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 06:41:29 +0000 |
commit | 68cb5657f36c7fcc75074146bedc77ae60e13b24 (patch) | |
tree | be4466255116a981d0ad60a43f047fcd277f2d00 /apps | |
parent | 21bbb2cea53c40cd2a463756e969a0ce1651fe92 (diff) | |
download | chromium_src-68cb5657f36c7fcc75074146bedc77ae60e13b24.zip chromium_src-68cb5657f36c7fcc75074146bedc77ae60e13b24.tar.gz chromium_src-68cb5657f36c7fcc75074146bedc77ae60e13b24.tar.bz2 |
Move sockets APIs out of src/chrome
This moves sockets APIs out of src/chrome and into
src/extensions. The IDLs and function
implementations are moved, and the groundwork is
set for moving additional APIs.
The API tests remain in src/chrome, and several
references to src/chrome still remain for
permissions/features/manifest stuff.
BUG=349787
TBR=erg@chromium.org for profiles change
TBR=jar@chromium.org for +net to //extensions/browser/DEPS
Review URL: https://codereview.chromium.org/183893041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r-- | apps/apps.gypi | 2 | ||||
-rw-r--r-- | apps/shell/browser/shell_extensions_browser_client.cc | 6 | ||||
-rw-r--r-- | apps/shell/common/DEPS | 2 | ||||
-rw-r--r-- | apps/shell/common/shell_extensions_client.cc | 19 | ||||
-rw-r--r-- | apps/shell/common/shell_extensions_client.h | 3 |
5 files changed, 29 insertions, 3 deletions
diff --git a/apps/apps.gypi b/apps/apps.gypi index 367835b..7033136 100644 --- a/apps/apps.gypi +++ b/apps/apps.gypi @@ -15,7 +15,7 @@ # browser, then we can clean up these dependencies. 'dependencies': [ 'browser_extensions', - 'common/extensions/api/api.gyp:api', + 'common/extensions/api/api.gyp:chrome_api', '../skia/skia.gyp:skia', ], 'include_dirs': [ diff --git a/apps/shell/browser/shell_extensions_browser_client.cc b/apps/shell/browser/shell_extensions_browser_client.cc index 7245960..8877d9e 100644 --- a/apps/shell/browser/shell_extensions_browser_client.cc +++ b/apps/shell/browser/shell_extensions_browser_client.cc @@ -15,6 +15,7 @@ #include "extensions/browser/api/extensions_api_client.h" #include "extensions/browser/app_sorting.h" #include "extensions/browser/extension_prefs.h" +#include "extensions/common/api/generated_api.h" using content::BrowserContext; @@ -157,8 +158,9 @@ ShellExtensionsBrowserClient::GetExtensionSystemFactory() { void ShellExtensionsBrowserClient::RegisterExtensionFunctions( ExtensionFunctionRegistry* registry) const { - // TODO(rockot): Remove this once we have enough APIs moved out of src/chrome - // See http://crbug.com/349042 + extensions::core_api::GeneratedFunctionRegistry::RegisterAll(registry); + // TODO(rockot): Remove dependency on src/chrome once we have some core APIs + // moved out. See http://crbug.com/349042. extensions::api::GeneratedFunctionRegistry::RegisterAll(registry); } diff --git a/apps/shell/common/DEPS b/apps/shell/common/DEPS index c5e4e60..3c4c60a 100644 --- a/apps/shell/common/DEPS +++ b/apps/shell/common/DEPS @@ -1,6 +1,8 @@ include_rules = [ # TODO(jamescook): Remove these. http://crbug.com/305404 # Chrome pieces for app_shell bring-up. + "+chrome/common/extensions/api/generated_api.h", + "+chrome/common/extensions/api/generated_schemas.h", "+chrome/common/extensions/api/sockets/sockets_manifest_handler.h", "+chrome/common/extensions/features/base_feature_provider.h", "+chrome/common/extensions/permissions/chrome_api_permissions.h", diff --git a/apps/shell/common/shell_extensions_client.cc b/apps/shell/common/shell_extensions_client.cc index 99a68fb..efefb37 100644 --- a/apps/shell/common/shell_extensions_client.cc +++ b/apps/shell/common/shell_extensions_client.cc @@ -5,9 +5,11 @@ #include "apps/shell/common/shell_extensions_client.h" #include "base/logging.h" +#include "chrome/common/extensions/api/generated_schemas.h" #include "chrome/common/extensions/api/sockets/sockets_manifest_handler.h" #include "chrome/common/extensions/features/base_feature_provider.h" #include "chrome/common/extensions/permissions/chrome_api_permissions.h" +#include "extensions/common/api/generated_schemas.h" #include "extensions/common/common_manifest_handlers.h" #include "extensions/common/manifest_handler.h" #include "extensions/common/permissions/permission_message_provider.h" @@ -148,4 +150,21 @@ bool ShellExtensionsClient::IsScriptableURL(const GURL& url, return true; } +bool ShellExtensionsClient::IsAPISchemaGenerated( + const std::string& name) const { + // TODO(rockot): Remove dependency on src/chrome once we have some core APIs + // moved out. See http://crbug.com/349042. + return extensions::api::GeneratedSchemas::IsGenerated(name) || + extensions::core_api::GeneratedSchemas::IsGenerated(name); +} + +base::StringPiece ShellExtensionsClient::GetAPISchema( + const std::string& name) const { + // TODO(rockot): Remove dependency on src/chrome once we have some core APIs + // moved out. See http://crbug.com/349042. + if (extensions::api::GeneratedSchemas::IsGenerated(name)) + return extensions::api::GeneratedSchemas::Get(name); + return extensions::core_api::GeneratedSchemas::Get(name); +} + } // namespace apps diff --git a/apps/shell/common/shell_extensions_client.h b/apps/shell/common/shell_extensions_client.h index 9d5e01e..457d3c4 100644 --- a/apps/shell/common/shell_extensions_client.h +++ b/apps/shell/common/shell_extensions_client.h @@ -37,6 +37,9 @@ class ShellExtensionsClient : public extensions::ExtensionsClient { const extensions::APIPermissionSet& api_permissions) const OVERRIDE; virtual bool IsScriptableURL(const GURL& url, std::string* error) const OVERRIDE; + virtual bool IsAPISchemaGenerated(const std::string& name) const OVERRIDE; + virtual base::StringPiece GetAPISchema(const std::string& name) const + OVERRIDE; private: ScriptingWhitelist scripting_whitelist_; |