diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 03:39:36 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 03:39:36 +0000 |
commit | 7685f64a35b6d029f7d11ce752dc126163d9474e (patch) | |
tree | 0cb10d4ed10d781bc6de27672bbcc8528134baab | |
parent | af97fe7d55c6310aacf1585bdbd8d38e3bc4c080 (diff) | |
download | chromium_src-7685f64a35b6d029f7d11ce752dc126163d9474e.zip chromium_src-7685f64a35b6d029f7d11ce752dc126163d9474e.tar.gz chromium_src-7685f64a35b6d029f7d11ce752dc126163d9474e.tar.bz2 |
Move apps/shell to extensions/shell.
This does:
- Move files
- Fix up all namespaces in these files to be extensions, not apps
- Clean up DEPS files
This does not:
- Change the name of the build targets (app_shell, app_shell_browsertests)
BUG=394987
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/412713002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285144 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | apps/shell/app/DEPS | 12 | ||||
-rw-r--r-- | apps/shell/common/DEPS | 6 | ||||
-rw-r--r-- | apps/shell/common/shell_extensions_client.h | 58 | ||||
-rw-r--r-- | apps/shell/test/DEPS | 4 | ||||
-rw-r--r-- | athena/activity/public/activity_factory.h | 11 | ||||
-rw-r--r-- | athena/content/DEPS | 2 | ||||
-rw-r--r-- | athena/content/app_activity.cc | 4 | ||||
-rw-r--r-- | athena/content/app_activity.h | 6 | ||||
-rw-r--r-- | athena/content/content_activity_factory.cc | 2 | ||||
-rw-r--r-- | athena/content/content_app_model_builder.cc | 2 | ||||
-rw-r--r-- | athena/content/public/content_activity_factory.h | 2 | ||||
-rw-r--r-- | athena/main/DEPS | 10 | ||||
-rw-r--r-- | athena/main/athena_app_window_controller.cc | 6 | ||||
-rw-r--r-- | athena/main/athena_app_window_controller.h | 8 | ||||
-rw-r--r-- | athena/main/athena_main.cc | 55 | ||||
-rw-r--r-- | athena/main/athena_main.gyp | 2 | ||||
-rw-r--r-- | athena/resources/athena_resources.gyp | 2 | ||||
-rw-r--r-- | athena/test/sample_activity_factory.cc | 2 | ||||
-rw-r--r-- | athena/test/sample_activity_factory.h | 2 | ||||
-rw-r--r-- | build/all.gyp | 2 | ||||
-rw-r--r-- | extensions/DEPS | 1 | ||||
-rw-r--r-- | extensions/renderer/DEPS | 2 | ||||
-rw-r--r-- | extensions/shell/DEPS (renamed from apps/shell/DEPS) | 8 | ||||
-rw-r--r-- | extensions/shell/OWNERS (renamed from apps/shell/OWNERS) | 0 | ||||
-rw-r--r-- | extensions/shell/README (renamed from apps/shell/README) | 0 | ||||
-rw-r--r-- | extensions/shell/app/DEPS | 7 | ||||
-rw-r--r-- | extensions/shell/app/README (renamed from apps/shell/app/README) | 0 | ||||
-rw-r--r-- | extensions/shell/app/shell_main.cc (renamed from apps/shell/app/shell_main.cc) | 6 | ||||
-rw-r--r-- | extensions/shell/app/shell_main_delegate.cc (renamed from apps/shell/app/shell_main_delegate.cc) | 21 | ||||
-rw-r--r-- | extensions/shell/app/shell_main_delegate.h (renamed from apps/shell/app/shell_main_delegate.h) | 12 | ||||
-rw-r--r-- | extensions/shell/app_shell.gyp (renamed from apps/shell/app_shell.gyp) | 8 | ||||
-rw-r--r-- | extensions/shell/app_shell_resources.grd (renamed from apps/shell/app_shell_resources.grd) | 0 | ||||
-rw-r--r-- | extensions/shell/browser/DEPS (renamed from apps/shell/browser/DEPS) | 8 | ||||
-rw-r--r-- | extensions/shell/browser/api/shell/shell_api.cc (renamed from apps/shell/browser/api/shell/shell_api.cc) | 22 | ||||
-rw-r--r-- | extensions/shell/browser/api/shell/shell_api.h (renamed from apps/shell/browser/api/shell/shell_api.h) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/default_shell_app_window_controller.cc (renamed from apps/shell/browser/default_shell_app_window_controller.cc) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/default_shell_app_window_controller.h (renamed from apps/shell/browser/default_shell_app_window_controller.h) | 12 | ||||
-rw-r--r-- | extensions/shell/browser/default_shell_browser_main_delegate.cc (renamed from apps/shell/browser/default_shell_browser_main_delegate.cc) | 19 | ||||
-rw-r--r-- | extensions/shell/browser/default_shell_browser_main_delegate.h (renamed from apps/shell/browser/default_shell_browser_main_delegate.h) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/dns_apitest.cc (renamed from apps/shell/browser/dns_apitest.cc) | 48 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_sorting.cc (renamed from apps/shell/browser/shell_app_sorting.cc) | 14 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_sorting.h (renamed from apps/shell/browser/shell_app_sorting.h) | 22 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_window.cc (renamed from apps/shell/browser/shell_app_window.cc) | 22 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_window.h (renamed from apps/shell/browser/shell_app_window.h) | 26 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_window_controller.h (renamed from apps/shell/browser/shell_app_window_controller.h) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browser_context.cc (renamed from apps/shell/browser/shell_browser_context.cc) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browser_context.h (renamed from apps/shell/browser/shell_browser_context.h) | 12 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browser_main_delegate.h (renamed from apps/shell/browser/shell_browser_main_delegate.h) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browser_main_parts.cc (renamed from apps/shell/browser/shell_browser_main_parts.cc) | 46 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browser_main_parts.h (renamed from apps/shell/browser/shell_browser_main_parts.h) | 37 | ||||
-rw-r--r-- | extensions/shell/browser/shell_browsertest.cc (renamed from apps/shell/browser/shell_browsertest.cc) | 7 | ||||
-rw-r--r-- | extensions/shell/browser/shell_content_browser_client.cc (renamed from apps/shell/browser/shell_content_browser_client.cc) | 58 | ||||
-rw-r--r-- | extensions/shell/browser/shell_content_browser_client.h (renamed from apps/shell/browser/shell_content_browser_client.h) | 24 | ||||
-rw-r--r-- | extensions/shell/browser/shell_desktop_controller.cc (renamed from apps/shell/browser/shell_desktop_controller.cc) | 27 | ||||
-rw-r--r-- | extensions/shell/browser/shell_desktop_controller.h (renamed from apps/shell/browser/shell_desktop_controller.h) | 10 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_system.cc (renamed from apps/shell/browser/shell_extension_system.cc) | 21 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_system.h (renamed from apps/shell/browser/shell_extension_system.h) | 11 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_system_factory.cc (renamed from apps/shell/browser/shell_extension_system_factory.cc) | 7 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_system_factory.h (renamed from apps/shell/browser/shell_extension_system_factory.h) | 6 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_web_contents_observer.cc (renamed from apps/shell/browser/shell_extension_web_contents_observer.cc) | 8 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extension_web_contents_observer.h (renamed from apps/shell/browser/shell_extension_web_contents_observer.h) | 6 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extensions_browser_client.cc (renamed from apps/shell/browser/shell_extensions_browser_client.cc) | 38 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extensions_browser_client.h (renamed from apps/shell/browser/shell_extensions_browser_client.h) | 26 | ||||
-rw-r--r-- | extensions/shell/browser/shell_network_controller_chromeos.cc (renamed from apps/shell/browser/shell_network_controller_chromeos.cc) | 43 | ||||
-rw-r--r-- | extensions/shell/browser/shell_network_controller_chromeos.h (renamed from apps/shell/browser/shell_network_controller_chromeos.h) | 15 | ||||
-rw-r--r-- | extensions/shell/browser/shell_omaha_query_params_delegate.cc (renamed from apps/shell/browser/shell_omaha_query_params_delegate.cc) | 2 | ||||
-rw-r--r-- | extensions/shell/browser/shell_omaha_query_params_delegate.h (renamed from apps/shell/browser/shell_omaha_query_params_delegate.h) | 6 | ||||
-rw-r--r-- | extensions/shell/browser/shell_runtime_api_delegate.cc (renamed from apps/shell/browser/shell_runtime_api_delegate.cc) | 14 | ||||
-rw-r--r-- | extensions/shell/browser/shell_runtime_api_delegate.h (renamed from apps/shell/browser/shell_runtime_api_delegate.h) | 24 | ||||
-rw-r--r-- | extensions/shell/browser/shell_special_storage_policy.cc (renamed from apps/shell/browser/shell_special_storage_policy.cc) | 6 | ||||
-rw-r--r-- | extensions/shell/browser/shell_special_storage_policy.h (renamed from apps/shell/browser/shell_special_storage_policy.h) | 10 | ||||
-rw-r--r-- | extensions/shell/common/api/_api_features.json (renamed from apps/shell/common/api/_api_features.json) | 2 | ||||
-rw-r--r-- | extensions/shell/common/api/api.gyp (renamed from apps/shell/common/api/api.gyp) | 8 | ||||
-rw-r--r-- | extensions/shell/common/api/shell.idl (renamed from apps/shell/common/api/shell.idl) | 0 | ||||
-rw-r--r-- | extensions/shell/common/shell_content_client.cc (renamed from apps/shell/common/shell_content_client.cc) | 22 | ||||
-rw-r--r-- | extensions/shell/common/shell_content_client.h (renamed from apps/shell/common/shell_content_client.h) | 12 | ||||
-rw-r--r-- | extensions/shell/common/shell_extensions_client.cc (renamed from apps/shell/common/shell_extensions_client.cc) | 70 | ||||
-rw-r--r-- | extensions/shell/common/shell_extensions_client.h | 57 | ||||
-rw-r--r-- | extensions/shell/common/switches.cc (renamed from apps/shell/common/switches.cc) | 6 | ||||
-rw-r--r-- | extensions/shell/common/switches.h (renamed from apps/shell/common/switches.h) | 10 | ||||
-rw-r--r-- | extensions/shell/renderer/DEPS (renamed from apps/shell/renderer/DEPS) | 3 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_content_renderer_client.cc (renamed from apps/shell/renderer/shell_content_renderer_client.cc) | 41 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_content_renderer_client.h (renamed from apps/shell/renderer/shell_content_renderer_client.h) | 17 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_custom_bindings.cc (renamed from apps/shell/renderer/shell_custom_bindings.cc) | 10 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_custom_bindings.h (renamed from apps/shell/renderer/shell_custom_bindings.h) | 14 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_custom_bindings.js (renamed from apps/shell/renderer/shell_custom_bindings.js) | 0 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_dispatcher_delegate.cc (renamed from apps/shell/renderer/shell_dispatcher_delegate.cc) | 18 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_dispatcher_delegate.h (renamed from apps/shell/renderer/shell_dispatcher_delegate.h) | 22 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_extensions_renderer_client.cc (renamed from apps/shell/renderer/shell_extensions_renderer_client.cc) | 12 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_extensions_renderer_client.h (renamed from apps/shell/renderer/shell_extensions_renderer_client.h) | 15 | ||||
-rw-r--r-- | extensions/shell/renderer/shell_renderer_main_delegate.h (renamed from apps/shell/renderer/shell_renderer_main_delegate.h) | 10 | ||||
-rw-r--r-- | extensions/shell/test/DEPS | 4 | ||||
-rw-r--r-- | extensions/shell/test/shell_test.cc (renamed from apps/shell/test/shell_test.cc) | 23 | ||||
-rw-r--r-- | extensions/shell/test/shell_test.h (renamed from apps/shell/test/shell_test.h) | 14 | ||||
-rw-r--r-- | extensions/shell/test/shell_test_launcher_delegate.cc (renamed from apps/shell/test/shell_test_launcher_delegate.cc) | 8 | ||||
-rw-r--r-- | extensions/shell/test/shell_test_launcher_delegate.h (renamed from apps/shell/test/shell_test_launcher_delegate.h) | 10 | ||||
-rw-r--r-- | extensions/shell/test/shell_tests_main.cc (renamed from apps/shell/test/shell_tests_main.cc) | 4 | ||||
-rw-r--r-- | tools/gritsettings/resource_ids | 2 |
98 files changed, 672 insertions, 722 deletions
diff --git a/apps/shell/app/DEPS b/apps/shell/app/DEPS deleted file mode 100644 index 9470e55..0000000 --- a/apps/shell/app/DEPS +++ /dev/null @@ -1,12 +0,0 @@ -include_rules = [ - "+apps/shell", - "+chromeos", - - # Override apps/DEPS to be more selective about content includes. - "-content", - "+content/public/app", - "+content/public/browser", - "+content/public/common", - - "+sandbox", -] diff --git a/apps/shell/common/DEPS b/apps/shell/common/DEPS deleted file mode 100644 index 37ee10f..0000000 --- a/apps/shell/common/DEPS +++ /dev/null @@ -1,6 +0,0 @@ -include_rules = [ - # Override apps/DEPS to be more selective about content includes. - "-content", - "+content/public/common", - "+content/public/test", -] diff --git a/apps/shell/common/shell_extensions_client.h b/apps/shell/common/shell_extensions_client.h deleted file mode 100644 index 0ebb3ad..0000000 --- a/apps/shell/common/shell_extensions_client.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ -#define APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "extensions/common/extensions_client.h" -#include "extensions/common/permissions/extensions_api_permissions.h" - -namespace apps { - -// The app_shell implementation of ExtensionsClient. -class ShellExtensionsClient : public extensions::ExtensionsClient { - public: - ShellExtensionsClient(); - virtual ~ShellExtensionsClient(); - - // extensions::ExtensionsClient overrides: - virtual void Initialize() OVERRIDE; - virtual const extensions::PermissionMessageProvider& - GetPermissionMessageProvider() const OVERRIDE; - virtual scoped_ptr<extensions::FeatureProvider> CreateFeatureProvider( - const std::string& name) const OVERRIDE; - virtual scoped_ptr<extensions::JSONFeatureProviderSource> - CreateFeatureProviderSource(const std::string& name) const OVERRIDE; - virtual void FilterHostPermissions( - const extensions::URLPatternSet& hosts, - extensions::URLPatternSet* new_hosts, - std::set<extensions::PermissionMessage>* messages) const OVERRIDE; - virtual void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) - OVERRIDE; - virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE; - virtual extensions::URLPatternSet GetPermittedChromeSchemeHosts( - const extensions::Extension* extension, - 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; - virtual void RegisterAPISchemaResources( - extensions::ExtensionAPI* api) const OVERRIDE; - virtual bool ShouldSuppressFatalErrors() const OVERRIDE; - - private: - const extensions::ExtensionsAPIPermissions extensions_api_permissions_; - - ScriptingWhitelist scripting_whitelist_; - - DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient); -}; - -} // namespace apps - -#endif // APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ diff --git a/apps/shell/test/DEPS b/apps/shell/test/DEPS deleted file mode 100644 index fba827a..0000000 --- a/apps/shell/test/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - # Testing utilities can access anything in apps/shell. - "+apps/shell", -] diff --git a/athena/activity/public/activity_factory.h b/athena/activity/public/activity_factory.h index bc95893..cd79ca7 100644 --- a/athena/activity/public/activity_factory.h +++ b/athena/activity/public/activity_factory.h @@ -8,14 +8,14 @@ #include "athena/athena_export.h" #include "url/gurl.h" -namespace apps { -class ShellAppWindow; -} - namespace content { class BrowserContext; } +namespace extensions { +class ShellAppWindow; +} + namespace athena { class Activity; @@ -38,7 +38,8 @@ class ATHENA_EXPORT ActivityFactory { // Create an activity of an app with |app_window|. The returned activity // should own |app_window|. - virtual Activity* CreateAppActivity(apps::ShellAppWindow* app_window) = 0; + virtual Activity* CreateAppActivity( + extensions::ShellAppWindow* app_window) = 0; }; } // namespace athena diff --git a/athena/content/DEPS b/athena/content/DEPS index 7278520..5401a42 100644 --- a/athena/content/DEPS +++ b/athena/content/DEPS @@ -1,11 +1,11 @@ include_rules = [ - "+apps/shell/browser", "+athena/activity/public", "+athena/home/public", "+athena/input/public", "+content/public", "+extensions/browser", "+extensions/common", + "+extensions/shell/browser", "+ui/app_list", "+ui/gfx", "+ui/views", diff --git a/athena/content/app_activity.cc b/athena/content/app_activity.cc index 3a4cb69..c90daff 100644 --- a/athena/content/app_activity.cc +++ b/athena/content/app_activity.cc @@ -4,15 +4,15 @@ #include "athena/content/app_activity.h" -#include "apps/shell/browser/shell_app_window.h" #include "athena/activity/public/activity_manager.h" #include "content/public/browser/web_contents.h" +#include "extensions/shell/browser/shell_app_window.h" #include "ui/views/controls/webview/webview.h" namespace athena { // TODO(mukai): specifies the same accelerators of WebActivity. -AppActivity::AppActivity(apps::ShellAppWindow* app_window) +AppActivity::AppActivity(extensions::ShellAppWindow* app_window) : app_window_(app_window), web_view_(NULL), current_state_(ACTIVITY_UNLOADED) { diff --git a/athena/content/app_activity.h b/athena/content/app_activity.h index cfbe93d..4f6ef2b 100644 --- a/athena/content/app_activity.h +++ b/athena/content/app_activity.h @@ -10,7 +10,7 @@ #include "content/public/browser/web_contents_observer.h" #include "ui/gfx/image/image_skia.h" -namespace apps { +namespace extensions { class ShellAppWindow; } @@ -24,7 +24,7 @@ class AppActivity : public Activity, public ActivityViewModel, public content::WebContentsObserver { public: - explicit AppActivity(apps::ShellAppWindow* app_window); + explicit AppActivity(extensions::ShellAppWindow* app_window); virtual ~AppActivity(); protected: @@ -51,7 +51,7 @@ class AppActivity : public Activity, const std::vector<content::FaviconURL>& candidates) OVERRIDE; private: - scoped_ptr<apps::ShellAppWindow> app_window_; + scoped_ptr<extensions::ShellAppWindow> app_window_; views::WebView* web_view_; // The current state for this activity. diff --git a/athena/content/content_activity_factory.cc b/athena/content/content_activity_factory.cc index 3a08641..65747dc 100644 --- a/athena/content/content_activity_factory.cc +++ b/athena/content/content_activity_factory.cc @@ -22,7 +22,7 @@ Activity* ContentActivityFactory::CreateWebActivity( } Activity* ContentActivityFactory::CreateAppActivity( - apps::ShellAppWindow* app_window) { + extensions::ShellAppWindow* app_window) { return new AppActivity(app_window); } diff --git a/athena/content/content_app_model_builder.cc b/athena/content/content_app_model_builder.cc index c90304d..d8a3616 100644 --- a/athena/content/content_app_model_builder.cc +++ b/athena/content/content_app_model_builder.cc @@ -4,13 +4,13 @@ #include "athena/content/public/content_app_model_builder.h" -#include "apps/shell/browser/shell_extension_system.h" #include "athena/activity/public/activity_factory.h" #include "athena/activity/public/activity_manager.h" #include "extensions/browser/extension_icon_image.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/manifest_handlers/icons_handler.h" +#include "extensions/shell/browser/shell_extension_system.h" #include "ui/app_list/app_list_item.h" #include "ui/app_list/app_list_model.h" diff --git a/athena/content/public/content_activity_factory.h b/athena/content/public/content_activity_factory.h index 2698123..2d41441 100644 --- a/athena/content/public/content_activity_factory.h +++ b/athena/content/public/content_activity_factory.h @@ -20,7 +20,7 @@ class ATHENA_EXPORT ContentActivityFactory : public ActivityFactory { virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, const GURL& url) OVERRIDE; virtual Activity* CreateAppActivity( - apps::ShellAppWindow* app_window) OVERRIDE; + extensions::ShellAppWindow* app_window) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ContentActivityFactory); diff --git a/athena/main/DEPS b/athena/main/DEPS index 6e5a0d4..fca20e1 100644 --- a/athena/main/DEPS +++ b/athena/main/DEPS @@ -24,14 +24,14 @@ include_rules = [ specific_include_rules = { "athena_main\.cc": [ - "+apps/shell/app", - "+apps/shell/browser", - "+apps/shell/common", - "+apps/shell/renderer", "+content/public/app", + "+extensions/shell/app", + "+extensions/shell/browser", + "+extensions/shell/common", + "+extensions/shell/renderer", ], "athena_app_window_controller\.*": [ - "+apps/shell/browser", + "+extensions/shell/browser", ], "athena_shell\.cc": [ "+athena/test", diff --git a/athena/main/athena_app_window_controller.cc b/athena/main/athena_app_window_controller.cc index df44bc5..a1da206 100644 --- a/athena/main/athena_app_window_controller.cc +++ b/athena/main/athena_app_window_controller.cc @@ -4,11 +4,11 @@ #include "athena/main/athena_app_window_controller.h" -#include "apps/shell/browser/shell_app_window.h" #include "athena/activity/public/activity_factory.h" #include "athena/activity/public/activity_manager.h" #include "base/memory/scoped_ptr.h" #include "content/public/browser/web_contents_observer.h" +#include "extensions/shell/browser/shell_app_window.h" namespace athena { @@ -18,9 +18,9 @@ AthenaAppWindowController::AthenaAppWindowController() { AthenaAppWindowController::~AthenaAppWindowController() { } -apps::ShellAppWindow* AthenaAppWindowController::CreateAppWindow( +extensions::ShellAppWindow* AthenaAppWindowController::CreateAppWindow( content::BrowserContext* context) { - apps::ShellAppWindow* app_window = new apps::ShellAppWindow(); + extensions::ShellAppWindow* app_window = new extensions::ShellAppWindow(); app_window->Init(context, gfx::Size(100, 100)); ActivityManager::Get()->AddActivity(ActivityFactory::Get()->CreateAppActivity( app_window)); diff --git a/athena/main/athena_app_window_controller.h b/athena/main/athena_app_window_controller.h index 78684d5..ea2c172 100644 --- a/athena/main/athena_app_window_controller.h +++ b/athena/main/athena_app_window_controller.h @@ -5,20 +5,20 @@ #ifndef ATHENA_MAIN_ATHENA_APP_WINDOW_CONTROLLER_H_ #define ATHENA_MAIN_ATHENA_APP_WINDOW_CONTROLLER_H_ -#include "apps/shell/browser/shell_app_window_controller.h" #include "base/macros.h" +#include "extensions/shell/browser/shell_app_window_controller.h" namespace athena { // The shell app window controller for athena. It embeds the web_contents of // an app window into an Athena activity. -class AthenaAppWindowController : public apps::ShellAppWindowController { +class AthenaAppWindowController : public extensions::ShellAppWindowController { public: AthenaAppWindowController(); virtual ~AthenaAppWindowController(); - // Overridden from apps::ShellAppWindowController: - virtual apps::ShellAppWindow* CreateAppWindow( + // Overridden from extensions::ShellAppWindowController: + virtual extensions::ShellAppWindow* CreateAppWindow( content::BrowserContext* context) OVERRIDE; virtual void CloseAppWindows() OVERRIDE; diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc index 6286034..d50330e 100644 --- a/athena/main/athena_main.cc +++ b/athena/main/athena_main.cc @@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/app/shell_main_delegate.h" -#include "apps/shell/browser/shell_browser_main_delegate.h" -#include "apps/shell/browser/shell_content_browser_client.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "apps/shell/browser/shell_extension_system.h" -#include "apps/shell/common/switches.h" -#include "apps/shell/renderer/shell_renderer_main_delegate.h" #include "athena/content/public/content_activity_factory.h" #include "athena/content/public/content_app_model_builder.h" #include "athena/home/public/home_card.h" @@ -24,6 +17,13 @@ #include "base/file_util.h" #include "base/path_service.h" #include "content/public/app/content_main.h" +#include "extensions/shell/app/shell_main_delegate.h" +#include "extensions/shell/browser/shell_browser_main_delegate.h" +#include "extensions/shell/browser/shell_content_browser_client.h" +#include "extensions/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/browser/shell_extension_system.h" +#include "extensions/shell/common/switches.h" +#include "extensions/shell/renderer/shell_renderer_main_delegate.h" #include "ui/app_list/app_list_switches.h" #include "ui/aura/window_tree_host.h" #include "ui/base/resource/resource_bundle.h" @@ -60,13 +60,13 @@ class VirtualKeyboardObserver : public keyboard::KeyboardControllerObserver { DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver); }; -class AthenaDesktopController : public apps::ShellDesktopController { +class AthenaDesktopController : public extensions::ShellDesktopController { public: AthenaDesktopController() {} virtual ~AthenaDesktopController() {} private: - // apps::ShellDesktopController: + // extensions::ShellDesktopController: virtual wm::FocusRules* CreateFocusRules() OVERRIDE { return athena::ScreenManager::CreateFocusRules(); } @@ -74,12 +74,12 @@ class AthenaDesktopController : public apps::ShellDesktopController { DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); }; -class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { +class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { public: AthenaBrowserMainDelegate() {} virtual ~AthenaBrowserMainDelegate() {} - // apps::ShellBrowserMainDelegate: + // extensions::ShellBrowserMainDelegate: virtual void Start(content::BrowserContext* context) OVERRIDE { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -87,9 +87,10 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { command_line->AppendSwitch(app_list::switches::kEnableExperimentalAppList); base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( - command_line->HasSwitch(apps::switches::kAppShellAppPath) ? - command_line->GetSwitchValueNative(apps::switches::kAppShellAppPath) : - kDefaultAppPath); + command_line->HasSwitch(extensions::switches::kAppShellAppPath) + ? command_line->GetSwitchValueNative( + extensions::switches::kAppShellAppPath) + : kDefaultAppPath); base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); if (base::DirectoryExists(app_absolute_dir)) { @@ -100,7 +101,7 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { } athena::StartAthena( - apps::ShellDesktopController::instance()->host()->window(), + extensions::ShellDesktopController::instance()->host()->window(), new athena::ContentActivityFactory(), new athena::ContentAppModelBuilder(context)); athena::HomeCard::Get()->RegisterSearchProvider( @@ -117,10 +118,11 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { athena::ShutdownAthena(); } - virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { + virtual extensions::ShellDesktopController* CreateDesktopController() + OVERRIDE { // TODO(mukai): create Athena's own ShellDesktopController subclass so that // it can initialize its own window manager logic. - apps::ShellDesktopController* desktop = new AthenaDesktopController(); + extensions::ShellDesktopController* desktop = new AthenaDesktopController(); desktop->SetAppWindowController(new athena::AthenaAppWindowController()); return desktop; } @@ -131,10 +133,12 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); }; -class AthenaContentBrowserClient : public apps::ShellContentBrowserClient { +class AthenaContentBrowserClient + : public extensions::ShellContentBrowserClient { public: AthenaContentBrowserClient() - : apps::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) {} + : extensions::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) { + } virtual ~AthenaContentBrowserClient() {} // content::ContentBrowserClient: @@ -148,13 +152,14 @@ class AthenaContentBrowserClient : public apps::ShellContentBrowserClient { DISALLOW_COPY_AND_ASSIGN(AthenaContentBrowserClient); }; -class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate { +class AthenaRendererMainDelegate + : public extensions::ShellRendererMainDelegate { public: AthenaRendererMainDelegate() {} virtual ~AthenaRendererMainDelegate() {} private: - // apps::ShellRendererMainDelegate: + // extensions::ShellRendererMainDelegate: virtual void OnThreadStarted(content::RenderThread* thread) OVERRIDE {} virtual void OnViewCreated(content::RenderView* render_view) OVERRIDE { @@ -164,21 +169,21 @@ class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate { DISALLOW_COPY_AND_ASSIGN(AthenaRendererMainDelegate); }; -class AthenaMainDelegate : public apps::ShellMainDelegate { +class AthenaMainDelegate : public extensions::ShellMainDelegate { public: AthenaMainDelegate() {} virtual ~AthenaMainDelegate() {} private: - // apps::ShellMainDelegate: + // extensions::ShellMainDelegate: virtual content::ContentBrowserClient* CreateShellContentBrowserClient() OVERRIDE { return new AthenaContentBrowserClient(); } - virtual scoped_ptr<apps::ShellRendererMainDelegate> + virtual scoped_ptr<extensions::ShellRendererMainDelegate> CreateShellRendererMainDelegate() OVERRIDE { - return scoped_ptr<apps::ShellRendererMainDelegate>( + return scoped_ptr<extensions::ShellRendererMainDelegate>( new AthenaRendererMainDelegate()); } diff --git a/athena/main/athena_main.gyp b/athena/main/athena_main.gyp index e878a37..7366e5b 100644 --- a/athena/main/athena_main.gyp +++ b/athena/main/athena_main.gyp @@ -14,7 +14,6 @@ '../athena.gyp:athena_lib', '../athena.gyp:athena_content_lib', '../resources/athena_resources.gyp:athena_pak', - '../../apps/shell/app_shell.gyp:app_shell_lib', # debug_widow.cc depends on this. Remove this once debug_window # is removed. '../../ash/ash_resources.gyp:ash_resources', @@ -27,6 +26,7 @@ # TODO(mukai): declare those symbols for Athena. '../../components/components.gyp:infobars_test_support', '../../components/components.gyp:search_engines', + '../../extensions/shell/app_shell.gyp:app_shell_lib', '../../skia/skia.gyp:skia', '../../ui/accessibility/accessibility.gyp:ax_gen', '../../ui/app_list/app_list.gyp:app_list', diff --git a/athena/resources/athena_resources.gyp b/athena/resources/athena_resources.gyp index e3bc6aa..c836d59 100644 --- a/athena/resources/athena_resources.gyp +++ b/athena/resources/athena_resources.gyp @@ -11,9 +11,9 @@ 'target_name': 'athena_pak', 'type': 'none', 'dependencies': [ - '../../apps/shell/app_shell.gyp:app_shell_pak', '../../ash/ash_resources.gyp:ash_resources', '../../content/content_resources.gyp:content_resources', + '../../extensions/shell/app_shell.gyp:app_shell_pak', '../../webkit/webkit_resources.gyp:webkit_resources', '../../webkit/webkit_resources.gyp:webkit_strings', ], diff --git a/athena/test/sample_activity_factory.cc b/athena/test/sample_activity_factory.cc index cdd059d..429342a 100644 --- a/athena/test/sample_activity_factory.cc +++ b/athena/test/sample_activity_factory.cc @@ -35,7 +35,7 @@ Activity* SampleActivityFactory::CreateWebActivity( } Activity* SampleActivityFactory::CreateAppActivity( - apps::ShellAppWindow* app_window) { + extensions::ShellAppWindow* app_window) { // SampleActivityFactory can't own the |app_window|, so it must be NULL. DCHECK(app_window == NULL); return new SampleActivity( diff --git a/athena/test/sample_activity_factory.h b/athena/test/sample_activity_factory.h index 38b672a..df89a72 100644 --- a/athena/test/sample_activity_factory.h +++ b/athena/test/sample_activity_factory.h @@ -20,7 +20,7 @@ class SampleActivityFactory : public ActivityFactory { virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, const GURL& url) OVERRIDE; virtual Activity* CreateAppActivity( - apps::ShellAppWindow* app_window) OVERRIDE; + extensions::ShellAppWindow* app_window) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(SampleActivityFactory); diff --git a/build/all.gyp b/build/all.gyp index 04dedca..be5b164 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -235,7 +235,7 @@ }], ['chromeos==1 or (OS=="linux" and use_aura==1)', { 'dependencies': [ - '../apps/shell/app_shell.gyp:*', + '../extensions/shell/app_shell.gyp:*', ], }], ['chromeos==1', { diff --git a/extensions/DEPS b/extensions/DEPS index 4077a55..f544c73 100644 --- a/extensions/DEPS +++ b/extensions/DEPS @@ -1,6 +1,7 @@ include_rules = [ # Do not add Chrome dependencies. Much work went into removing them. "+components/url_matcher", + "-content", "+content/public/common", "+content/public/test", "+crypto", diff --git a/extensions/renderer/DEPS b/extensions/renderer/DEPS index 91bcd4b..ab21030 100644 --- a/extensions/renderer/DEPS +++ b/extensions/renderer/DEPS @@ -1,6 +1,4 @@ include_rules = [ - "-content", - "+content/public/common", "+content/public/renderer", "+gin", diff --git a/apps/shell/DEPS b/extensions/shell/DEPS index d1b37cd..ffa7287 100644 --- a/apps/shell/DEPS +++ b/extensions/shell/DEPS @@ -3,9 +3,9 @@ include_rules = [ "-apps", # Individual subdirectories should have their own DEPS that include # their allowed directories. - "-apps/shell", - "+apps/shell/common", - "+apps/shell/test", + "-extensions/shell", + "+extensions/shell/common", + "+extensions/shell/test", # Do not add dependencies on Chrome. Talk to OWNERS about how to refactor # the code you need to a shared location. @@ -16,7 +16,7 @@ include_rules = [ "+grit/app_shell_resources.h", "+grit/extensions_resources.h", - # Real DEPS go in subdirectories, for example apps/shell/browser/DEPS. + # Real DEPS go in subdirectories, for example extensions/shell/browser/DEPS. # Temporary exceptions for app_shell bring-up go here. # TODO(jamescook): Remove these. http://crbug.com/305404 "!chrome/browser/chrome_notification_types.h", diff --git a/apps/shell/OWNERS b/extensions/shell/OWNERS index 00a9ff9..00a9ff9 100644 --- a/apps/shell/OWNERS +++ b/extensions/shell/OWNERS diff --git a/apps/shell/README b/extensions/shell/README index 25a04d7..25a04d7 100644 --- a/apps/shell/README +++ b/extensions/shell/README diff --git a/extensions/shell/app/DEPS b/extensions/shell/app/DEPS new file mode 100644 index 0000000..b9b52a1 --- /dev/null +++ b/extensions/shell/app/DEPS @@ -0,0 +1,7 @@ +include_rules = [ + "+extensions/shell", + "+chromeos", + "+content/public/app", + "+content/public/browser", + "+sandbox", +] diff --git a/apps/shell/app/README b/extensions/shell/app/README index 9dbba28..9dbba28 100644 --- a/apps/shell/app/README +++ b/extensions/shell/app/README diff --git a/apps/shell/app/shell_main.cc b/extensions/shell/app/shell_main.cc index cd44b99..a58ab82 100644 --- a/apps/shell/app/shell_main.cc +++ b/extensions/shell/app/shell_main.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/app/shell_main_delegate.h" #include "content/public/app/content_main.h" +#include "extensions/shell/app/shell_main_delegate.h" #if defined(OS_WIN) #include "content/public/app/startup_helper_win.h" @@ -15,7 +15,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { #else int main(int argc, const char** argv) { #endif - apps::ShellMainDelegate delegate; + extensions::ShellMainDelegate delegate; content::ContentMainParams params(&delegate); #if defined(OS_WIN) diff --git a/apps/shell/app/shell_main_delegate.cc b/extensions/shell/app/shell_main_delegate.cc index 2e98a1d..b3b6ceb 100644 --- a/apps/shell/app/shell_main_delegate.cc +++ b/extensions/shell/app/shell_main_delegate.cc @@ -1,14 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/app/shell_main_delegate.h" +#include "extensions/shell/app/shell_main_delegate.h" -#include "apps/shell/browser/default_shell_browser_main_delegate.h" -#include "apps/shell/browser/shell_content_browser_client.h" -#include "apps/shell/common/shell_content_client.h" -#include "apps/shell/renderer/shell_content_renderer_client.h" -#include "apps/shell/renderer/shell_renderer_main_delegate.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h" @@ -16,6 +11,11 @@ #include "content/public/browser/browser_main_runner.h" #include "content/public/common/content_switches.h" #include "extensions/common/extension_paths.h" +#include "extensions/shell/browser/default_shell_browser_main_delegate.h" +#include "extensions/shell/browser/shell_content_browser_client.h" +#include "extensions/shell/common/shell_content_client.h" +#include "extensions/shell/renderer/shell_content_renderer_client.h" +#include "extensions/shell/renderer/shell_renderer_main_delegate.h" #include "ui/base/resource/resource_bundle.h" #if defined(OS_CHROMEOS) @@ -38,7 +38,7 @@ void InitLogging() { } // namespace -namespace apps { +namespace extensions { ShellMainDelegate::ShellMainDelegate() { } @@ -73,8 +73,7 @@ content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { content::ContentBrowserClient* ShellMainDelegate::CreateShellContentBrowserClient() { - return new apps::ShellContentBrowserClient( - new DefaultShellBrowserMainDelegate()); + return new ShellContentBrowserClient(new DefaultShellBrowserMainDelegate()); } content::ContentRendererClient* @@ -107,4 +106,4 @@ bool ShellMainDelegate::ProcessNeedsResourceBundle( process_type == switches::kUtilityProcess; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/app/shell_main_delegate.h b/extensions/shell/app/shell_main_delegate.h index 465f60e..7e120f4 100644 --- a/apps/shell/app/shell_main_delegate.h +++ b/extensions/shell/app/shell_main_delegate.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ -#define APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ +#define EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" @@ -16,7 +16,7 @@ class ContentClient; class ContentRendererClient; } -namespace apps { +namespace extensions { class ShellBrowserMainDelegate; class ShellRendererMainDelegate; @@ -55,6 +55,6 @@ class ShellMainDelegate : public content::ContentMainDelegate { DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ diff --git a/apps/shell/app_shell.gyp b/extensions/shell/app_shell.gyp index de0a74d..d95b385 100644 --- a/apps/shell/app_shell.gyp +++ b/extensions/shell/app_shell.gyp @@ -15,7 +15,7 @@ 'action_name': 'generate_app_shell_resources', 'variables': { 'grit_grd_file': 'app_shell_resources.grd', - 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/apps/shell', + 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/extensions/shell', }, 'includes': [ '../../build/grit_action.gypi' ], }, @@ -43,7 +43,6 @@ 'action_name': 'repack_app_shell_pack', 'variables': { 'pak_inputs': [ - '<(SHARED_INTERMEDIATE_DIR)/apps/shell/app_shell_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.pak', # TODO(jamescook): Extract the extension/app related resources @@ -53,6 +52,7 @@ '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_renderer_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/extensions/shell/app_shell_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_en-US.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak', @@ -71,7 +71,6 @@ 'defines!': ['CONTENT_IMPLEMENTATION'], 'dependencies': [ 'app_shell_pak', - '<(DEPTH)/apps/shell/common/api/api.gyp:shell_api', '<(DEPTH)/base/base.gyp:base', '<(DEPTH)/base/base.gyp:base_prefs_test_support', '<(DEPTH)/components/components.gyp:omaha_query_params', @@ -87,6 +86,7 @@ '<(DEPTH)/extensions/extensions.gyp:extensions_common', '<(DEPTH)/extensions/extensions.gyp:extensions_renderer', '<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources', + '<(DEPTH)/extensions/shell/common/api/api.gyp:shell_api', '<(DEPTH)/mojo/mojo.gyp:mojo_environment_chromium', '<(DEPTH)/mojo/mojo.gyp:mojo_system_impl', '<(DEPTH)/skia/skia.gyp:skia', @@ -97,7 +97,7 @@ 'include_dirs': [ '../..', '<(SHARED_INTERMEDIATE_DIR)', - '<(SHARED_INTERMEDIATE_DIR)/apps/shell', + '<(SHARED_INTERMEDIATE_DIR)/extensions/shell', ], 'sources': [ 'app/shell_main_delegate.cc', diff --git a/apps/shell/app_shell_resources.grd b/extensions/shell/app_shell_resources.grd index 236b488..236b488 100644 --- a/apps/shell/app_shell_resources.grd +++ b/extensions/shell/app_shell_resources.grd diff --git a/apps/shell/browser/DEPS b/extensions/shell/browser/DEPS index dc74d1d..edfa2580 100644 --- a/apps/shell/browser/DEPS +++ b/extensions/shell/browser/DEPS @@ -1,15 +1,11 @@ include_rules = [ "+chromeos", + "+components/keyed_service", "+components/omaha_query_params", "+components/pref_registry", "+components/user_prefs", - "+third_party/cros_system_api", - - # Override apps/DEPS to be more selective about content includes. - "-content", "+content/public/browser", - "+content/public/common", - "+content/public/test", + "+third_party/cros_system_api", # Pieces of content_shell reused in app_shell. "+content/shell/browser/shell_browser_context.h", diff --git a/apps/shell/browser/api/shell/shell_api.cc b/extensions/shell/browser/api/shell/shell_api.cc index 53a7bb6..c022f16 100644 --- a/apps/shell/browser/api/shell/shell_api.cc +++ b/extensions/shell/browser/api/shell/shell_api.cc @@ -2,26 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/api/shell/shell_api.h" +#include "extensions/shell/browser/api/shell/shell_api.h" -#include "apps/shell/browser/shell_app_window.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "apps/shell/common/api/shell.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" #include "extensions/common/extension.h" +#include "extensions/shell/browser/shell_app_window.h" +#include "extensions/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/common/api/shell.h" using base::DictionaryValue; -namespace CreateWindow = apps::shell_api::shell::CreateWindow; +namespace CreateWindow = extensions::shell_api::shell::CreateWindow; + +namespace extensions { -namespace apps { namespace { const char kInvalidArguments[] = "Invalid arguments"; // Creates a function call result to send to the renderer. -DictionaryValue* CreateResult(apps::ShellAppWindow* app_window) { +DictionaryValue* CreateResult(ShellAppWindow* app_window) { int view_id = app_window->GetRenderViewRoutingID(); DictionaryValue* result = new DictionaryValue; @@ -47,13 +48,12 @@ ExtensionFunction::ResponseAction ShellCreateWindowFunction::Run() { return RespondNow(Error(kInvalidArguments)); // The desktop keeps ownership of the window. - apps::ShellAppWindow* app_window = - apps::ShellDesktopController::instance()->CreateAppWindow( - browser_context()); + ShellAppWindow* app_window = + ShellDesktopController::instance()->CreateAppWindow(browser_context()); app_window->LoadURL(url); // Create the reply to send to the renderer. return RespondNow(OneArgument(CreateResult(app_window))); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/api/shell/shell_api.h b/extensions/shell/browser/api/shell/shell_api.h index 0012987..fab9380 100644 --- a/apps/shell/browser/api/shell/shell_api.h +++ b/extensions/shell/browser/api/shell/shell_api.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ -#define APPS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ +#define EXTENSIONS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ #include "base/compiler_specific.h" #include "base/macros.h" #include "extensions/browser/extension_function.h" #include "extensions/browser/extension_function_histogram_value.h" -namespace apps { +namespace extensions { // Implementation of the chrome.shell.createWindow() function for app_shell. // Opens a fullscreen window and invokes the window callback to allow access to @@ -28,6 +28,6 @@ class ShellCreateWindowFunction : public UIThreadExtensionFunction { DISALLOW_COPY_AND_ASSIGN(ShellCreateWindowFunction); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ +#endif // EXTENSIONS_SHELL_BROWSER_API_SHELL_SHELL_API_H_ diff --git a/apps/shell/browser/default_shell_app_window_controller.cc b/extensions/shell/browser/default_shell_app_window_controller.cc index 3ec5b6b..778bc09 100644 --- a/apps/shell/browser/default_shell_app_window_controller.cc +++ b/extensions/shell/browser/default_shell_app_window_controller.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/default_shell_app_window_controller.h" +#include "extensions/shell/browser/default_shell_app_window_controller.h" -#include "apps/shell/browser/shell_app_window.h" -#include "apps/shell/browser/shell_desktop_controller.h" #include "base/logging.h" +#include "extensions/shell/browser/shell_app_window.h" +#include "extensions/shell/browser/shell_desktop_controller.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" -namespace apps { +namespace extensions { DefaultShellAppWindowController::DefaultShellAppWindowController( ShellDesktopController* shell_desktop_controller) @@ -42,4 +42,4 @@ void DefaultShellAppWindowController::CloseAppWindows() { app_window_.reset(); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/default_shell_app_window_controller.h b/extensions/shell/browser/default_shell_app_window_controller.h index 36dccd8..558022c2c 100644 --- a/apps/shell/browser/default_shell_app_window_controller.h +++ b/extensions/shell/browser/default_shell_app_window_controller.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ -#define APPS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ +#define EXTENSIONS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ -#include "apps/shell/browser/shell_app_window_controller.h" +#include "extensions/shell/browser/shell_app_window_controller.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" -namespace apps { +namespace extensions { class ShellDesktopController; @@ -35,6 +35,6 @@ class DefaultShellAppWindowController : public ShellAppWindowController { DISALLOW_COPY_AND_ASSIGN(DefaultShellAppWindowController); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ +#endif // EXTENSIONS_SHELL_BROWSER_DEFAULT_SHELL_APP_WINDOW_CONTROLLER_H_ diff --git a/apps/shell/browser/default_shell_browser_main_delegate.cc b/extensions/shell/browser/default_shell_browser_main_delegate.cc index df2ff4d..5fb2cf1 100644 --- a/apps/shell/browser/default_shell_browser_main_delegate.cc +++ b/extensions/shell/browser/default_shell_browser_main_delegate.cc @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/default_shell_browser_main_delegate.h" +#include "extensions/shell/browser/default_shell_browser_main_delegate.h" -#include "apps/shell/browser/default_shell_app_window_controller.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "apps/shell/browser/shell_extension_system.h" -#include "apps/shell/common/switches.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/files/file_path.h" +#include "extensions/shell/browser/default_shell_app_window_controller.h" +#include "extensions/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/browser/shell_extension_system.h" +#include "extensions/shell/common/switches.h" -namespace apps { +namespace extensions { DefaultShellBrowserMainDelegate::DefaultShellBrowserMainDelegate() { } @@ -28,9 +28,8 @@ void DefaultShellBrowserMainDelegate::Start( command_line->GetSwitchValueNative(switches::kAppShellAppPath)); base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); - extensions::ShellExtensionSystem* extension_system = - static_cast<extensions::ShellExtensionSystem*>( - extensions::ExtensionSystem::Get(browser_context)); + ShellExtensionSystem* extension_system = static_cast<ShellExtensionSystem*>( + ExtensionSystem::Get(browser_context)); if (!extension_system->LoadApp(app_absolute_dir)) return; extension_system->LaunchApp(); @@ -50,4 +49,4 @@ DefaultShellBrowserMainDelegate::CreateDesktopController() { return desktop; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/default_shell_browser_main_delegate.h b/extensions/shell/browser/default_shell_browser_main_delegate.h index fc22c63..a59c2e4 100644 --- a/apps/shell/browser/default_shell_browser_main_delegate.h +++ b/extensions/shell/browser/default_shell_browser_main_delegate.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_DEFAULT_SHELL_BROWSER_MAIN_DELEGATE_H_ -#define APPS_SHELL_BROWSER_DEFAULT_SHELL_BROWSER_MAIN_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_DEFAULT_SHELL_BROWSER_MAIN_DELEGATE_H_ +#define EXTENSIONS_SHELL_BROWSER_DEFAULT_SHELL_BROWSER_MAIN_DELEGATE_H_ -#include "apps/shell/browser/shell_browser_main_delegate.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "extensions/shell/browser/shell_browser_main_delegate.h" -namespace apps { +namespace extensions { // A ShellBrowserMainDelegate that starts an application specified // by the "--app" command line. This is used only in the browser process. @@ -27,6 +27,6 @@ class DefaultShellBrowserMainDelegate : public ShellBrowserMainDelegate { DISALLOW_COPY_AND_ASSIGN(DefaultShellBrowserMainDelegate); }; -} // namespace apps +} // namespace extensions #endif // DEFAULT_SHELL_BROWSER_MAIN_DELEGATE_H_ diff --git a/apps/shell/browser/dns_apitest.cc b/extensions/shell/browser/dns_apitest.cc index 96736ea..fa2ec2f 100644 --- a/apps/shell/browser/dns_apitest.cc +++ b/extensions/shell/browser/dns_apitest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/test/shell_test.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -14,11 +13,13 @@ #include "extensions/browser/extension_function_dispatcher.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" +#include "extensions/shell/test/shell_test.h" #include "net/base/net_errors.h" -using extensions::ExtensionFunctionDispatcher; using extensions::api_test_utils::RunFunctionAndReturnSingleResult; +namespace extensions { + namespace { class TestFunctionDispatcherDelegate @@ -34,37 +35,35 @@ class TestFunctionDispatcherDelegate } // namespace -class DnsApiTest : public apps::AppShellTest { +class DnsApiTest : public AppShellTest { public: - DnsApiTest() : resolver_creator_(new extensions::MockHostResolverCreator()) {} + DnsApiTest() : resolver_creator_(new MockHostResolverCreator()) {} private: virtual void SetUpOnMainThread() OVERRIDE { - apps::AppShellTest::SetUpOnMainThread(); - extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting( + AppShellTest::SetUpOnMainThread(); + HostResolverWrapper::GetInstance()->SetHostResolverForTesting( resolver_creator_->CreateMockHostResolver()); } virtual void TearDownOnMainThread() OVERRIDE { - extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting( - NULL); + HostResolverWrapper::GetInstance()->SetHostResolverForTesting(NULL); resolver_creator_->DeleteMockHostResolver(); - apps::AppShellTest::TearDownOnMainThread(); + AppShellTest::TearDownOnMainThread(); } // The MockHostResolver asserts that it's used on the same thread on which // it's created, which is actually a stronger rule than its real counterpart. // But that's fine; it's good practice. - scoped_refptr<extensions::MockHostResolverCreator> resolver_creator_; + scoped_refptr<MockHostResolverCreator> resolver_creator_; }; IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveIPLiteral) { - scoped_refptr<extensions::DnsResolveFunction> resolve_function( - new extensions::DnsResolveFunction()); - scoped_refptr<extensions::Extension> empty_extension( - extensions::ExtensionBuilder() - .SetManifest(extensions::DictionaryBuilder().Set("name", "Test").Set( - "version", "1.0")) + scoped_refptr<DnsResolveFunction> resolve_function(new DnsResolveFunction()); + scoped_refptr<Extension> empty_extension( + ExtensionBuilder() + .SetManifest( + DictionaryBuilder().Set("name", "Test").Set("version", "1.0")) .Build()); resolve_function->set_extension(empty_extension.get()); @@ -92,12 +91,11 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveIPLiteral) { } IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) { - scoped_refptr<extensions::DnsResolveFunction> resolve_function( - new extensions::DnsResolveFunction()); - scoped_refptr<extensions::Extension> empty_extension( - extensions::ExtensionBuilder() - .SetManifest(extensions::DictionaryBuilder().Set("name", "Test").Set( - "version", "1.0")) + scoped_refptr<DnsResolveFunction> resolve_function(new DnsResolveFunction()); + scoped_refptr<Extension> empty_extension( + ExtensionBuilder() + .SetManifest( + DictionaryBuilder().Set("name", "Test").Set("version", "1.0")) .Build()); resolve_function->set_extension(empty_extension.get()); @@ -108,7 +106,7 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) { new ExtensionFunctionDispatcher(browser_context(), &delegate)); std::string function_arguments("[\""); - function_arguments += extensions::MockHostResolverCreator::kHostname; + function_arguments += MockHostResolverCreator::kHostname; function_arguments += "\"]"; scoped_ptr<base::Value> result( RunFunctionAndReturnSingleResult(resolve_function.get(), @@ -124,5 +122,7 @@ IN_PROC_BROWSER_TEST_F(DnsApiTest, DnsResolveHostname) { std::string address; EXPECT_TRUE(dict->GetString("address", &address)); - EXPECT_EQ(extensions::MockHostResolverCreator::kAddress, address); + EXPECT_EQ(MockHostResolverCreator::kAddress, address); } + +} // namespace extensions diff --git a/apps/shell/browser/shell_app_sorting.cc b/extensions/shell/browser/shell_app_sorting.cc index fa16063..146de59 100644 --- a/apps/shell/browser/shell_app_sorting.cc +++ b/extensions/shell/browser/shell_app_sorting.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_app_sorting.h" +#include "extensions/shell/browser/shell_app_sorting.h" #include "sync/api/string_ordinal.h" @@ -15,7 +15,7 @@ const char kFirstPage[] = "a"; } // namespace -namespace apps { +namespace extensions { ShellAppSorting::ShellAppSorting() { } @@ -23,16 +23,14 @@ ShellAppSorting::ShellAppSorting() { ShellAppSorting::~ShellAppSorting() { } -void ShellAppSorting::SetExtensionScopedPrefs( - extensions::ExtensionScopedPrefs* prefs) { +void ShellAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) { } void ShellAppSorting::SetExtensionSyncService( ExtensionSyncService* extension_sync_service) { } -void ShellAppSorting::Initialize( - const extensions::ExtensionIdList& extension_ids) { +void ShellAppSorting::Initialize(const ExtensionIdList& extension_ids) { } void ShellAppSorting::FixNTPOrdinalCollisions() { @@ -104,4 +102,4 @@ void ShellAppSorting::SetExtensionVisible(const std::string& extension_id, bool visible) { } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_app_sorting.h b/extensions/shell/browser/shell_app_sorting.h index a7f50d6..b0dac33 100644 --- a/apps/shell/browser/shell_app_sorting.h +++ b/extensions/shell/browser/shell_app_sorting.h @@ -1,29 +1,27 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_APP_SORTING_H_ -#define APPS_SHELL_BROWSER_SHELL_APP_SORTING_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_APP_SORTING_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_APP_SORTING_H_ #include "base/compiler_specific.h" #include "extensions/browser/app_sorting.h" -namespace apps { +namespace extensions { // A stub AppSorting. Since app_shell only runs a single app we don't need to // sort them. -class ShellAppSorting : public extensions::AppSorting { +class ShellAppSorting : public AppSorting { public: ShellAppSorting(); virtual ~ShellAppSorting(); - // extensions::AppSorting overrides: - virtual void SetExtensionScopedPrefs(extensions::ExtensionScopedPrefs* prefs) - OVERRIDE; + // AppSorting overrides: + virtual void SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) OVERRIDE; virtual void SetExtensionSyncService( ExtensionSyncService* extension_sync_service) OVERRIDE; - virtual void Initialize( - const extensions::ExtensionIdList& extension_ids) OVERRIDE; + virtual void Initialize(const ExtensionIdList& extension_ids) OVERRIDE; virtual void FixNTPOrdinalCollisions() OVERRIDE; virtual void EnsureValidOrdinals( const std::string& extension_id, @@ -60,6 +58,6 @@ class ShellAppSorting : public extensions::AppSorting { DISALLOW_COPY_AND_ASSIGN(ShellAppSorting); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_APP_SORTING_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_SORTING_H_ diff --git a/apps/shell/browser/shell_app_window.cc b/extensions/shell/browser/shell_app_window.cc index 8015ff5..a66554e 100644 --- a/apps/shell/browser/shell_app_window.cc +++ b/extensions/shell/browser/shell_app_window.cc @@ -2,28 +2,30 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_app_window.h" +#include "extensions/shell/browser/shell_app_window.h" -#include "apps/shell/browser/shell_extension_web_contents_observer.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/view_type_utils.h" #include "extensions/common/extension_messages.h" +#include "extensions/shell/browser/shell_extension_web_contents_observer.h" #include "ipc/ipc_message_macros.h" using content::BrowserContext; using content::WebContents; -namespace apps { +namespace extensions { -ShellAppWindow::ShellAppWindow() {} +ShellAppWindow::ShellAppWindow() { +} -ShellAppWindow::~ShellAppWindow() {} +ShellAppWindow::~ShellAppWindow() { +} void ShellAppWindow::Init(BrowserContext* context, gfx::Size initial_size) { extension_function_dispatcher_.reset( - new extensions::ExtensionFunctionDispatcher(context, this)); + new ExtensionFunctionDispatcher(context, this)); // Create the web contents with an initial size to avoid a resize. WebContents::CreateParams create_params(context); @@ -33,11 +35,9 @@ void ShellAppWindow::Init(BrowserContext* context, gfx::Size initial_size) { content::WebContentsObserver::Observe(web_contents_.get()); // Add support for extension startup. - extensions::ShellExtensionWebContentsObserver::CreateForWebContents( - web_contents_.get()); + ShellExtensionWebContentsObserver::CreateForWebContents(web_contents_.get()); - extensions::SetViewType(web_contents_.get(), - extensions::VIEW_TYPE_APP_WINDOW); + SetViewType(web_contents_.get(), VIEW_TYPE_APP_WINDOW); } void ShellAppWindow::LoadURL(const GURL& url) { @@ -72,4 +72,4 @@ void ShellAppWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { web_contents_->GetRenderViewHost()); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_app_window.h b/extensions/shell/browser/shell_app_window.h index 3df66ad..d85f4f0 100644 --- a/apps/shell/browser/shell_app_window.h +++ b/extensions/shell/browser/shell_app_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ -#define APPS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ #include "base/macros.h" #include "base/memory/scoped_ptr.h" @@ -22,21 +22,18 @@ class BrowserContext; class WebContents; } -namespace extensions { -class ExtensionFunctionDispatcher; -} - namespace gfx { class Size; } -namespace apps { +namespace extensions { + +class ExtensionFunctionDispatcher; // A simplified app window created by chrome.app.window.create(). Manages the // primary web contents for the app. -class ShellAppWindow - : public content::WebContentsObserver, - public extensions::ExtensionFunctionDispatcher::Delegate { +class ShellAppWindow : public content::WebContentsObserver, + public ExtensionFunctionDispatcher::Delegate { public: ShellAppWindow(); virtual ~ShellAppWindow(); @@ -57,7 +54,7 @@ class ShellAppWindow // content::WebContentsObserver implementation virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - // extensions::ExtensionFunctionDispatcher::Delegate implementation + // ExtensionFunctionDispatcher::Delegate implementation virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; private: @@ -65,12 +62,11 @@ class ShellAppWindow void OnRequest(const ExtensionHostMsg_Request_Params& params); scoped_ptr<content::WebContents> web_contents_; - scoped_ptr<extensions::ExtensionFunctionDispatcher> - extension_function_dispatcher_; + scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; DISALLOW_COPY_AND_ASSIGN(ShellAppWindow); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_H_ diff --git a/apps/shell/browser/shell_app_window_controller.h b/extensions/shell/browser/shell_app_window_controller.h index 13dd982..f8a7fa0 100644 --- a/apps/shell/browser/shell_app_window_controller.h +++ b/extensions/shell/browser/shell_app_window_controller.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ -#define APPS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ namespace content { class BrowserContext; } -namespace apps { +namespace extensions { class ShellAppWindow; @@ -25,6 +25,6 @@ class ShellAppWindowController { virtual void CloseAppWindows() = 0; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_WINDOW_CONTROLLER_H_ diff --git a/apps/shell/browser/shell_browser_context.cc b/extensions/shell/browser/shell_browser_context.cc index 71b6240..2f83782 100644 --- a/apps/shell/browser/shell_browser_context.cc +++ b/extensions/shell/browser/shell_browser_context.cc @@ -1,11 +1,11 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_browser_context.h" -#include "apps/shell/browser/shell_special_storage_policy.h" +#include "extensions/shell/browser/shell_browser_context.h" +#include "extensions/shell/browser/shell_special_storage_policy.h" -namespace apps { +namespace extensions { // Create a normal recording browser context. If we used an incognito context // then app_shell would also have to create a normal context and manage both. @@ -67,4 +67,4 @@ void ShellBrowserContext::ProfileFunctionCallOnNonProfileBrowserContext15() { NOTREACHED(); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_browser_context.h b/extensions/shell/browser/shell_browser_context.h index 58e3ed5..72f3fc5 100644 --- a/apps/shell/browser/shell_browser_context.h +++ b/extensions/shell/browser/shell_browser_context.h @@ -1,16 +1,16 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ -#define APPS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "content/shell/browser/shell_browser_context.h" #include "webkit/browser/quota/special_storage_policy.h" -namespace apps { +namespace extensions { class ShellSpecialStoragePolicy; @@ -48,6 +48,6 @@ class ShellBrowserContext : public content::ShellBrowserContext { DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ diff --git a/apps/shell/browser/shell_browser_main_delegate.h b/extensions/shell/browser/shell_browser_main_delegate.h index 8fc2934..3dbbbab 100644 --- a/apps/shell/browser/shell_browser_main_delegate.h +++ b/extensions/shell/browser/shell_browser_main_delegate.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ -#define APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ namespace content { class BrowserContext; } -namespace apps { +namespace extensions { class ShellDesktopController; @@ -31,6 +31,6 @@ class ShellBrowserMainDelegate { virtual ShellDesktopController* CreateDesktopController() = 0; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_DELEGATE_H_ diff --git a/apps/shell/browser/shell_browser_main_parts.cc b/extensions/shell/browser/shell_browser_main_parts.cc index bafbf8e..3a33566 100644 --- a/apps/shell/browser/shell_browser_main_parts.cc +++ b/extensions/shell/browser/shell_browser_main_parts.cc @@ -1,18 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_browser_main_parts.h" - -#include "apps/shell/browser/shell_browser_context.h" -#include "apps/shell/browser/shell_browser_main_delegate.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "apps/shell/browser/shell_extension_system.h" -#include "apps/shell/browser/shell_extension_system_factory.h" -#include "apps/shell/browser/shell_extensions_browser_client.h" -#include "apps/shell/browser/shell_omaha_query_params_delegate.h" -#include "apps/shell/common/shell_extensions_client.h" -#include "apps/shell/common/switches.h" +#include "extensions/shell/browser/shell_browser_main_parts.h" + #include "base/command_line.h" #include "base/run_loop.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -22,19 +13,25 @@ #include "content/shell/browser/shell_net_log.h" #include "extensions/browser/browser_context_keyed_service_factories.h" #include "extensions/browser/extension_system.h" +#include "extensions/shell/browser/shell_browser_context.h" +#include "extensions/shell/browser/shell_browser_main_delegate.h" +#include "extensions/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/browser/shell_extension_system.h" +#include "extensions/shell/browser/shell_extension_system_factory.h" +#include "extensions/shell/browser/shell_extensions_browser_client.h" +#include "extensions/shell/browser/shell_omaha_query_params_delegate.h" +#include "extensions/shell/common/shell_extensions_client.h" +#include "extensions/shell/common/switches.h" #include "ui/aura/window_tree_host.h" #include "ui/base/ime/input_method_initializer.h" #include "ui/base/resource/resource_bundle.h" #if defined(OS_CHROMEOS) -#include "apps/shell/browser/shell_network_controller_chromeos.h" #include "chromeos/dbus/dbus_thread_manager.h" +#include "extensions/shell/browser/shell_network_controller_chromeos.h" #endif using content::BrowserContext; -using extensions::Extension; -using extensions::ExtensionSystem; -using extensions::ShellExtensionSystem; namespace { @@ -47,7 +44,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() { } // namespace -namespace apps { +namespace extensions { ShellBrowserMainParts::ShellBrowserMainParts( const content::MainFunctionParams& parameters, @@ -99,14 +96,13 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { net_log_.reset(new content::ShellNetLog("app_shell")); extensions_client_.reset(new ShellExtensionsClient()); - extensions::ExtensionsClient::Set(extensions_client_.get()); + ExtensionsClient::Set(extensions_client_.get()); extensions_browser_client_.reset( - new extensions::ShellExtensionsBrowserClient(browser_context_.get())); - extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); + new ShellExtensionsBrowserClient(browser_context_.get())); + ExtensionsBrowserClient::Set(extensions_browser_client_.get()); - omaha_query_params_delegate_.reset( - new extensions::ShellOmahaQueryParamsDelegate); + omaha_query_params_delegate_.reset(new ShellOmahaQueryParamsDelegate); omaha_query_params::OmahaQueryParams::SetDelegate( omaha_query_params_delegate_.get()); @@ -131,7 +127,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { } } -bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { +bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { if (!run_message_loop_) return true; // TODO(yoz): just return false here? @@ -147,7 +143,7 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( browser_context_.get()); extension_system_ = NULL; - extensions::ExtensionsBrowserClient::Set(NULL); + ExtensionsBrowserClient::Set(NULL); extensions_browser_client_.reset(); browser_context_.reset(); @@ -168,4 +164,4 @@ void ShellBrowserMainParts::CreateExtensionSystem() { extension_system_->InitForRegularProfile(true); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_browser_main_parts.h b/extensions/shell/browser/shell_browser_main_parts.h index e9b8bf3..83915cb 100644 --- a/apps/shell/browser/shell_browser_main_parts.h +++ b/extensions/shell/browser/shell_browser_main_parts.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ -#define APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" @@ -17,12 +17,6 @@ class ShellDevToolsDelegate; struct MainFunctionParams; } -namespace extensions { -class ShellExtensionsBrowserClient; -class ShellExtensionSystem; -class ShellOmahaQueryParamsDelegate; -} - namespace views { class Widget; } @@ -31,12 +25,15 @@ namespace net { class NetLog; } -namespace apps { +namespace extensions { class ShellBrowserContext; class ShellBrowserMainDelegate; class ShellDesktopController; +class ShellExtensionsBrowserClient; class ShellExtensionsClient; +class ShellExtensionSystem; +class ShellOmahaQueryParamsDelegate; #if defined(OS_CHROMEOS) class ShellNetworkController; @@ -49,13 +46,9 @@ class ShellBrowserMainParts : public content::BrowserMainParts { ShellBrowserMainDelegate* browser_main_delegate); virtual ~ShellBrowserMainParts(); - ShellBrowserContext* browser_context() { - return browser_context_.get(); - } + ShellBrowserContext* browser_context() { return browser_context_.get(); } - extensions::ShellExtensionSystem* extension_system() { - return extension_system_; - } + ShellExtensionSystem* extension_system() { return extension_system_; } // BrowserMainParts overrides. virtual void PreEarlyInitialization() OVERRIDE; @@ -77,15 +70,13 @@ class ShellBrowserMainParts : public content::BrowserMainParts { scoped_ptr<ShellDesktopController> desktop_controller_; scoped_ptr<ShellBrowserContext> browser_context_; scoped_ptr<ShellExtensionsClient> extensions_client_; - scoped_ptr<extensions::ShellExtensionsBrowserClient> - extensions_browser_client_; + scoped_ptr<ShellExtensionsBrowserClient> extensions_browser_client_; scoped_ptr<net::NetLog> net_log_; scoped_ptr<content::ShellDevToolsDelegate> devtools_delegate_; - scoped_ptr<extensions::ShellOmahaQueryParamsDelegate> - omaha_query_params_delegate_; + scoped_ptr<ShellOmahaQueryParamsDelegate> omaha_query_params_delegate_; // Owned by the KeyedService system. - extensions::ShellExtensionSystem* extension_system_; + ShellExtensionSystem* extension_system_; // For running app browsertests. const content::MainFunctionParams parameters_; @@ -99,6 +90,6 @@ class ShellBrowserMainParts : public content::BrowserMainParts { DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ diff --git a/apps/shell/browser/shell_browsertest.cc b/extensions/shell/browser/shell_browsertest.cc index 108f40d..9520691 100644 --- a/apps/shell/browser/shell_browsertest.cc +++ b/extensions/shell/browser/shell_browsertest.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/test/shell_test.h" - #include "base/files/file_path.h" #include "base/logging.h" #include "base/path_service.h" @@ -11,8 +9,9 @@ #include "content/public/browser/notification_service.h" #include "content/public/test/test_utils.h" #include "extensions/common/extension_paths.h" +#include "extensions/shell/test/shell_test.h" -namespace apps { +namespace extensions { // Test that we can open an app window and wait for it to load. IN_PROC_BROWSER_TEST_F(AppShellTest, Basic) { @@ -29,4 +28,4 @@ IN_PROC_BROWSER_TEST_F(AppShellTest, Basic) { test_pass_observer.Wait(); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_content_browser_client.cc b/extensions/shell/browser/shell_content_browser_client.cc index 5dfc317..328fb878 100644 --- a/apps/shell/browser/shell_content_browser_client.cc +++ b/extensions/shell/browser/shell_content_browser_client.cc @@ -1,12 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_content_browser_client.h" +#include "extensions/shell/browser/shell_content_browser_client.h" -#include "apps/shell/browser/shell_browser_context.h" -#include "apps/shell/browser/shell_browser_main_parts.h" -#include "apps/shell/browser/shell_extension_system.h" #include "base/command_line.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -22,12 +19,14 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/switches.h" +#include "extensions/shell/browser/shell_browser_context.h" +#include "extensions/shell/browser/shell_browser_main_parts.h" +#include "extensions/shell/browser/shell_extension_system.h" #include "url/gurl.h" using content::BrowserThread; -using extensions::ExtensionRegistry; -namespace apps { +namespace extensions { namespace { ShellContentBrowserClient* g_instance = NULL; @@ -41,7 +40,9 @@ ShellContentBrowserClient::ShellContentBrowserClient( g_instance = this; } -ShellContentBrowserClient::~ShellContentBrowserClient() { g_instance = NULL; } +ShellContentBrowserClient::~ShellContentBrowserClient() { + g_instance = NULL; +} // static ShellContentBrowserClient* ShellContentBrowserClient::Get() { @@ -62,7 +63,7 @@ content::BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( void ShellContentBrowserClient::RenderProcessWillLaunch( content::RenderProcessHost* host) { int render_process_id = host->GetID(); - host->AddFilter(new extensions::ExtensionMessageFilter( + host->AddFilter(new ExtensionMessageFilter( render_process_id, browser_main_parts_->browser_context())); } @@ -83,12 +84,12 @@ net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext( // Handle only chrome-extension:// requests. app_shell does not support // chrome-extension-resource:// requests (it does not store shared extension // data in its installation directory). - extensions::InfoMap* extension_info_map = + InfoMap* extension_info_map = browser_main_parts_->extension_system()->info_map(); - (*protocol_handlers)[extensions::kExtensionScheme] = + (*protocol_handlers)[kExtensionScheme] = linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( - extensions::CreateExtensionProtocolHandler(false /* is_incognito */, - extension_info_map)); + CreateExtensionProtocolHandler(false /* is_incognito */, + extension_info_map)); // Let content::ShellBrowserContext handle the rest of the setup. return browser_main_parts_->browser_context()->CreateRequestContext( protocol_handlers, request_interceptors.Pass()); @@ -106,8 +107,8 @@ bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { url::kDataScheme, url::kFileScheme, url::kFileSystemScheme, - extensions::kExtensionScheme, - extensions::kExtensionResourceScheme, + kExtensionScheme, + kExtensionResourceScheme, }; for (size_t i = 0; i < arraysize(kProtocolList); ++i) { if (url.scheme() == kProtocolList[i]) @@ -119,11 +120,11 @@ bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { void ShellContentBrowserClient::SiteInstanceGotProcess( content::SiteInstance* site_instance) { // If this isn't an extension renderer there's nothing to do. - const extensions::Extension* extension = GetExtension(site_instance); + const Extension* extension = GetExtension(site_instance); if (!extension) return; - extensions::ProcessMap::Get(browser_main_parts_->browser_context()) + ProcessMap::Get(browser_main_parts_->browser_context()) ->Insert(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); @@ -131,7 +132,7 @@ void ShellContentBrowserClient::SiteInstanceGotProcess( BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&extensions::InfoMap::RegisterExtensionProcess, + base::Bind(&InfoMap::RegisterExtensionProcess, browser_main_parts_->extension_system()->info_map(), extension->id(), site_instance->GetProcess()->GetID(), @@ -141,11 +142,11 @@ void ShellContentBrowserClient::SiteInstanceGotProcess( void ShellContentBrowserClient::SiteInstanceDeleting( content::SiteInstance* site_instance) { // If this isn't an extension renderer there's nothing to do. - const extensions::Extension* extension = GetExtension(site_instance); + const Extension* extension = GetExtension(site_instance); if (!extension) return; - extensions::ProcessMap::Get(browser_main_parts_->browser_context()) + ProcessMap::Get(browser_main_parts_->browser_context()) ->Remove(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); @@ -153,7 +154,7 @@ void ShellContentBrowserClient::SiteInstanceDeleting( BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&extensions::InfoMap::UnregisterExtensionProcess, + base::Bind(&InfoMap::UnregisterExtensionProcess, browser_main_parts_->extension_system()->info_map(), extension->id(), site_instance->GetProcess()->GetID(), @@ -161,14 +162,15 @@ void ShellContentBrowserClient::SiteInstanceDeleting( } void ShellContentBrowserClient::AppendExtraCommandLineSwitches( - CommandLine* command_line, int child_process_id) { + CommandLine* command_line, + int child_process_id) { std::string process_type = - command_line->GetSwitchValueASCII(switches::kProcessType); - if (process_type == switches::kRendererProcess) { + command_line->GetSwitchValueASCII(::switches::kProcessType); + if (process_type == ::switches::kRendererProcess) { // TODO(jamescook): Should we check here if the process is in the extension // service process map, or can we assume all renderers are extension // renderers? - command_line->AppendSwitch(extensions::switches::kExtensionProcess); + command_line->AppendSwitch(switches::kExtensionProcess); } } @@ -176,10 +178,10 @@ void ShellContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_allowed_schemes) { ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes); - additional_allowed_schemes->push_back(extensions::kExtensionScheme); + additional_allowed_schemes->push_back(kExtensionScheme); } -const extensions::Extension* ShellContentBrowserClient::GetExtension( +const Extension* ShellContentBrowserClient::GetExtension( content::SiteInstance* site_instance) { ExtensionRegistry* registry = ExtensionRegistry::Get(site_instance->GetBrowserContext()); @@ -187,4 +189,4 @@ const extensions::Extension* ShellContentBrowserClient::GetExtension( site_instance->GetSiteURL()); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_content_browser_client.h b/extensions/shell/browser/shell_content_browser_client.h index 984dd6f..da884fd 100644 --- a/apps/shell/browser/shell_content_browser_client.h +++ b/extensions/shell/browser/shell_content_browser_client.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ -#define APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ #include "base/compiler_specific.h" #include "content/public/browser/content_browser_client.h" @@ -16,9 +16,6 @@ class BrowserContext; namespace extensions { class Extension; -} - -namespace apps { class ShellBrowserMainDelegate; class ShellBrowserMainParts; @@ -49,10 +46,10 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { // TODO(jamescook): Quota management? // TODO(jamescook): Speech recognition? virtual bool IsHandledURL(const GURL& url) OVERRIDE; - virtual void SiteInstanceGotProcess(content::SiteInstance* site_instance) - OVERRIDE; - virtual void SiteInstanceDeleting(content::SiteInstance* site_instance) - OVERRIDE; + virtual void SiteInstanceGotProcess( + content::SiteInstance* site_instance) OVERRIDE; + virtual void SiteInstanceDeleting( + content::SiteInstance* site_instance) OVERRIDE; virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) OVERRIDE; virtual void GetAdditionalAllowedSchemesForFileSystem( @@ -60,8 +57,7 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { private: // Returns the extension or app associated with |site_instance| or NULL. - const extensions::Extension* GetExtension( - content::SiteInstance* site_instance); + const Extension* GetExtension(content::SiteInstance* site_instance); // Owned by content::BrowserMainLoop. ShellBrowserMainParts* browser_main_parts_; @@ -72,6 +68,6 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ diff --git a/apps/shell/browser/shell_desktop_controller.cc b/extensions/shell/browser/shell_desktop_controller.cc index 88f114a..5cec7fe 100644 --- a/apps/shell/browser/shell_desktop_controller.cc +++ b/extensions/shell/browser/shell_desktop_controller.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/browser/shell_desktop_controller.h" -#include "apps/shell/browser/shell_app_window_controller.h" -#include "apps/shell/common/switches.h" #include "base/command_line.h" #include "content/public/browser/context_factory.h" +#include "extensions/shell/browser/shell_app_window_controller.h" +#include "extensions/shell/common/switches.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/default_capture_client.h" #include "ui/aura/env.h" @@ -36,7 +36,7 @@ #include "ui/display/types/chromeos/display_snapshot.h" #endif -namespace apps { +namespace extensions { namespace { // A simple layout manager that makes each new window fill its parent. @@ -78,21 +78,18 @@ class FillLayout : public aura::LayoutManager { class ShellNativeCursorManager : public wm::NativeCursorManager { public: explicit ShellNativeCursorManager(aura::WindowTreeHost* host) - : host_(host), - image_cursors_(new ui::ImageCursors) {} + : host_(host), image_cursors_(new ui::ImageCursors) {} virtual ~ShellNativeCursorManager() {} // wm::NativeCursorManager overrides. - virtual void SetDisplay( - const gfx::Display& display, - wm::NativeCursorManagerDelegate* delegate) OVERRIDE { + virtual void SetDisplay(const gfx::Display& display, + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { if (image_cursors_->SetDisplay(display, display.device_scale_factor())) SetCursor(delegate->GetCursor(), delegate); } - virtual void SetCursor( - gfx::NativeCursor cursor, - wm::NativeCursorManagerDelegate* delegate) OVERRIDE { + virtual void SetCursor(gfx::NativeCursor cursor, + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { image_cursors_->SetPlatformCursor(&cursor); cursor.set_device_scale_factor(image_cursors_->GetScale()); delegate->CommitCursor(cursor); @@ -133,9 +130,7 @@ class ShellNativeCursorManager : public wm::NativeCursorManager { private: // Sets |cursor| as the active cursor within Aura. - void ApplyCursor(gfx::NativeCursor cursor) { - host_->SetCursor(cursor); - } + void ApplyCursor(gfx::NativeCursor cursor) { host_->SetCursor(cursor); } aura::WindowTreeHost* host_; // Not owned. @@ -338,4 +333,4 @@ gfx::Size ShellDesktopController::GetPrimaryDisplaySize() { #endif } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_desktop_controller.h b/extensions/shell/browser/shell_desktop_controller.h index d0a5542..afaef8a 100644 --- a/apps/shell/browser/shell_desktop_controller.h +++ b/extensions/shell/browser/shell_desktop_controller.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ -#define APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" @@ -47,7 +47,7 @@ class InputMethodEventFilter; class UserActivityDetector; } -namespace apps { +namespace extensions { class ShellAppWindow; class ShellAppWindowController; @@ -144,6 +144,6 @@ class ShellDesktopController : public aura::client::WindowTreeClient, DISALLOW_COPY_AND_ASSIGN(ShellDesktopController); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_H_ diff --git a/apps/shell/browser/shell_extension_system.cc b/extensions/shell/browser/shell_extension_system.cc index bbc7278..db14d32 100644 --- a/apps/shell/browser/shell_extension_system.cc +++ b/extensions/shell/browser/shell_extension_system.cc @@ -1,12 +1,11 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_extension_system.h" +#include "extensions/shell/browser/shell_extension_system.h" #include <string> -#include "apps/shell/browser/api/shell/shell_api.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "chrome/browser/chrome_notification_types.h" @@ -25,6 +24,7 @@ #include "extensions/browser/quota_service.h" #include "extensions/browser/runtime_data.h" #include "extensions/common/file_util.h" +#include "extensions/shell/browser/api/shell/shell_api.h" using content::BrowserContext; using content::BrowserThread; @@ -49,7 +49,7 @@ bool ShellExtensionSystem::LoadApp(const base::FilePath& app_dir) { app_dir, Manifest::COMMAND_LINE, load_flags, &load_error); if (!extension_) { LOG(ERROR) << "Loading extension at " << app_dir.value() - << " failed with: " << load_error; + << " failed with: " << load_error; return false; } app_id_ = extension_->id(); @@ -164,11 +164,14 @@ QuotaService* ShellExtensionSystem::quota_service() { void ShellExtensionSystem::RegisterExtensionWithRequestContexts( const Extension* extension) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::Bind(&InfoMap::AddExtension, info_map(), - make_scoped_refptr(extension), base::Time::Now(), - false, false)); + BrowserThread::PostTask(BrowserThread::IO, + FROM_HERE, + base::Bind(&InfoMap::AddExtension, + info_map(), + make_scoped_refptr(extension), + base::Time::Now(), + false, + false)); } void ShellExtensionSystem::UnregisterExtensionWithRequestContexts( diff --git a/apps/shell/browser/shell_extension_system.h b/extensions/shell/browser/shell_extension_system.h index c451edd..b47c9a5 100644 --- a/apps/shell/browser/shell_extension_system.h +++ b/extensions/shell/browser/shell_extension_system.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ -#define APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ #include <vector> @@ -57,8 +57,7 @@ class ShellExtensionSystem : public ExtensionSystem { virtual StateStore* state_store() OVERRIDE; virtual StateStore* rules_store() OVERRIDE; virtual InfoMap* info_map() OVERRIDE; - virtual LazyBackgroundTaskQueue* lazy_background_task_queue() - OVERRIDE; + virtual LazyBackgroundTaskQueue* lazy_background_task_queue() OVERRIDE; virtual EventRouter* event_router() OVERRIDE; virtual ExtensionWarningService* warning_service() OVERRIDE; virtual Blacklist* blacklist() OVERRIDE; @@ -100,4 +99,4 @@ class ShellExtensionSystem : public ExtensionSystem { } // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_H_ diff --git a/apps/shell/browser/shell_extension_system_factory.cc b/extensions/shell/browser/shell_extension_system_factory.cc index 42a5b9e..73ad7d0 100644 --- a/apps/shell/browser/shell_extension_system_factory.cc +++ b/extensions/shell/browser/shell_extension_system_factory.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_extension_system_factory.h" +#include "extensions/shell/browser/shell_extension_system_factory.h" -#include "apps/shell/browser/shell_extension_system.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "extensions/browser/extension_prefs_factory.h" #include "extensions/browser/extension_registry_factory.h" +#include "extensions/shell/browser/shell_extension_system.h" using content::BrowserContext; @@ -31,7 +31,8 @@ ShellExtensionSystemFactory::ShellExtensionSystemFactory() DependsOn(ExtensionRegistryFactory::GetInstance()); } -ShellExtensionSystemFactory::~ShellExtensionSystemFactory() {} +ShellExtensionSystemFactory::~ShellExtensionSystemFactory() { +} KeyedService* ShellExtensionSystemFactory::BuildServiceInstanceFor( BrowserContext* context) const { diff --git a/apps/shell/browser/shell_extension_system_factory.h b/extensions/shell/browser/shell_extension_system_factory.h index b273a20..5d0a883 100644 --- a/apps/shell/browser/shell_extension_system_factory.h +++ b/extensions/shell/browser/shell_extension_system_factory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ -#define APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ #include "base/memory/singleton.h" #include "extensions/browser/extension_system_provider.h" @@ -37,4 +37,4 @@ class ShellExtensionSystemFactory : public ExtensionSystemProvider { } // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_SYSTEM_FACTORY_H_ diff --git a/apps/shell/browser/shell_extension_web_contents_observer.cc b/extensions/shell/browser/shell_extension_web_contents_observer.cc index 0c8c29e..9dc3691 100644 --- a/apps/shell/browser/shell_extension_web_contents_observer.cc +++ b/extensions/shell/browser/shell_extension_web_contents_observer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_extension_web_contents_observer.h" +#include "extensions/shell/browser/shell_extension_web_contents_observer.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY( extensions::ShellExtensionWebContentsObserver); @@ -11,8 +11,10 @@ namespace extensions { ShellExtensionWebContentsObserver::ShellExtensionWebContentsObserver( content::WebContents* web_contents) - : ExtensionWebContentsObserver(web_contents) {} + : ExtensionWebContentsObserver(web_contents) { +} -ShellExtensionWebContentsObserver::~ShellExtensionWebContentsObserver() {} +ShellExtensionWebContentsObserver::~ShellExtensionWebContentsObserver() { +} } // namespace extensions diff --git a/apps/shell/browser/shell_extension_web_contents_observer.h b/extensions/shell/browser/shell_extension_web_contents_observer.h index aa703eb..7cec042 100644 --- a/apps/shell/browser/shell_extension_web_contents_observer.h +++ b/extensions/shell/browser/shell_extension_web_contents_observer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ -#define APPS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ #include "content/public/browser/web_contents_user_data.h" #include "extensions/browser/extension_web_contents_observer.h" @@ -26,4 +26,4 @@ class ShellExtensionWebContentsObserver } // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSION_WEB_CONTENTS_OBSERVER_H_ diff --git a/apps/shell/browser/shell_extensions_browser_client.cc b/extensions/shell/browser/shell_extensions_browser_client.cc index 54b0df8..c725ebd 100644 --- a/apps/shell/browser/shell_extensions_browser_client.cc +++ b/extensions/shell/browser/shell_extensions_browser_client.cc @@ -1,14 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_extensions_browser_client.h" +#include "extensions/shell/browser/shell_extensions_browser_client.h" -#include "apps/shell/browser/shell_app_sorting.h" -#include "apps/shell/browser/shell_extension_system_factory.h" -#include "apps/shell/browser/shell_extension_web_contents_observer.h" -#include "apps/shell/browser/shell_runtime_api_delegate.h" -#include "apps/shell/common/api/generated_api.h" #include "base/prefs/pref_service.h" #include "base/prefs/pref_service_factory.h" #include "base/prefs/testing_pref_store.h" @@ -20,6 +15,11 @@ #include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extension_prefs.h" #include "extensions/common/api/generated_api.h" +#include "extensions/shell/browser/shell_app_sorting.h" +#include "extensions/shell/browser/shell_extension_system_factory.h" +#include "extensions/shell/browser/shell_extension_web_contents_observer.h" +#include "extensions/shell/browser/shell_runtime_api_delegate.h" +#include "extensions/shell/common/api/generated_api.h" using content::BrowserContext; @@ -38,11 +38,11 @@ class ShellExtensionHostDelegate : public ExtensionHostDelegate { virtual ~ShellExtensionHostDelegate() {} // ExtensionHostDelegate implementation. - virtual void OnExtensionHostCreated(content::WebContents* web_contents) - OVERRIDE; + virtual void OnExtensionHostCreated( + content::WebContents* web_contents) OVERRIDE; - virtual void OnRenderViewCreatedForBackgroundPage(ExtensionHost* host) - OVERRIDE {} + virtual void OnRenderViewCreatedForBackgroundPage( + ExtensionHost* host) OVERRIDE {} virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE { @@ -96,7 +96,8 @@ ShellExtensionsBrowserClient::ShellExtensionsBrowserClient( user_prefs::UserPrefs::Set(browser_context_, prefs_.get()); } -ShellExtensionsBrowserClient::~ShellExtensionsBrowserClient() {} +ShellExtensionsBrowserClient::~ShellExtensionsBrowserClient() { +} bool ShellExtensionsBrowserClient::IsShuttingDown() { return false; @@ -145,7 +146,7 @@ bool ShellExtensionsBrowserClient::IsExtensionIncognitoEnabled( } bool ShellExtensionsBrowserClient::CanExtensionCrossIncognito( - const extensions::Extension* extension, + const Extension* extension, content::BrowserContext* context) const { return false; } @@ -181,7 +182,8 @@ PrefService* ShellExtensionsBrowserClient::GetPrefServiceForContext( void ShellExtensionsBrowserClient::GetEarlyExtensionPrefsObservers( content::BrowserContext* context, - std::vector<ExtensionPrefsObserver*>* observers) const {} + std::vector<ExtensionPrefsObserver*>* observers) const { +} ProcessManagerDelegate* ShellExtensionsBrowserClient::GetProcessManagerDelegate() const { @@ -199,7 +201,7 @@ bool ShellExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) { } scoped_ptr<AppSorting> ShellExtensionsBrowserClient::CreateAppSorting() { - return scoped_ptr<AppSorting>(new apps::ShellAppSorting); + return scoped_ptr<AppSorting>(new ShellAppSorting); } bool ShellExtensionsBrowserClient::IsRunningInForcedAppMode() { @@ -220,16 +222,16 @@ ShellExtensionsBrowserClient::GetExtensionSystemFactory() { void ShellExtensionsBrowserClient::RegisterExtensionFunctions( ExtensionFunctionRegistry* registry) const { // Register core extension-system APIs. - extensions::core_api::GeneratedFunctionRegistry::RegisterAll(registry); + core_api::GeneratedFunctionRegistry::RegisterAll(registry); // Register chrome.shell APIs. - apps::shell_api::GeneratedFunctionRegistry::RegisterAll(registry); + shell_api::GeneratedFunctionRegistry::RegisterAll(registry); } scoped_ptr<RuntimeAPIDelegate> ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( content::BrowserContext* context) const { - return scoped_ptr<RuntimeAPIDelegate>(new apps::ShellRuntimeAPIDelegate()); + return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); } ComponentExtensionResourceManager* diff --git a/apps/shell/browser/shell_extensions_browser_client.h b/extensions/shell/browser/shell_extensions_browser_client.h index b6a20f7..648c7aa 100644 --- a/apps/shell/browser/shell_extensions_browser_client.h +++ b/extensions/shell/browser/shell_extensions_browser_client.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ -#define APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ #include "base/compiler_specific.h" #include "extensions/browser/extensions_browser_client.h" @@ -29,8 +29,8 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { virtual bool IsValidContext(content::BrowserContext* context) OVERRIDE; virtual bool IsSameContext(content::BrowserContext* first, content::BrowserContext* second) OVERRIDE; - virtual bool HasOffTheRecordContext(content::BrowserContext* context) - OVERRIDE; + virtual bool HasOffTheRecordContext( + content::BrowserContext* context) OVERRIDE; virtual content::BrowserContext* GetOffTheRecordContext( content::BrowserContext* context) OVERRIDE; virtual content::BrowserContext* GetOriginalContext( @@ -40,7 +40,7 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { const std::string& extension_id, content::BrowserContext* context) const OVERRIDE; virtual bool CanExtensionCrossIncognito( - const extensions::Extension* extension, + const Extension* extension, content::BrowserContext* context) const OVERRIDE; virtual bool IsWebViewRequest(net::URLRequest* request) const OVERRIDE; virtual net::URLRequestJob* MaybeCreateResourceBundleRequestJob( @@ -49,11 +49,11 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { const base::FilePath& directory_path, const std::string& content_security_policy, bool send_cors_header) OVERRIDE; - virtual bool AllowCrossRendererResourceLoad(net::URLRequest* request, - bool is_incognito, - const Extension* extension, - InfoMap* extension_info_map) - OVERRIDE; + virtual bool AllowCrossRendererResourceLoad( + net::URLRequest* request, + bool is_incognito, + const Extension* extension, + InfoMap* extension_info_map) OVERRIDE; virtual PrefService* GetPrefServiceForContext( content::BrowserContext* context) OVERRIDE; virtual void GetEarlyExtensionPrefsObservers( @@ -73,7 +73,7 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { virtual scoped_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate( content::BrowserContext* context) const OVERRIDE; virtual ComponentExtensionResourceManager* - GetComponentExtensionResourceManager() OVERRIDE; + GetComponentExtensionResourceManager() OVERRIDE; private: // The single BrowserContext for app_shell. Not owned. @@ -90,4 +90,4 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { } // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_EXTENSIONS_BROWSER_CLIENT_H_ diff --git a/apps/shell/browser/shell_network_controller_chromeos.cc b/extensions/shell/browser/shell_network_controller_chromeos.cc index 0b66604..d321e23 100644 --- a/apps/shell/browser/shell_network_controller_chromeos.cc +++ b/extensions/shell/browser/shell_network_controller_chromeos.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_network_controller_chromeos.h" +#include "extensions/shell/browser/shell_network_controller_chromeos.h" #include "base/bind.h" #include "base/location.h" @@ -16,7 +16,7 @@ #include "chromeos/network/network_state_handler.h" #include "third_party/cros_system_api/dbus/service_constants.h" -namespace apps { +namespace extensions { namespace { @@ -24,16 +24,16 @@ namespace { // or when connected to a non-preferred network. const int kScanIntervalSec = 10; -void HandleEnableWifiError( - const std::string& error_name, - scoped_ptr<base::DictionaryValue> error_data) { +void HandleEnableWifiError(const std::string& error_name, + scoped_ptr<base::DictionaryValue> error_data) { LOG(WARNING) << "Unable to enable wifi: " << error_name; } // Returns a human-readable name for the network described by |network|. std::string GetNetworkName(const chromeos::NetworkState& network) { - return !network.name().empty() ? network.name() : - base::StringPrintf("[%s]", network.type().c_str()); + return !network.name().empty() + ? network.name() + : base::StringPrintf("[%s]", network.type().c_str()); } // Returns true if shill is either connected or connecting to a network. @@ -60,7 +60,8 @@ ShellNetworkController::ShellNetworkController( state_handler->AddObserver(this, FROM_HERE); state_handler->SetTechnologyEnabled( chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi), - true, base::Bind(&HandleEnableWifiError)); + true, + base::Bind(&HandleEnableWifiError)); // If we're unconnected, trigger a connection attempt and start scanning. NetworkConnectionStateChanged(NULL); @@ -82,8 +83,7 @@ void ShellNetworkController::NetworkConnectionStateChanged( if (network) { VLOG(1) << "Network connection state changed:" << " name=" << GetNetworkName(*network) - << " type=" << network->type() - << " path=" << network->path() + << " type=" << network->type() << " path=" << network->path() << " state=" << network->connection_state(); } else { VLOG(1) << "Network connection state changed: [none]"; @@ -104,15 +104,15 @@ void ShellNetworkController::NetworkConnectionStateChanged( } } -const chromeos::NetworkState* -ShellNetworkController::GetActiveWiFiNetwork() { +const chromeos::NetworkState* ShellNetworkController::GetActiveWiFiNetwork() { chromeos::NetworkStateHandler* state_handler = chromeos::NetworkHandler::Get()->network_state_handler(); const chromeos::NetworkState* network = state_handler->FirstNetworkByType( chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi)); return network && - (network->IsConnectedState() || network->IsConnectingState()) ? - network : NULL; + (network->IsConnectedState() || network->IsConnectingState()) + ? network + : NULL; } void ShellNetworkController::SetScanningEnabled(bool enabled) { @@ -125,7 +125,8 @@ void ShellNetworkController::SetScanningEnabled(bool enabled) { RequestScan(); scan_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kScanIntervalSec), - this, &ShellNetworkController::RequestScan); + this, + &ShellNetworkController::RequestScan); } else { scan_timer_.Stop(); } @@ -151,7 +152,9 @@ void ShellNetworkController::ConnectIfUnconnected() { handler->network_state_handler()->GetVisibleNetworkListByType( chromeos::NetworkTypePattern::WiFi(), &network_list); for (chromeos::NetworkStateHandler::NetworkStateList::const_iterator it = - network_list.begin(); it != network_list.end(); ++it) { + network_list.begin(); + it != network_list.end(); + ++it) { const chromeos::NetworkState* network = *it; if (!network->connectable()) continue; @@ -180,9 +183,9 @@ void ShellNetworkController::ConnectIfUnconnected() { VLOG(1) << "Connecting to network " << GetNetworkName(*best_network) << " with path " << best_network->path() << " and strength " << best_network->signal_strength(); - state_ = can_connect_to_preferred_network ? - STATE_WAITING_FOR_PREFERRED_RESULT : - STATE_WAITING_FOR_NON_PREFERRED_RESULT; + state_ = can_connect_to_preferred_network + ? STATE_WAITING_FOR_PREFERRED_RESULT + : STATE_WAITING_FOR_NON_PREFERRED_RESULT; handler->network_connection_handler()->ConnectToNetwork( best_network->path(), base::Bind(&ShellNetworkController::HandleConnectionSuccess, @@ -204,4 +207,4 @@ void ShellNetworkController::HandleConnectionError( state_ = STATE_IDLE; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_network_controller_chromeos.h b/extensions/shell/browser/shell_network_controller_chromeos.h index 3e872da..5299aa0 100644 --- a/apps/shell/browser/shell_network_controller_chromeos.h +++ b/extensions/shell/browser/shell_network_controller_chromeos.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ -#define APPS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ #include <string> @@ -15,7 +15,7 @@ #include "base/values.h" #include "chromeos/network/network_state_handler_observer.h" -namespace apps { +namespace extensions { // Handles network-related tasks for app_shell on Chrome OS. class ShellNetworkController : public chromeos::NetworkStateHandlerObserver { @@ -59,9 +59,8 @@ class ShellNetworkController : public chromeos::NetworkStateHandlerObserver { // Handles a successful or failed connection attempt. void HandleConnectionSuccess(); - void HandleConnectionError( - const std::string& error_name, - scoped_ptr<base::DictionaryValue> error_data); + void HandleConnectionError(const std::string& error_name, + scoped_ptr<base::DictionaryValue> error_data); // Current status of communication with the chromeos::NetworkStateHandler. // This is tracked to avoid sending duplicate requests before the handler has @@ -82,6 +81,6 @@ class ShellNetworkController : public chromeos::NetworkStateHandlerObserver { DISALLOW_COPY_AND_ASSIGN(ShellNetworkController); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_NETWORK_CONTROLLER_CHROMEOS_H_ diff --git a/apps/shell/browser/shell_omaha_query_params_delegate.cc b/extensions/shell/browser/shell_omaha_query_params_delegate.cc index fa949d1..cd37c718 100644 --- a/apps/shell/browser/shell_omaha_query_params_delegate.cc +++ b/extensions/shell/browser/shell_omaha_query_params_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_omaha_query_params_delegate.h" +#include "extensions/shell/browser/shell_omaha_query_params_delegate.h" namespace extensions { diff --git a/apps/shell/browser/shell_omaha_query_params_delegate.h b/extensions/shell/browser/shell_omaha_query_params_delegate.h index fc30292..7ecb5ba 100644 --- a/apps/shell/browser/shell_omaha_query_params_delegate.h +++ b/extensions/shell/browser/shell_omaha_query_params_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ -#define APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ #include "components/omaha_query_params/omaha_query_params_delegate.h" @@ -23,4 +23,4 @@ class ShellOmahaQueryParamsDelegate } // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_ diff --git a/apps/shell/browser/shell_runtime_api_delegate.cc b/extensions/shell/browser/shell_runtime_api_delegate.cc index fc475ba..3c63da7 100644 --- a/apps/shell/browser/shell_runtime_api_delegate.cc +++ b/extensions/shell/browser/shell_runtime_api_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_runtime_api_delegate.h" +#include "extensions/shell/browser/shell_runtime_api_delegate.h" #include "extensions/common/api/runtime.h" @@ -13,7 +13,7 @@ using extensions::core_api::runtime::PlatformInfo; -namespace apps { +namespace extensions { ShellRuntimeAPIDelegate::ShellRuntimeAPIDelegate() { } @@ -21,16 +21,14 @@ ShellRuntimeAPIDelegate::ShellRuntimeAPIDelegate() { ShellRuntimeAPIDelegate::~ShellRuntimeAPIDelegate() { } -void ShellRuntimeAPIDelegate::AddUpdateObserver( - extensions::UpdateObserver* observer) { +void ShellRuntimeAPIDelegate::AddUpdateObserver(UpdateObserver* observer) { } -void ShellRuntimeAPIDelegate::RemoveUpdateObserver( - extensions::UpdateObserver* observer) { +void ShellRuntimeAPIDelegate::RemoveUpdateObserver(UpdateObserver* observer) { } base::Version ShellRuntimeAPIDelegate::GetPreviousExtensionVersion( - const extensions::Extension* extension) { + const Extension* extension) { return base::Version(); } @@ -65,4 +63,4 @@ bool ShellRuntimeAPIDelegate::RestartDevice(std::string* error_message) { return false; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_runtime_api_delegate.h b/extensions/shell/browser/shell_runtime_api_delegate.h index fcef1b7..1382ec5 100644 --- a/apps/shell/browser/shell_runtime_api_delegate.h +++ b/extensions/shell/browser/shell_runtime_api_delegate.h @@ -2,37 +2,35 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ -#define APPS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ #include "base/macros.h" #include "extensions/browser/api/runtime/runtime_api_delegate.h" -namespace apps { +namespace extensions { -class ShellRuntimeAPIDelegate : public extensions::RuntimeAPIDelegate { +class ShellRuntimeAPIDelegate : public RuntimeAPIDelegate { public: ShellRuntimeAPIDelegate(); virtual ~ShellRuntimeAPIDelegate(); - // extensions::RuntimeAPIDelegate implementation. - virtual void AddUpdateObserver(extensions::UpdateObserver* observer) OVERRIDE; - virtual void RemoveUpdateObserver( - extensions::UpdateObserver* observer) OVERRIDE; + // RuntimeAPIDelegate implementation. + virtual void AddUpdateObserver(UpdateObserver* observer) OVERRIDE; + virtual void RemoveUpdateObserver(UpdateObserver* observer) OVERRIDE; virtual base::Version GetPreviousExtensionVersion( - const extensions::Extension* extension) OVERRIDE; + const Extension* extension) OVERRIDE; virtual void ReloadExtension(const std::string& extension_id) OVERRIDE; virtual bool CheckForUpdates(const std::string& extension_id, const UpdateCheckCallback& callback) OVERRIDE; virtual void OpenURL(const GURL& uninstall_url) OVERRIDE; - virtual bool GetPlatformInfo( - extensions::core_api::runtime::PlatformInfo* info) OVERRIDE; + virtual bool GetPlatformInfo(core_api::runtime::PlatformInfo* info) OVERRIDE; virtual bool RestartDevice(std::string* error_message) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ShellRuntimeAPIDelegate); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_RUNTIME_API_DELEGATE_H_ diff --git a/apps/shell/browser/shell_special_storage_policy.cc b/extensions/shell/browser/shell_special_storage_policy.cc index f08f732..a5f4120 100644 --- a/apps/shell/browser/shell_special_storage_policy.cc +++ b/extensions/shell/browser/shell_special_storage_policy.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/browser/shell_special_storage_policy.h" +#include "extensions/shell/browser/shell_special_storage_policy.h" -namespace apps { +namespace extensions { ShellSpecialStoragePolicy::ShellSpecialStoragePolicy() { } @@ -40,4 +40,4 @@ bool ShellSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { return false; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/browser/shell_special_storage_policy.h b/extensions/shell/browser/shell_special_storage_policy.h index c23a228..d2725d5 100644 --- a/apps/shell/browser/shell_special_storage_policy.h +++ b/extensions/shell/browser/shell_special_storage_policy.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H_ -#define APPS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H_ +#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H_ +#define EXTENSIONS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H_ #include "webkit/browser/quota/special_storage_policy.h" -namespace apps { +namespace extensions { // A simple storage policy for app_shell which does not limit storage // capabilities and aims to be as permissive as possible. @@ -28,6 +28,6 @@ class ShellSpecialStoragePolicy : public quota::SpecialStoragePolicy { virtual ~ShellSpecialStoragePolicy(); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H +#endif // EXTENSIONS_SHELL_BROWSER_SHELL_SPECIAL_STORAGE_POLICY_H diff --git a/apps/shell/common/api/_api_features.json b/extensions/shell/common/api/_api_features.json index 9571ca8..bcb5f71 100644 --- a/apps/shell/common/api/_api_features.json +++ b/extensions/shell/common/api/_api_features.json @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This features file defines extension APIs implemented under src/apps/shell. +// This features file defines extension APIs implemented under src/extensions/shell. // See extensions/common/features/* to understand this file, in particular // feature.h, simple_feature.h, and base_feature_provider.h. // diff --git a/apps/shell/common/api/api.gyp b/extensions/shell/common/api/api.gyp index bbefdb8..2a4d126 100644 --- a/apps/shell/common/api/api.gyp +++ b/extensions/shell/common/api/api.gyp @@ -20,13 +20,13 @@ 'chromium_code': 1, 'non_compiled_schema_files': [ ], - # TODO: Eliminate these on Android. See crbug.com/305852. + # TODO(thestig): Eliminate these on Android. See crbug.com/305852. 'schema_files': [ 'shell.idl', ], - 'cc_dir': 'apps/shell/common/api', - 'root_namespace': 'apps::shell_api', - 'impl_dir': 'apps/shell/browser/api', + 'cc_dir': 'extensions/shell/common/api', + 'root_namespace': 'extensions::shell_api', + 'impl_dir': 'extensions/shell/browser/api', }, 'dependencies': [ '<(DEPTH)/skia/skia.gyp:skia', diff --git a/apps/shell/common/api/shell.idl b/extensions/shell/common/api/shell.idl index 0259535..0259535 100644 --- a/apps/shell/common/api/shell.idl +++ b/extensions/shell/common/api/shell.idl diff --git a/apps/shell/common/shell_content_client.cc b/extensions/shell/common/shell_content_client.cc index 37b6aed..5f0df03 100644 --- a/apps/shell/common/shell_content_client.cc +++ b/extensions/shell/common/shell_content_client.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // 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_content_client.h" +#include "extensions/shell/common/shell_content_client.h" #include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" @@ -11,19 +11,21 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -namespace apps { +namespace extensions { -ShellContentClient::ShellContentClient() {} +ShellContentClient::ShellContentClient() { +} -ShellContentClient::~ShellContentClient() {} +ShellContentClient::~ShellContentClient() { +} void ShellContentClient::AddAdditionalSchemes( std::vector<std::string>* standard_schemes, std::vector<std::string>* savable_schemes) { - standard_schemes->push_back(extensions::kExtensionScheme); - savable_schemes->push_back(extensions::kExtensionScheme); - standard_schemes->push_back(extensions::kExtensionResourceScheme); - savable_schemes->push_back(extensions::kExtensionResourceScheme); + standard_schemes->push_back(kExtensionScheme); + savable_schemes->push_back(kExtensionScheme); + standard_schemes->push_back(kExtensionResourceScheme); + savable_schemes->push_back(kExtensionResourceScheme); } std::string ShellContentClient::GetUserAgent() const { @@ -52,4 +54,4 @@ gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/common/shell_content_client.h b/extensions/shell/common/shell_content_client.h index 01a52a4..f0a722e 100644 --- a/apps/shell/common/shell_content_client.h +++ b/extensions/shell/common/shell_content_client.h @@ -1,14 +1,14 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ -#define APPS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ +#ifndef EXTENSIONS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ +#define EXTENSIONS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ #include "base/compiler_specific.h" #include "content/public/common/content_client.h" -namespace apps { +namespace extensions { class ShellContentClient : public content::ContentClient { public: @@ -28,6 +28,6 @@ class ShellContentClient : public content::ContentClient { virtual gfx::Image& GetNativeImageNamed(int resource_id) const OVERRIDE; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ +#endif // EXTENSIONS_SHELL_COMMON_SHELL_CONTENT_CLIENT_H_ diff --git a/apps/shell/common/shell_extensions_client.cc b/extensions/shell/common/shell_extensions_client.cc index cc2f055..0c5844f 100644 --- a/apps/shell/common/shell_extensions_client.cc +++ b/extensions/shell/common/shell_extensions_client.cc @@ -1,10 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // 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 diff --git a/extensions/shell/common/shell_extensions_client.h b/extensions/shell/common/shell_extensions_client.h new file mode 100644 index 0000000..81c5c60 --- /dev/null +++ b/extensions/shell/common/shell_extensions_client.h @@ -0,0 +1,57 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ +#define EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "extensions/common/extensions_client.h" +#include "extensions/common/permissions/extensions_api_permissions.h" + +namespace extensions { + +// The app_shell implementation of ExtensionsClient. +class ShellExtensionsClient : public ExtensionsClient { + public: + ShellExtensionsClient(); + virtual ~ShellExtensionsClient(); + + // ExtensionsClient overrides: + virtual void Initialize() OVERRIDE; + virtual const PermissionMessageProvider& GetPermissionMessageProvider() + const OVERRIDE; + virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( + const std::string& name) const OVERRIDE; + virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( + const std::string& name) const OVERRIDE; + virtual void FilterHostPermissions( + const URLPatternSet& hosts, + URLPatternSet* new_hosts, + std::set<PermissionMessage>* messages) const OVERRIDE; + virtual void SetScriptingWhitelist( + const ScriptingWhitelist& whitelist) OVERRIDE; + virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE; + virtual URLPatternSet GetPermittedChromeSchemeHosts( + const Extension* extension, + const 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; + virtual void RegisterAPISchemaResources(ExtensionAPI* api) const OVERRIDE; + virtual bool ShouldSuppressFatalErrors() const OVERRIDE; + + private: + const ExtensionsAPIPermissions extensions_api_permissions_; + + ScriptingWhitelist scripting_whitelist_; + + DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient); +}; + +} // namespace extensions + +#endif // EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ diff --git a/apps/shell/common/switches.cc b/extensions/shell/common/switches.cc index df4b8ed..0186422 100644 --- a/apps/shell/common/switches.cc +++ b/extensions/shell/common/switches.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/common/switches.h" +#include "extensions/shell/common/switches.h" -namespace apps { +namespace extensions { namespace switches { // Path to an app to load at startup. @@ -17,4 +17,4 @@ const char kAppShellHostWindowBounds[] = "app-shell-host-window-bounds"; const char kAppShellPreferredNetwork[] = "app-shell-preferred-network"; } // namespace switches -} // namespace apps +} // namespace extensions diff --git a/apps/shell/common/switches.h b/extensions/shell/common/switches.h index 0ecf906..6c4911d 100644 --- a/apps/shell/common/switches.h +++ b/extensions/shell/common/switches.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_COMMON_SWITCHES_H_ -#define APPS_SHELL_COMMON_SWITCHES_H_ +#ifndef EXTENSIONS_SHELL_COMMON_SWITCHES_H_ +#define EXTENSIONS_SHELL_COMMON_SWITCHES_H_ -namespace apps { +namespace extensions { namespace switches { // All switches in alphabetical order. The switches should be documented @@ -15,6 +15,6 @@ extern const char kAppShellHostWindowBounds[]; extern const char kAppShellPreferredNetwork[]; } // namespace switches -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_COMMON_SWITCHES_H_ +#endif // EXTENSIONS_SHELL_COMMON_SWITCHES_H_ diff --git a/apps/shell/renderer/DEPS b/extensions/shell/renderer/DEPS index cd0d5db..baafcac 100644 --- a/apps/shell/renderer/DEPS +++ b/extensions/shell/renderer/DEPS @@ -1,9 +1,6 @@ include_rules = [ # Only allow includes the renderer can use. - "-content", - "+content/public/common", "+content/public/renderer", - "+content/public/test", "+third_party/WebKit/public", "+v8/include", diff --git a/apps/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc index 70e0698..c7a9be6 100644 --- a/apps/shell/renderer/shell_content_renderer_client.cc +++ b/extensions/shell/renderer/shell_content_renderer_client.cc @@ -2,12 +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/renderer/shell_content_renderer_client.h" +#include "extensions/shell/renderer/shell_content_renderer_client.h" -#include "apps/shell/common/shell_extensions_client.h" -#include "apps/shell/renderer/shell_dispatcher_delegate.h" -#include "apps/shell/renderer/shell_extensions_renderer_client.h" -#include "apps/shell/renderer/shell_renderer_main_delegate.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer_tracker.h" @@ -15,12 +11,16 @@ #include "extensions/common/extensions_client.h" #include "extensions/renderer/dispatcher.h" #include "extensions/renderer/extension_helper.h" +#include "extensions/shell/common/shell_extensions_client.h" +#include "extensions/shell/renderer/shell_dispatcher_delegate.h" +#include "extensions/shell/renderer/shell_extensions_renderer_client.h" +#include "extensions/shell/renderer/shell_renderer_main_delegate.h" using blink::WebFrame; using blink::WebString; using content::RenderThread; -namespace apps { +namespace extensions { namespace { @@ -30,7 +30,7 @@ class ShellFrameHelper public content::RenderFrameObserverTracker<ShellFrameHelper> { public: ShellFrameHelper(content::RenderFrame* render_frame, - extensions::Dispatcher* extension_dispatcher); + Dispatcher* extension_dispatcher); virtual ~ShellFrameHelper(); // RenderFrameObserver implementation. @@ -38,18 +38,20 @@ class ShellFrameHelper int world_id) OVERRIDE; private: - extensions::Dispatcher* extension_dispatcher_; + Dispatcher* extension_dispatcher_; DISALLOW_COPY_AND_ASSIGN(ShellFrameHelper); }; ShellFrameHelper::ShellFrameHelper(content::RenderFrame* render_frame, - extensions::Dispatcher* extension_dispatcher) + Dispatcher* extension_dispatcher) : content::RenderFrameObserver(render_frame), content::RenderFrameObserverTracker<ShellFrameHelper>(render_frame), - extension_dispatcher_(extension_dispatcher) {} + extension_dispatcher_(extension_dispatcher) { +} -ShellFrameHelper::~ShellFrameHelper() {} +ShellFrameHelper::~ShellFrameHelper() { +} void ShellFrameHelper::WillReleaseScriptContext(v8::Handle<v8::Context> context, int world_id) { @@ -64,22 +66,23 @@ ShellContentRendererClient::ShellContentRendererClient( : delegate_(delegate.Pass()) { } -ShellContentRendererClient::~ShellContentRendererClient() {} +ShellContentRendererClient::~ShellContentRendererClient() { +} void ShellContentRendererClient::RenderThreadStarted() { RenderThread* thread = RenderThread::Get(); extensions_client_.reset(new ShellExtensionsClient); - extensions::ExtensionsClient::Set(extensions_client_.get()); + ExtensionsClient::Set(extensions_client_.get()); extensions_renderer_client_.reset(new ShellExtensionsRendererClient); - extensions::ExtensionsRendererClient::Set(extensions_renderer_client_.get()); + ExtensionsRendererClient::Set(extensions_renderer_client_.get()); extension_dispatcher_delegate_.reset(new ShellDispatcherDelegate()); // Must be initialized after ExtensionsRendererClient. extension_dispatcher_.reset( - new extensions::Dispatcher(extension_dispatcher_delegate_.get())); + new Dispatcher(extension_dispatcher_delegate_.get())); thread->AddObserver(extension_dispatcher_.get()); // TODO(jamescook): Init WebSecurityPolicy for chrome-extension: schemes. @@ -96,7 +99,7 @@ void ShellContentRendererClient::RenderFrameCreated( void ShellContentRendererClient::RenderViewCreated( content::RenderView* render_view) { - new extensions::ExtensionHelper(render_view, extension_dispatcher_.get()); + new ExtensionHelper(render_view, extension_dispatcher_.get()); if (delegate_) delegate_->OnViewCreated(render_view); } @@ -112,7 +115,9 @@ bool ShellContentRendererClient::WillSendRequest( } void ShellContentRendererClient::DidCreateScriptContext( - WebFrame* frame, v8::Handle<v8::Context> context, int extension_group, + WebFrame* frame, + v8::Handle<v8::Context> context, + int extension_group, int world_id) { extension_dispatcher_->DidCreateScriptContext( frame, context, extension_group, world_id); @@ -123,4 +128,4 @@ bool ShellContentRendererClient::ShouldEnableSiteIsolationPolicy() const { return false; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/renderer/shell_content_renderer_client.h b/extensions/shell/renderer/shell_content_renderer_client.h index 9f7aee2..e7a1fbc 100644 --- a/apps/shell/renderer/shell_content_renderer_client.h +++ b/extensions/shell/renderer/shell_content_renderer_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ -#define APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ +#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ +#define EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ #include "base/compiler_specific.h" #include "base/macros.h" @@ -11,12 +11,9 @@ #include "content/public/renderer/content_renderer_client.h" namespace extensions { + class Dispatcher; class DispatcherDelegate; -} - -namespace apps { - class ShellExtensionsClient; class ShellExtensionsRendererClient; class ShellRendererMainDelegate; @@ -47,12 +44,12 @@ class ShellContentRendererClient : public content::ContentRendererClient { scoped_ptr<ShellRendererMainDelegate> delegate_; scoped_ptr<ShellExtensionsClient> extensions_client_; scoped_ptr<ShellExtensionsRendererClient> extensions_renderer_client_; - scoped_ptr<extensions::DispatcherDelegate> extension_dispatcher_delegate_; - scoped_ptr<extensions::Dispatcher> extension_dispatcher_; + scoped_ptr<DispatcherDelegate> extension_dispatcher_delegate_; + scoped_ptr<Dispatcher> extension_dispatcher_; DISALLOW_COPY_AND_ASSIGN(ShellContentRendererClient); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ +#endif // EXTENSIONS_SHELL_RENDERER_SHELL_CONTENT_RENDERER_CLIENT_H_ diff --git a/apps/shell/renderer/shell_custom_bindings.cc b/extensions/shell/renderer/shell_custom_bindings.cc index c4101b6..40965ca 100644 --- a/apps/shell/renderer/shell_custom_bindings.cc +++ b/extensions/shell/renderer/shell_custom_bindings.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/renderer/shell_custom_bindings.h" +#include "extensions/shell/renderer/shell_custom_bindings.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" @@ -14,10 +14,10 @@ #include "third_party/WebKit/public/web/WebView.h" #include "v8/include/v8.h" -namespace apps { +namespace extensions { -ShellCustomBindings::ShellCustomBindings(extensions::ScriptContext* context) - : extensions::ObjectBackedNativeHandler(context) { +ShellCustomBindings::ShellCustomBindings(ScriptContext* context) + : ObjectBackedNativeHandler(context) { RouteFunction( "GetView", base::Bind(&ShellCustomBindings::GetView, base::Unretained(this))); @@ -54,4 +54,4 @@ void ShellCustomBindings::GetView( args.GetReturnValue().Set(window); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/renderer/shell_custom_bindings.h b/extensions/shell/renderer/shell_custom_bindings.h index 743903d..aaa4abe 100644 --- a/apps/shell/renderer/shell_custom_bindings.h +++ b/extensions/shell/renderer/shell_custom_bindings.h @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ -#define APPS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ +#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ +#define EXTENSIONS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ #include "extensions/renderer/object_backed_native_handler.h" -namespace apps { +namespace extensions { // Implements custom bindings for the chrome.shell API. -class ShellCustomBindings : public extensions::ObjectBackedNativeHandler { +class ShellCustomBindings : public ObjectBackedNativeHandler { public: - ShellCustomBindings(extensions::ScriptContext* context); + ShellCustomBindings(ScriptContext* context); private: void GetView(const v8::FunctionCallbackInfo<v8::Value>& args); @@ -20,6 +20,6 @@ class ShellCustomBindings : public extensions::ObjectBackedNativeHandler { DISALLOW_COPY_AND_ASSIGN(ShellCustomBindings); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ +#endif // EXTENSIONS_SHELL_RENDERER_SHELL_CUSTOM_BINDINGS_H_ diff --git a/apps/shell/renderer/shell_custom_bindings.js b/extensions/shell/renderer/shell_custom_bindings.js index 5fe9a9ae..5fe9a9ae 100644 --- a/apps/shell/renderer/shell_custom_bindings.js +++ b/extensions/shell/renderer/shell_custom_bindings.js diff --git a/apps/shell/renderer/shell_dispatcher_delegate.cc b/extensions/shell/renderer/shell_dispatcher_delegate.cc index 7959a5c..0f6b04b 100644 --- a/apps/shell/renderer/shell_dispatcher_delegate.cc +++ b/extensions/shell/renderer/shell_dispatcher_delegate.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/renderer/shell_dispatcher_delegate.h" +#include "extensions/shell/renderer/shell_dispatcher_delegate.h" -#include "apps/shell/renderer/shell_custom_bindings.h" #include "extensions/renderer/module_system.h" #include "extensions/renderer/resource_bundle_source_map.h" #include "extensions/renderer/script_context.h" +#include "extensions/shell/renderer/shell_custom_bindings.h" #include "grit/app_shell_resources.h" -namespace apps { +namespace extensions { ShellDispatcherDelegate::ShellDispatcherDelegate() { } @@ -19,17 +19,17 @@ ShellDispatcherDelegate::~ShellDispatcherDelegate() { } void ShellDispatcherDelegate::RegisterNativeHandlers( - extensions::Dispatcher* dispatcher, - extensions::ModuleSystem* module_system, - extensions::ScriptContext* context) { + Dispatcher* dispatcher, + ModuleSystem* module_system, + ScriptContext* context) { module_system->RegisterNativeHandler( "shell_natives", - scoped_ptr<extensions::NativeHandler>(new ShellCustomBindings(context))); + scoped_ptr<NativeHandler>(new ShellCustomBindings(context))); } void ShellDispatcherDelegate::PopulateSourceMap( - extensions::ResourceBundleSourceMap* source_map) { + ResourceBundleSourceMap* source_map) { source_map->RegisterSource("shell", IDR_SHELL_CUSTOM_BINDINGS_JS); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/renderer/shell_dispatcher_delegate.h b/extensions/shell/renderer/shell_dispatcher_delegate.h index 0bbb8f3..5009ce7 100644 --- a/apps/shell/renderer/shell_dispatcher_delegate.h +++ b/extensions/shell/renderer/shell_dispatcher_delegate.h @@ -2,34 +2,32 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ -#define APPS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ +#define EXTENSIONS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ #include "base/macros.h" #include "extensions/renderer/default_dispatcher_delegate.h" -namespace apps { +namespace extensions { // app_shell's implementation of DispatcherDelegate. This inherits the behavior // of the default delegate while augmenting its own script resources and native // native handlers. -class ShellDispatcherDelegate : public extensions::DefaultDispatcherDelegate { +class ShellDispatcherDelegate : public DefaultDispatcherDelegate { public: ShellDispatcherDelegate(); virtual ~ShellDispatcherDelegate(); // DispatcherDelegate implementation. - virtual void RegisterNativeHandlers( - extensions::Dispatcher* dispatcher, - extensions::ModuleSystem* module_system, - extensions::ScriptContext* context) OVERRIDE; - virtual void PopulateSourceMap( - extensions::ResourceBundleSourceMap* source_map) OVERRIDE; + virtual void RegisterNativeHandlers(Dispatcher* dispatcher, + ModuleSystem* module_system, + ScriptContext* context) OVERRIDE; + virtual void PopulateSourceMap(ResourceBundleSourceMap* source_map) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ShellDispatcherDelegate); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_RENDERER_SHELL_DISPATCHER_DELEGATE_H_ diff --git a/apps/shell/renderer/shell_extensions_renderer_client.cc b/extensions/shell/renderer/shell_extensions_renderer_client.cc index c5de265..c3be350 100644 --- a/apps/shell/renderer/shell_extensions_renderer_client.cc +++ b/extensions/shell/renderer/shell_extensions_renderer_client.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/renderer/shell_extensions_renderer_client.h" +#include "extensions/shell/renderer/shell_extensions_renderer_client.h" -namespace apps { +namespace extensions { -ShellExtensionsRendererClient::ShellExtensionsRendererClient() {} +ShellExtensionsRendererClient::ShellExtensionsRendererClient() { +} -ShellExtensionsRendererClient::~ShellExtensionsRendererClient() {} +ShellExtensionsRendererClient::~ShellExtensionsRendererClient() { +} bool ShellExtensionsRendererClient::IsIncognitoProcess() const { // app_shell doesn't support off-the-record contexts. @@ -22,4 +24,4 @@ int ShellExtensionsRendererClient::GetLowestIsolatedWorldId() const { return 1; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/renderer/shell_extensions_renderer_client.h b/extensions/shell/renderer/shell_extensions_renderer_client.h index 7b32f90..1bbe3f4 100644 --- a/apps/shell/renderer/shell_extensions_renderer_client.h +++ b/extensions/shell/renderer/shell_extensions_renderer_client.h @@ -2,21 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ -#define APPS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ +#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ +#define EXTENSIONS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ #include "base/macros.h" #include "extensions/renderer/extensions_renderer_client.h" -namespace apps { +namespace extensions { -class ShellExtensionsRendererClient - : public extensions::ExtensionsRendererClient { +class ShellExtensionsRendererClient : public ExtensionsRendererClient { public: ShellExtensionsRendererClient(); virtual ~ShellExtensionsRendererClient(); - // extensions::ExtensionsRendererClient implementation. + // ExtensionsRendererClient implementation. virtual bool IsIncognitoProcess() const OVERRIDE; virtual int GetLowestIsolatedWorldId() const OVERRIDE; @@ -24,6 +23,6 @@ class ShellExtensionsRendererClient DISALLOW_COPY_AND_ASSIGN(ShellExtensionsRendererClient); }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ +#endif // EXTENSIONS_SHELL_RENDERER_SHELL_EXTENSIONS_RENDERER_CLIENT_H_ diff --git a/apps/shell/renderer/shell_renderer_main_delegate.h b/extensions/shell/renderer/shell_renderer_main_delegate.h index 604b6c7..51396bd 100644 --- a/apps/shell/renderer/shell_renderer_main_delegate.h +++ b/extensions/shell/renderer/shell_renderer_main_delegate.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ -#define APPS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ +#define EXTENSIONS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ namespace content { class RenderThread; class RenderView; } -namespace apps { +namespace extensions { class ShellRendererMainDelegate { public: @@ -25,6 +25,6 @@ class ShellRendererMainDelegate { virtual void OnViewCreated(content::RenderView* view) = 0; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_RENDERER_SHELL_RENDERER_MAIN_DELEGATE_H_ diff --git a/extensions/shell/test/DEPS b/extensions/shell/test/DEPS new file mode 100644 index 0000000..c243ad4 --- /dev/null +++ b/extensions/shell/test/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + # Testing utilities can access anything in extensions/shell. + "+extensions/shell", +] diff --git a/apps/shell/test/shell_test.cc b/extensions/shell/test/shell_test.cc index c5ca5df..e67400d 100644 --- a/apps/shell/test/shell_test.cc +++ b/extensions/shell/test/shell_test.cc @@ -2,23 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/test/shell_test.h" +#include "extensions/shell/test/shell_test.h" -#include "apps/shell/browser/shell_content_browser_client.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "apps/shell/browser/shell_extension_system.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h" #include "content/public/common/content_switches.h" #include "extensions/browser/extension_system.h" +#include "extensions/shell/browser/shell_content_browser_client.h" +#include "extensions/shell/browser/shell_desktop_controller.h" +#include "extensions/shell/browser/shell_extension_system.h" -namespace apps { +namespace extensions { -AppShellTest::AppShellTest() - : browser_context_(NULL), extension_system_(NULL) {} +AppShellTest::AppShellTest() : browser_context_(NULL), extension_system_(NULL) { +} -AppShellTest::~AppShellTest() {} +AppShellTest::~AppShellTest() { +} void AppShellTest::SetUp() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -29,8 +30,8 @@ void AppShellTest::SetUp() { void AppShellTest::SetUpOnMainThread() { browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); - extension_system_ = static_cast<extensions::ShellExtensionSystem*>( - extensions::ExtensionSystem::Get(browser_context_)); + extension_system_ = static_cast<ShellExtensionSystem*>( + ExtensionSystem::Get(browser_context_)); } void AppShellTest::RunTestOnMainThreadLoop() { @@ -53,4 +54,4 @@ bool AppShellTest::LoadAndLaunchApp(const base::FilePath& app_dir) { return loaded; } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/test/shell_test.h b/extensions/shell/test/shell_test.h index f6aa148..c9d36ed 100644 --- a/apps/shell/test/shell_test.h +++ b/extensions/shell/test/shell_test.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_TEST_SHELL_TEST_H_ -#define APPS_SHELL_TEST_SHELL_TEST_H_ +#ifndef EXTENSIONS_SHELL_TEST_SHELL_TEST_H_ +#define EXTENSIONS_SHELL_TEST_SHELL_TEST_H_ #include "base/memory/scoped_ptr.h" #include "content/public/test/browser_test.h" @@ -18,10 +18,8 @@ class BrowserContext; } namespace extensions { -class ShellExtensionSystem; -} -namespace apps { +class ShellExtensionSystem; // Base class for app shell browser tests. class AppShellTest : public content::BrowserTestBase { @@ -42,9 +40,9 @@ class AppShellTest : public content::BrowserTestBase { private: content::BrowserContext* browser_context_; - extensions::ShellExtensionSystem* extension_system_; + ShellExtensionSystem* extension_system_; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_TEST_SHELL_TEST_H_ +#endif // EXTENSIONS_SHELL_TEST_SHELL_TEST_H_ diff --git a/apps/shell/test/shell_test_launcher_delegate.cc b/extensions/shell/test/shell_test_launcher_delegate.cc index 7522a81..ce7bc59 100644 --- a/apps/shell/test/shell_test_launcher_delegate.cc +++ b/extensions/shell/test/shell_test_launcher_delegate.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/shell/test/shell_test_launcher_delegate.h" +#include "extensions/shell/test/shell_test_launcher_delegate.h" -#include "apps/shell/app/shell_main_delegate.h" #include "base/test/test_suite.h" +#include "extensions/shell/app/shell_main_delegate.h" -namespace apps { +namespace extensions { int AppShellTestLauncherDelegate::RunTestSuite(int argc, char** argv) { return base::TestSuite(argc, argv).Run(); @@ -24,4 +24,4 @@ AppShellTestLauncherDelegate::CreateContentMainDelegate() { return new ShellMainDelegate(); } -} // namespace apps +} // namespace extensions diff --git a/apps/shell/test/shell_test_launcher_delegate.h b/extensions/shell/test/shell_test_launcher_delegate.h index e7977b3..8e62f5d 100644 --- a/apps/shell/test/shell_test_launcher_delegate.h +++ b/extensions/shell/test/shell_test_launcher_delegate.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef APPS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ -#define APPS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ +#ifndef EXTENSIONS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ +#define EXTENSIONS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ #include "content/public/test/test_launcher.h" -namespace apps { +namespace extensions { class AppShellTestLauncherDelegate : public content::TestLauncherDelegate { public: @@ -18,6 +18,6 @@ class AppShellTestLauncherDelegate : public content::TestLauncherDelegate { virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE; }; -} // namespace apps +} // namespace extensions -#endif // APPS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ +#endif // EXTENSIONS_SHELL_TEST_SHELL_TEST_LAUNCHER_DELEGATE_H_ diff --git a/apps/shell/test/shell_tests_main.cc b/extensions/shell/test/shell_tests_main.cc index 0233f10..eb16469 100644 --- a/apps/shell/test/shell_tests_main.cc +++ b/extensions/shell/test/shell_tests_main.cc @@ -4,12 +4,12 @@ #include <algorithm> -#include "apps/shell/test/shell_test_launcher_delegate.h" #include "base/sys_info.h" +#include "extensions/shell/test/shell_test_launcher_delegate.h" #include "testing/gtest/include/gtest/gtest.h" int main(int argc, char** argv) { int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); - apps::AppShellTestLauncherDelegate launcher_delegate; + extensions::AppShellTestLauncherDelegate launcher_delegate; return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); } diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids index 77a9b2b..83e5dbf 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids @@ -177,7 +177,7 @@ "extensions/extensions_strings.grd": { "messages": [27000], }, - "apps/shell/app_shell_resources.grd": { + "extensions/shell/app_shell_resources.grd": { "includes": [27400], }, "chrome/browser/resources/memory_internals_resources.grd": { |