summaryrefslogtreecommitdiffstats
path: root/extensions/shell/browser
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2015-07-23 11:27:22 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-23 18:28:16 +0000
commite58e6223146f09405229146fce6c1bfe6b71e4ce (patch)
tree8f32850890b2057b11cfdf2bc02cdba3a12c3e1d /extensions/shell/browser
parentf340ae7cfdf33370ea3aed173ab2e86fe8415936 (diff)
downloadchromium_src-e58e6223146f09405229146fce6c1bfe6b71e4ce.zip
chromium_src-e58e6223146f09405229146fce6c1bfe6b71e4ce.tar.gz
chromium_src-e58e6223146f09405229146fce6c1bfe6b71e4ce.tar.bz2
Generate all extension schema namespaces as "api" and instead vary the generated bundle names.
At the moment the 3 modules that use extension API schemas, those in extensions/common/api, chrome/common/extensions/api, and extensions/shell/api, are generated with different C++ namespaces: "core_api", "api", and "shell::api" respectively. This is a pointless distinction to make since as far as JS is concerned they must all go on the window.chrome object, therefore namespace conflicts are impossible. It just ends up adding code noise. The only problem it solves is that all bundle compiles are generated to the same name, "GeneratedSchemas" and "GeneratedFunctionRegistry". This patch solves that a different way, by adding a JSON schema compiler option to give those generated classes a prefix such that they are "GeneratedSchemas", "ChromeGeneratedSchemas", and "ShellGeneratedSchemas" respectively. This lets us to a global substitution from "core_api" to just "api". R=rockot@chromium.org, dpranke@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/1226353004 Cr-Commit-Position: refs/heads/master@{#340119}
Diffstat (limited to 'extensions/shell/browser')
-rw-r--r--extensions/shell/browser/shell_display_info_provider.cc4
-rw-r--r--extensions/shell/browser/shell_display_info_provider.h4
-rw-r--r--extensions/shell/browser/shell_extensions_browser_client.cc4
-rw-r--r--extensions/shell/browser/shell_runtime_api_delegate.cc6
-rw-r--r--extensions/shell/browser/shell_runtime_api_delegate.h2
5 files changed, 10 insertions, 10 deletions
diff --git a/extensions/shell/browser/shell_display_info_provider.cc b/extensions/shell/browser/shell_display_info_provider.cc
index 1666136..32239ab 100644
--- a/extensions/shell/browser/shell_display_info_provider.cc
+++ b/extensions/shell/browser/shell_display_info_provider.cc
@@ -14,7 +14,7 @@ ShellDisplayInfoProvider::~ShellDisplayInfoProvider() {
bool ShellDisplayInfoProvider::SetInfo(
const std::string& display_id,
- const core_api::system_display::DisplayProperties& info,
+ const api::system_display::DisplayProperties& info,
std::string* error) {
*error = "Not implemented";
return false;
@@ -22,7 +22,7 @@ bool ShellDisplayInfoProvider::SetInfo(
void ShellDisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(
const gfx::Display& display,
- extensions::core_api::system_display::DisplayUnitInfo* unit) {
+ extensions::api::system_display::DisplayUnitInfo* unit) {
static bool logged_once = false;
if (!logged_once) {
NOTIMPLEMENTED();
diff --git a/extensions/shell/browser/shell_display_info_provider.h b/extensions/shell/browser/shell_display_info_provider.h
index 61cea1c..52c8576 100644
--- a/extensions/shell/browser/shell_display_info_provider.h
+++ b/extensions/shell/browser/shell_display_info_provider.h
@@ -16,11 +16,11 @@ class ShellDisplayInfoProvider : public DisplayInfoProvider {
// DisplayInfoProvider implementation.
bool SetInfo(const std::string& display_id,
- const core_api::system_display::DisplayProperties& info,
+ const api::system_display::DisplayProperties& info,
std::string* error) override;
void UpdateDisplayUnitInfoForPlatform(
const gfx::Display& display,
- extensions::core_api::system_display::DisplayUnitInfo* unit) override;
+ extensions::api::system_display::DisplayUnitInfo* unit) override;
gfx::Screen* GetActiveScreen() override;
private:
diff --git a/extensions/shell/browser/shell_extensions_browser_client.cc b/extensions/shell/browser/shell_extensions_browser_client.cc
index df0f872..6fc34e8 100644
--- a/extensions/shell/browser/shell_extensions_browser_client.cc
+++ b/extensions/shell/browser/shell_extensions_browser_client.cc
@@ -178,10 +178,10 @@ ShellExtensionsBrowserClient::GetExtensionSystemFactory() {
void ShellExtensionsBrowserClient::RegisterExtensionFunctions(
ExtensionFunctionRegistry* registry) const {
// Register core extension-system APIs.
- core_api::GeneratedFunctionRegistry::RegisterAll(registry);
+ api::GeneratedFunctionRegistry::RegisterAll(registry);
// app_shell-only APIs.
- shell::api::GeneratedFunctionRegistry::RegisterAll(registry);
+ shell::api::ShellGeneratedFunctionRegistry::RegisterAll(registry);
}
void ShellExtensionsBrowserClient::RegisterMojoServices(
diff --git a/extensions/shell/browser/shell_runtime_api_delegate.cc b/extensions/shell/browser/shell_runtime_api_delegate.cc
index 668fcce..77dacab 100644
--- a/extensions/shell/browser/shell_runtime_api_delegate.cc
+++ b/extensions/shell/browser/shell_runtime_api_delegate.cc
@@ -11,7 +11,7 @@
#include "chromeos/dbus/power_manager_client.h"
#endif
-using extensions::core_api::runtime::PlatformInfo;
+using extensions::api::runtime::PlatformInfo;
namespace extensions {
@@ -46,9 +46,9 @@ void ShellRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) {
bool ShellRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
#if defined(OS_CHROMEOS)
- info->os = core_api::runtime::PLATFORM_OS_CROS;
+ info->os = api::runtime::PLATFORM_OS_CROS;
#elif defined(OS_LINUX)
- info->os = core_api::runtime::PLATFORM_OS_LINUX;
+ info->os = api::runtime::PLATFORM_OS_LINUX;
#endif
return true;
}
diff --git a/extensions/shell/browser/shell_runtime_api_delegate.h b/extensions/shell/browser/shell_runtime_api_delegate.h
index 816423b..f0a8d38 100644
--- a/extensions/shell/browser/shell_runtime_api_delegate.h
+++ b/extensions/shell/browser/shell_runtime_api_delegate.h
@@ -24,7 +24,7 @@ class ShellRuntimeAPIDelegate : public RuntimeAPIDelegate {
bool CheckForUpdates(const std::string& extension_id,
const UpdateCheckCallback& callback) override;
void OpenURL(const GURL& uninstall_url) override;
- bool GetPlatformInfo(core_api::runtime::PlatformInfo* info) override;
+ bool GetPlatformInfo(api::runtime::PlatformInfo* info) override;
bool RestartDevice(std::string* error_message) override;
private: