diff options
author | hashimoto <hashimoto@chromium.org> | 2014-09-03 00:37:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-03 07:38:49 +0000 |
commit | 5c34ceb43fe742c953e76f73052e9119705a71a6 (patch) | |
tree | a0d828e7356a9bb99a3bd402ef3bcccf4d487103 | |
parent | 3485d1a05e0cc3ad01d363cdfea6786d2368080b (diff) | |
download | chromium_src-5c34ceb43fe742c953e76f73052e9119705a71a6.zip chromium_src-5c34ceb43fe742c953e76f73052e9119705a71a6.tar.gz chromium_src-5c34ceb43fe742c953e76f73052e9119705a71a6.tar.bz2 |
Move AppWindowContentsImpl to extensions
Remove unneeded include from app_window_contents.cc
Move app_window_contents.{cc,h} to extensions/browser/app_window
Change the namespace from apps to extensions.
BUG=403726
TBR=derat@chromium.org for include&namespace fix
Review URL: https://codereview.chromium.org/527693002
Cr-Commit-Position: refs/heads/master@{#293094}
-rw-r--r-- | apps/BUILD.gn | 2 | ||||
-rw-r--r-- | apps/apps.gypi | 2 | ||||
-rw-r--r-- | chrome/browser/apps/app_browsertest_util.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/api/app_window/app_window_api.cc | 5 | ||||
-rw-r--r-- | chrome/browser/power/process_power_collector_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc | 4 | ||||
-rw-r--r-- | extensions/browser/BUILD.gn | 2 | ||||
-rw-r--r-- | extensions/browser/app_window/app_window_contents.cc (renamed from apps/app_window_contents.cc) | 20 | ||||
-rw-r--r-- | extensions/browser/app_window/app_window_contents.h (renamed from apps/app_window_contents.h) | 37 | ||||
-rw-r--r-- | extensions/extensions.gyp | 2 |
10 files changed, 33 insertions, 48 deletions
diff --git a/apps/BUILD.gn b/apps/BUILD.gn index acbfe889..6b519ab 100644 --- a/apps/BUILD.gn +++ b/apps/BUILD.gn @@ -19,8 +19,6 @@ static_library("apps") { "app_restore_service.h", "app_restore_service_factory.cc", "app_restore_service_factory.h", - "app_window_contents.cc", - "app_window_contents.h", "browser_context_keyed_service_factories.cc", "browser_context_keyed_service_factories.h", "custom_launcher_page_contents.cc", diff --git a/apps/apps.gypi b/apps/apps.gypi index ddf0c99..2268184 100644 --- a/apps/apps.gypi +++ b/apps/apps.gypi @@ -38,8 +38,6 @@ 'app_restore_service.h', 'app_restore_service_factory.cc', 'app_restore_service_factory.h', - 'app_window_contents.cc', - 'app_window_contents.h', 'browser_context_keyed_service_factories.cc', 'browser_context_keyed_service_factories.h', 'custom_launcher_page_contents.cc', diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc index 2c61ffe..01e8e514 100644 --- a/chrome/browser/apps/app_browsertest_util.cc +++ b/chrome/browser/apps/app_browsertest_util.cc @@ -4,7 +4,6 @@ #include "chrome/browser/apps/app_browsertest_util.h" -#include "apps/app_window_contents.h" #include "base/command_line.h" #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/api/tabs/tabs_api.h" @@ -16,6 +15,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_utils.h" +#include "extensions/browser/app_window/app_window_contents.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/native_app_window.h" #include "extensions/common/switches.h" @@ -201,8 +201,7 @@ AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams( const AppWindow::CreateParams& params) { AppWindow* window = new AppWindow(browser()->profile(), new ChromeAppDelegate(), extension); - window->Init( - GURL(std::string()), new apps::AppWindowContentsImpl(window), params); + window->Init(GURL(std::string()), new AppWindowContentsImpl(window), params); return window; } diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc index 767f2f0..9b591a7 100644 --- a/chrome/browser/extensions/api/app_window/app_window_api.cc +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc @@ -4,7 +4,6 @@ #include "chrome/browser/extensions/api/app_window/app_window_api.h" -#include "apps/app_window_contents.h" #include "base/command_line.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -18,6 +17,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" #include "extensions/browser/app_window/app_window.h" +#include "extensions/browser/app_window/app_window_contents.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/apps_client.h" #include "extensions/browser/app_window/native_app_window.h" @@ -280,8 +280,7 @@ bool AppWindowCreateFunction::RunAsync() { AppWindow* app_window = AppsClient::Get()->CreateAppWindow(browser_context(), extension()); - app_window->Init( - url, new apps::AppWindowContentsImpl(app_window), create_params); + app_window->Init(url, new AppWindowContentsImpl(app_window), create_params); if (ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode()) app_window->ForcedFullscreen(); diff --git a/chrome/browser/power/process_power_collector_unittest.cc b/chrome/browser/power/process_power_collector_unittest.cc index a112410..f9ab5f1 100644 --- a/chrome/browser/power/process_power_collector_unittest.cc +++ b/chrome/browser/power/process_power_collector_unittest.cc @@ -4,7 +4,6 @@ #include "chrome/browser/power/process_power_collector.h" -#include "apps/app_window_contents.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/apps/chrome_app_delegate.h" #include "chrome/browser/ui/browser_commands.h" @@ -17,6 +16,7 @@ #include "content/public/browser/site_instance.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/mock_render_process_host.h" +#include "extensions/browser/app_window/app_window_contents.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/apps_client.h" #include "extensions/browser/app_window/native_app_window.h" diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 7c6fd53..126c055 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc @@ -47,7 +47,6 @@ #include "ui/base/models/menu_model.h" #if defined(OS_CHROMEOS) -#include "apps/app_window_contents.h" #include "ash/test/test_session_state_delegate.h" #include "ash/test/test_shell_delegate.h" #include "chrome/browser/chromeos/login/users/fake_user_manager.h" @@ -64,6 +63,7 @@ #include "chrome/test/base/testing_profile_manager.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/test/test_utils.h" +#include "extensions/browser/app_window/app_window_contents.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/native_app_window.h" #include "ui/aura/window.h" @@ -747,7 +747,7 @@ class V2App { extensions::AppWindow::CreateParams params = extensions::AppWindow::CreateParams(); window_->Init(GURL(std::string()), - new apps::AppWindowContentsImpl(window_), params); + new extensions::AppWindowContentsImpl(window_), params); } virtual ~V2App() { diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 0b045ad..c1c856c 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn @@ -166,6 +166,8 @@ source_set("browser") { "app_window/app_web_contents_helper.h", "app_window/app_window.cc", "app_window/app_window.h", + "app_window/app_window_contents.cc", + "app_window/app_window_contents.h", "app_window/app_window_geometry_cache.cc", "app_window/app_window_geometry_cache.h", "app_window/app_window_registry.cc", diff --git a/apps/app_window_contents.cc b/extensions/browser/app_window/app_window_contents.cc index 8461e24..9f0425a 100644 --- a/apps/app_window_contents.cc +++ b/extensions/browser/app_window/app_window_contents.cc @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "apps/app_window_contents.h" +#include "extensions/browser/app_window/app_window_contents.h" #include <string> #include <utility> -#include "chrome/browser/chrome_notification_types.h" -#include "chrome/common/extensions/api/app_window.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -20,10 +18,7 @@ #include "extensions/browser/app_window/native_app_window.h" #include "extensions/common/extension_messages.h" -namespace app_window = extensions::api::app_window; -using extensions::AppWindow; - -namespace apps { +namespace extensions { AppWindowContentsImpl::AppWindowContentsImpl(AppWindow* host) : host_(host) {} @@ -34,7 +29,7 @@ void AppWindowContentsImpl::Initialize(content::BrowserContext* context, url_ = url; extension_function_dispatcher_.reset( - new extensions::ExtensionFunctionDispatcher(context, this)); + new ExtensionFunctionDispatcher(context, this)); web_contents_.reset( content::WebContents::Create(content::WebContents::CreateParams( @@ -66,7 +61,7 @@ void AppWindowContentsImpl::LoadContents(int32 creator_process_id) { } void AppWindowContentsImpl::NativeWindowChanged( - extensions::NativeAppWindow* native_app_window) { + NativeAppWindow* native_app_window) { base::ListValue args; base::DictionaryValue* dictionary = new base::DictionaryValue(); args.Append(dictionary); @@ -112,8 +107,7 @@ bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) { return handled; } -extensions::WindowController* -AppWindowContentsImpl::GetExtensionWindowController() const { +WindowController* AppWindowContentsImpl::GetExtensionWindowController() const { return NULL; } @@ -128,7 +122,7 @@ void AppWindowContentsImpl::OnRequest( } void AppWindowContentsImpl::UpdateDraggableRegions( - const std::vector<extensions::DraggableRegion>& regions) { + const std::vector<DraggableRegion>& regions) { host_->UpdateDraggableRegions(regions); } @@ -142,4 +136,4 @@ void AppWindowContentsImpl::SuspendRenderViewHost( rvh->GetProcess()->GetID(), rvh->GetRoutingID())); } -} // namespace apps +} // namespace extensions diff --git a/apps/app_window_contents.h b/extensions/browser/app_window/app_window_contents.h index fb3534e..2a3d905b 100644 --- a/apps/app_window_contents.h +++ b/extensions/browser/app_window/app_window_contents.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_APP_WINDOW_CONTENTS_H_ -#define APPS_APP_WINDOW_CONTENTS_H_ +#ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_ +#define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" @@ -18,28 +18,24 @@ class BrowserContext; } namespace extensions { -struct DraggableRegion; -} -namespace apps { +struct DraggableRegion; // AppWindowContents class specific to app windows. It maintains a // WebContents instance and observes it for the purpose of passing // messages to the extensions system. -class AppWindowContentsImpl - : public extensions::AppWindowContents, - public content::WebContentsObserver, - public extensions::ExtensionFunctionDispatcher::Delegate { +class AppWindowContentsImpl : public AppWindowContents, + public content::WebContentsObserver, + public ExtensionFunctionDispatcher::Delegate { public: - explicit AppWindowContentsImpl(extensions::AppWindow* host); + explicit AppWindowContentsImpl(AppWindow* host); virtual ~AppWindowContentsImpl(); // AppWindowContents virtual void Initialize(content::BrowserContext* context, const GURL& url) OVERRIDE; virtual void LoadContents(int32 creator_process_id) OVERRIDE; - virtual void NativeWindowChanged( - extensions::NativeAppWindow* native_app_window) OVERRIDE; + virtual void NativeWindowChanged(NativeAppWindow* native_app_window) OVERRIDE; virtual void NativeWindowClosed() OVERRIDE; virtual void DispatchWindowShownForTests() const OVERRIDE; virtual content::WebContents* GetWebContents() const OVERRIDE; @@ -48,25 +44,22 @@ class AppWindowContentsImpl // content::WebContentsObserver virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - // extensions::ExtensionFunctionDispatcher::Delegate - virtual extensions::WindowController* GetExtensionWindowController() const - OVERRIDE; + // ExtensionFunctionDispatcher::Delegate + virtual WindowController* GetExtensionWindowController() const OVERRIDE; virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; void OnRequest(const ExtensionHostMsg_Request_Params& params); - void UpdateDraggableRegions( - const std::vector<extensions::DraggableRegion>& regions); + void UpdateDraggableRegions(const std::vector<DraggableRegion>& regions); void SuspendRenderViewHost(content::RenderViewHost* rvh); - extensions::AppWindow* host_; // This class is owned by |host_| + AppWindow* host_; // This class is owned by |host_| GURL url_; scoped_ptr<content::WebContents> web_contents_; - scoped_ptr<extensions::ExtensionFunctionDispatcher> - extension_function_dispatcher_; + scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; DISALLOW_COPY_AND_ASSIGN(AppWindowContentsImpl); }; -} // namespace apps +} // namespace extensions -#endif // APPS_APP_WINDOW_CONTENTS_H_ +#endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_CONTENTS_H_ diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index 4ce60a6..91b7c23 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -430,6 +430,8 @@ 'browser/app_window/app_web_contents_helper.h', 'browser/app_window/app_window.cc', 'browser/app_window/app_window.h', + 'browser/app_window/app_window_contents.cc', + 'browser/app_window/app_window_contents.h', 'browser/app_window/app_window_geometry_cache.cc', 'browser/app_window/app_window_geometry_cache.h', 'browser/app_window/app_window_registry.cc', |