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

Unified Diff: extensions/shell/common/shell_extensions_client.cc

Issue 412713002: Move apps/shell to extensions/shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 40% Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/shell/common/shell_extensions_client.h ('k') | extensions/shell/common/switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/common/shell_extensions_client.cc
diff --git a/apps/shell/common/shell_extensions_client.cc b/extensions/shell/common/shell_extensions_client.cc
similarity index 74%
rename from apps/shell/common/shell_extensions_client.cc
rename to extensions/shell/common/shell_extensions_client.cc
index cc2f055762b6cd7c08ecf3489361376bae8f035b..23504282b79f391bf7c33dbb1d5fa56512b59a4e 100644
--- a/apps/shell/common/shell_extensions_client.cc
+++ b/extensions/shell/common/shell_extensions_client.cc
@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "apps/shell/common/shell_extensions_client.h"
+#include "extensions/shell/common/shell_extensions_client.h"
-#include "apps/shell/common/api/generated_schemas.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "extensions/common/api/generated_schemas.h"
@@ -21,34 +20,22 @@
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/common/permissions/permissions_provider.h"
#include "extensions/common/url_pattern_set.h"
+#include "extensions/shell/common/api/generated_schemas.h"
#include "grit/app_shell_resources.h"
#include "grit/extensions_resources.h"
-using extensions::APIPermissionInfo;
-using extensions::APIPermissionSet;
-using extensions::BaseFeatureProvider;
-using extensions::Extension;
-using extensions::FeatureProvider;
-using extensions::JSONFeatureProviderSource;
-using extensions::Manifest;
-using extensions::PermissionMessage;
-using extensions::PermissionMessages;
-using extensions::PermissionSet;
-using extensions::URLPatternSet;
-
-namespace apps {
+namespace extensions {
namespace {
template <class FeatureClass>
-extensions::SimpleFeature* CreateFeature() {
+SimpleFeature* CreateFeature() {
return new FeatureClass;
}
// TODO(jamescook): Refactor ChromePermissionsMessageProvider so we can share
// code. For now, this implementation does nothing.
-class ShellPermissionMessageProvider
- : public extensions::PermissionMessageProvider {
+class ShellPermissionMessageProvider : public PermissionMessageProvider {
public:
ShellPermissionMessageProvider() {}
virtual ~ShellPermissionMessageProvider() {}
@@ -91,28 +78,27 @@ base::LazyInstance<ShellPermissionMessageProvider>
} // namespace
ShellExtensionsClient::ShellExtensionsClient()
- : extensions_api_permissions_(extensions::ExtensionsAPIPermissions()) {
+ : extensions_api_permissions_(ExtensionsAPIPermissions()) {
}
ShellExtensionsClient::~ShellExtensionsClient() {
}
void ShellExtensionsClient::Initialize() {
- extensions::RegisterCommonManifestHandlers();
+ RegisterCommonManifestHandlers();
// TODO(rockot): API manifest handlers which move out to src/extensions
// should either end up in RegisterCommonManifestHandlers or some new
// initialization step specifically for API manifest handlers.
- (new extensions::SocketsManifestHandler)->Register();
+ (new SocketsManifestHandler)->Register();
- extensions::ManifestHandler::FinalizeRegistration();
+ ManifestHandler::FinalizeRegistration();
// TODO(jamescook): Do we need to whitelist any extensions?
- extensions::PermissionsInfo::GetInstance()->AddProvider(
- extensions_api_permissions_);
+ PermissionsInfo::GetInstance()->AddProvider(extensions_api_permissions_);
}
-const extensions::PermissionMessageProvider&
+const PermissionMessageProvider&
ShellExtensionsClient::GetPermissionMessageProvider() const {
NOTIMPLEMENTED();
return g_permission_message_provider.Get();
@@ -124,14 +110,14 @@ scoped_ptr<FeatureProvider> ShellExtensionsClient::CreateFeatureProvider(
scoped_ptr<JSONFeatureProviderSource> source(
CreateFeatureProviderSource(name));
if (name == "api") {
- provider.reset(new BaseFeatureProvider(
- source->dictionary(), CreateFeature<extensions::APIFeature>));
+ provider.reset(new BaseFeatureProvider(source->dictionary(),
+ CreateFeature<APIFeature>));
} else if (name == "manifest") {
- provider.reset(new BaseFeatureProvider(
- source->dictionary(), CreateFeature<extensions::ManifestFeature>));
+ provider.reset(new BaseFeatureProvider(source->dictionary(),
+ CreateFeature<ManifestFeature>));
} else if (name == "permission") {
- provider.reset(new BaseFeatureProvider(
- source->dictionary(), CreateFeature<extensions::PermissionFeature>));
+ provider.reset(new BaseFeatureProvider(source->dictionary(),
+ CreateFeature<PermissionFeature>));
} else {
NOTREACHED();
}
@@ -169,7 +155,7 @@ void ShellExtensionsClient::SetScriptingWhitelist(
scripting_whitelist_ = whitelist;
}
-const extensions::ExtensionsClient::ScriptingWhitelist&
+const ExtensionsClient::ScriptingWhitelist&
ShellExtensionsClient::GetScriptingWhitelist() const {
// TODO(jamescook): Real whitelist.
return scripting_whitelist_;
@@ -194,23 +180,25 @@ bool ShellExtensionsClient::IsAPISchemaGenerated(
// moved out. See http://crbug.com/349042.
// Special-case our simplified app.runtime implementation because we don't
// have the Chrome app APIs available.
- return extensions::core_api::GeneratedSchemas::IsGenerated(name) ||
- apps::shell_api::GeneratedSchemas::IsGenerated(name);
+ return core_api::GeneratedSchemas::IsGenerated(name) ||
+ shell_api::GeneratedSchemas::IsGenerated(name);
}
base::StringPiece ShellExtensionsClient::GetAPISchema(
const std::string& name) const {
// Schema for chrome.shell APIs.
- if (apps::shell_api::GeneratedSchemas::IsGenerated(name))
- return apps::shell_api::GeneratedSchemas::Get(name);
+ if (shell_api::GeneratedSchemas::IsGenerated(name))
+ return shell_api::GeneratedSchemas::Get(name);
- return extensions::core_api::GeneratedSchemas::Get(name);
+ return core_api::GeneratedSchemas::Get(name);
}
void ShellExtensionsClient::RegisterAPISchemaResources(
- extensions::ExtensionAPI* api) const {
+ ExtensionAPI* api) const {
}
-bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { return true; }
+bool ShellExtensionsClient::ShouldSuppressFatalErrors() const {
+ return true;
+}
-} // namespace apps
+} // namespace extensions
« no previous file with comments | « extensions/shell/common/shell_extensions_client.h ('k') | extensions/shell/common/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698