diff options
author | jamescook <jamescook@chromium.org> | 2014-09-15 11:27:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-15 18:31:44 +0000 |
commit | 877e2ab661da959e844d0f0f1e71f815d32d8c77 (patch) | |
tree | 5fc270aa7330836c0e8070f2c0a642cb973438d5 /athena | |
parent | e380f604301c5cdde7d0fad496a5d46c80233afc (diff) | |
download | chromium_src-877e2ab661da959e844d0f0f1e71f815d32d8c77.zip chromium_src-877e2ab661da959e844d0f0f1e71f815d32d8c77.tar.gz chromium_src-877e2ab661da959e844d0f0f1e71f815d32d8c77.tar.bz2 |
Remove app_shell chrome.shell API and ShellAppWindow
The chrome.app.window API has been moved to src/extensions, so app_shell
no longer needs its custom chrome.shell API to open windows.
* Remove the API implementation -- mostly a manual revert of https://codereview.chromium.org/254473011/
* Remove app_shell_resources.grd since there are no more app_shell resources
* Remove athena's support for ShellAppWindow
* Fix example apps to remove the chrome.shell workaround.
No presubmit because it has a false-positive warning about the enum rename in extension_function_histogram_value.h
No try because no presubmit doesn't seem to work by itself.
BUG=413164
TEST=extensions_unittests, app_shell_unittests, app_shell_browsertests
TBR=isherman@chromium.org for deprecating an extension function histogram
NOPRESUBMIT=true
NOTRY=true
Review URL: https://codereview.chromium.org/571643003
Cr-Commit-Position: refs/heads/master@{#294852}
Diffstat (limited to 'athena')
-rw-r--r-- | athena/activity/public/activity_factory.h | 8 | ||||
-rw-r--r-- | athena/content/chrome/content_activity_factory.cc | 6 | ||||
-rw-r--r-- | athena/content/content_activity_factory.h | 2 | ||||
-rw-r--r-- | athena/content/shell/DEPS | 1 | ||||
-rw-r--r-- | athena/content/shell/content_activity_factory.cc | 6 | ||||
-rw-r--r-- | athena/content/shell/shell_app_activity.cc | 14 | ||||
-rw-r--r-- | athena/content/shell/shell_app_activity.h | 5 | ||||
-rw-r--r-- | athena/main/athena_main.cc | 15 | ||||
-rw-r--r-- | athena/test/sample_activity_factory.cc | 9 | ||||
-rw-r--r-- | athena/test/sample_activity_factory.h | 2 |
10 files changed, 4 insertions, 64 deletions
diff --git a/athena/activity/public/activity_factory.h b/athena/activity/public/activity_factory.h index e69ee7a..d38e31d 100644 --- a/athena/activity/public/activity_factory.h +++ b/athena/activity/public/activity_factory.h @@ -14,7 +14,6 @@ class BrowserContext; namespace extensions { class AppWindow; -class ShellAppWindow; } namespace views { @@ -43,13 +42,6 @@ class ATHENA_EXPORT ActivityFactory { const base::string16& title, const GURL& url) = 0; - // Create an activity of an app with |app_window| for app shell environemnt. - // The returned activity should own |app_window|. - // TODO(oshima): Consolidate these two methods to create AppActivity - // once crbug.com/403726 is finished. - virtual Activity* CreateAppActivity(extensions::ShellAppWindow* app_window, - const std::string& id) = 0; - // Create an activity of an app with |app_window| for chrome environment and // |web_view| that will host the content. virtual Activity* CreateAppActivity(extensions::AppWindow* app_window, diff --git a/athena/content/chrome/content_activity_factory.cc b/athena/content/chrome/content_activity_factory.cc index a8ba6d5..f3c9592 100644 --- a/athena/content/chrome/content_activity_factory.cc +++ b/athena/content/chrome/content_activity_factory.cc @@ -53,10 +53,4 @@ Activity* ContentActivityFactory::CreateAppActivity( return new ChromeAppActivity(app_window, web_view); } -Activity* ContentActivityFactory::CreateAppActivity( - extensions::ShellAppWindow* app_window, - const std::string& app_id) { - return NULL; -} - } // namespace athena diff --git a/athena/content/content_activity_factory.h b/athena/content/content_activity_factory.h index d3a23ba..25c6d38 100644 --- a/athena/content/content_activity_factory.h +++ b/athena/content/content_activity_factory.h @@ -19,8 +19,6 @@ class ContentActivityFactory : public ActivityFactory { virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, const base::string16& title, const GURL& url) OVERRIDE; - virtual Activity* CreateAppActivity(extensions::ShellAppWindow* app_window, - const std::string& app_id) OVERRIDE; virtual Activity* CreateAppActivity(extensions::AppWindow* app_window, views::WebView* web_view) OVERRIDE; diff --git a/athena/content/shell/DEPS b/athena/content/shell/DEPS index 4bc63bc..3e1cb59 100644 --- a/athena/content/shell/DEPS +++ b/athena/content/shell/DEPS @@ -1,4 +1,3 @@ include_rules = [ "+extensions/browser/app_window", - "+extensions/shell/browser/shell_app_window.h", ] diff --git a/athena/content/shell/content_activity_factory.cc b/athena/content/shell/content_activity_factory.cc index edcc76f..76ee114 100644 --- a/athena/content/shell/content_activity_factory.cc +++ b/athena/content/shell/content_activity_factory.cc @@ -9,12 +9,6 @@ namespace athena { Activity* ContentActivityFactory::CreateAppActivity( - extensions::ShellAppWindow* app_window, - const std::string& app_id) { - return new ShellAppActivity(app_window, app_id); -} - -Activity* ContentActivityFactory::CreateAppActivity( extensions::AppWindow* app_window, views::WebView* web_view) { return new ShellAppActivity(app_window); diff --git a/athena/content/shell/shell_app_activity.cc b/athena/content/shell/shell_app_activity.cc index 50eb45b..cb008e0 100644 --- a/athena/content/shell/shell_app_activity.cc +++ b/athena/content/shell/shell_app_activity.cc @@ -7,23 +7,17 @@ #include "content/public/browser/web_contents.h" #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/native_app_window.h" -#include "extensions/shell/browser/shell_app_window.h" #include "ui/views/controls/webview/webview.h" namespace athena { ShellAppActivity::ShellAppActivity(extensions::AppWindow* app_window) : AppActivity(app_window->extension_id()), app_window_(app_window) { -} - -ShellAppActivity::ShellAppActivity(extensions::ShellAppWindow* app_window, - const std::string& app_id) - : AppActivity(app_id), app_window_(NULL), shell_app_window_(app_window) { + DCHECK(app_window_); } ShellAppActivity::~ShellAppActivity() { - if (app_window_) - app_window_->GetBaseWindow()->Close(); // Deletes |app_window_|. + app_window_->GetBaseWindow()->Close(); // Deletes |app_window_|. } views::Widget* ShellAppActivity::CreateWidget() { @@ -31,9 +25,7 @@ views::Widget* ShellAppActivity::CreateWidget() { } views::WebView* ShellAppActivity::GetWebView() { - content::WebContents* web_contents = - app_window_ ? app_window_->web_contents() : - shell_app_window_->GetAssociatedWebContents(); + content::WebContents* web_contents = app_window_->web_contents(); views::WebView* web_view = new views::WebView(web_contents->GetBrowserContext()); web_view->SetWebContents(web_contents); diff --git a/athena/content/shell/shell_app_activity.h b/athena/content/shell/shell_app_activity.h index ad3467b..a6b7dec 100644 --- a/athena/content/shell/shell_app_activity.h +++ b/athena/content/shell/shell_app_activity.h @@ -11,7 +11,6 @@ namespace extensions { class AppWindow; -class ShellAppWindow; } namespace athena { @@ -19,9 +18,6 @@ namespace athena { class ShellAppActivity : public AppActivity { public: explicit ShellAppActivity(extensions::AppWindow* app_window); - // TODO(hashimoto) Remove this. - ShellAppActivity(extensions::ShellAppWindow* app_window, - const std::string& app_id); virtual ~ShellAppActivity(); private: @@ -32,7 +28,6 @@ class ShellAppActivity : public AppActivity { virtual views::WebView* GetWebView() OVERRIDE; extensions::AppWindow* app_window_; - scoped_ptr<extensions::ShellAppWindow> shell_app_window_; DISALLOW_COPY_AND_ASSIGN(ShellAppActivity); }; diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc index fe60d23..da0b392 100644 --- a/athena/main/athena_main.cc +++ b/athena/main/athena_main.cc @@ -22,7 +22,6 @@ #include "extensions/shell/app/shell_main_delegate.h" #include "extensions/shell/browser/desktop_controller.h" #include "extensions/shell/browser/shell_app_delegate.h" -#include "extensions/shell/browser/shell_app_window.h" #include "extensions/shell/browser/shell_browser_main_delegate.h" #include "extensions/shell/browser/shell_content_browser_client.h" #include "extensions/shell/browser/shell_extension_system.h" @@ -55,21 +54,9 @@ class AthenaDesktopController : public extensions::DesktopController { return athena::AthenaEnv::Get()->GetHost(); } - // Creates a new ShellAppWindow and adds it to the desktop. The desktop - // maintains ownership of the window. - virtual extensions::ShellAppWindow* CreateShellAppWindow( - content::BrowserContext* context, - const extensions::Extension* extension) OVERRIDE { - extensions::ShellAppWindow* app_window = new extensions::ShellAppWindow(); - app_window->Init(context, extension, gfx::Size(100, 100)); - athena::ActivityManager::Get()->AddActivity( - athena::ActivityFactory::Get()->CreateAppActivity(app_window, - extension->id())); - return app_window; - } - // Creates a new app window and adds it to the desktop. The desktop maintains // ownership of the window. + // TODO(jamescook|oshima): Is this function needed? virtual extensions::AppWindow* CreateAppWindow( content::BrowserContext* context, const extensions::Extension* extension) OVERRIDE { diff --git a/athena/test/sample_activity_factory.cc b/athena/test/sample_activity_factory.cc index 8fb0bd2..d7444eb 100644 --- a/athena/test/sample_activity_factory.cc +++ b/athena/test/sample_activity_factory.cc @@ -36,15 +36,6 @@ Activity* SampleActivityFactory::CreateWebActivity( } Activity* SampleActivityFactory::CreateAppActivity( - extensions::ShellAppWindow* app_window, - const std::string& app_id) { - // SampleActivityFactory can't own the |app_window|, so it must be NULL. - DCHECK(app_window == NULL); - return new SampleActivity( - kDefaultAppColor, kDefaultAppContentColor, base::UTF8ToUTF16("App")); -} - -Activity* SampleActivityFactory::CreateAppActivity( extensions::AppWindow* app_window, views::WebView* web_view) { DCHECK(!web_view); diff --git a/athena/test/sample_activity_factory.h b/athena/test/sample_activity_factory.h index af4a5be..819d9cc 100644 --- a/athena/test/sample_activity_factory.h +++ b/athena/test/sample_activity_factory.h @@ -20,8 +20,6 @@ class SampleActivityFactory : public ActivityFactory { virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, const base::string16& title, const GURL& url) OVERRIDE; - virtual Activity* CreateAppActivity(extensions::ShellAppWindow* app_window, - const std::string& app_id) OVERRIDE; virtual Activity* CreateAppActivity(extensions::AppWindow* app_window, views::WebView* web_view) OVERRIDE; |