diff options
author | hashimoto <hashimoto@chromium.org> | 2014-09-11 02:14:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-11 09:20:51 +0000 |
commit | 68096136752418afb7fe4110e928921786439f18 (patch) | |
tree | 2ccb77a87642d92b8da1751006efd566c1fbd8d0 /athena/content/shell | |
parent | 5e25a43e598b930ae8c8008d00edd54b0cf82f07 (diff) | |
download | chromium_src-68096136752418afb7fe4110e928921786439f18.zip chromium_src-68096136752418afb7fe4110e928921786439f18.tar.gz chromium_src-68096136752418afb7fe4110e928921786439f18.tar.bz2 |
Support app.window.create on athena
*src/athena
Change ShellAppActivity to accept both AppWindow and ShellAppWindow.
Implement AppsClient to create NativeAppWindow and AppDelegate instances.
*src/extensions/shell
Add a new method DefaultShellBrowserMainDelegate::CreateAppsClient() to inject athena's AppsClient.
*src/extensions/browser
Add missing dtor to extensions::AppsClient to destroy an instance with a base class pointer in DefaultShellBrowserMainDelegate.
BUG=387288
TBR=benwells@chromium.org for the addition of the missing dtor of extensions::AppsClient.
Review URL: https://codereview.chromium.org/552133003
Cr-Commit-Position: refs/heads/master@{#294363}
Diffstat (limited to 'athena/content/shell')
-rw-r--r-- | athena/content/shell/DEPS | 3 | ||||
-rw-r--r-- | athena/content/shell/content_activity_factory.cc | 2 | ||||
-rw-r--r-- | athena/content/shell/shell_app_activity.cc | 11 | ||||
-rw-r--r-- | athena/content/shell/shell_app_activity.h | 4 |
4 files changed, 17 insertions, 3 deletions
diff --git a/athena/content/shell/DEPS b/athena/content/shell/DEPS index 7b9f788..4bc63bc 100644 --- a/athena/content/shell/DEPS +++ b/athena/content/shell/DEPS @@ -1,3 +1,4 @@ include_rules = [ - "+extensions/shell/browser/shell_app_window.h", + "+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 d87c81e..edcc76f 100644 --- a/athena/content/shell/content_activity_factory.cc +++ b/athena/content/shell/content_activity_factory.cc @@ -17,7 +17,7 @@ Activity* ContentActivityFactory::CreateAppActivity( Activity* ContentActivityFactory::CreateAppActivity( extensions::AppWindow* app_window, views::WebView* web_view) { - return NULL; + return new ShellAppActivity(app_window); } } // namespace athena diff --git a/athena/content/shell/shell_app_activity.cc b/athena/content/shell/shell_app_activity.cc index d8a5077..50eb45b 100644 --- a/athena/content/shell/shell_app_activity.cc +++ b/athena/content/shell/shell_app_activity.cc @@ -5,17 +5,25 @@ #include "athena/content/shell/shell_app_activity.h" #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), shell_app_window_(app_window) { + : AppActivity(app_id), app_window_(NULL), shell_app_window_(app_window) { } ShellAppActivity::~ShellAppActivity() { + if (app_window_) + app_window_->GetBaseWindow()->Close(); // Deletes |app_window_|. } views::Widget* ShellAppActivity::CreateWidget() { @@ -24,6 +32,7 @@ views::Widget* ShellAppActivity::CreateWidget() { views::WebView* ShellAppActivity::GetWebView() { content::WebContents* web_contents = + app_window_ ? app_window_->web_contents() : shell_app_window_->GetAssociatedWebContents(); views::WebView* web_view = new views::WebView(web_contents->GetBrowserContext()); diff --git a/athena/content/shell/shell_app_activity.h b/athena/content/shell/shell_app_activity.h index 336293e..ad3467b 100644 --- a/athena/content/shell/shell_app_activity.h +++ b/athena/content/shell/shell_app_activity.h @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" namespace extensions { +class AppWindow; class ShellAppWindow; } @@ -17,6 +18,8 @@ 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(); @@ -28,6 +31,7 @@ class ShellAppActivity : public AppActivity { // AppActivity: virtual views::WebView* GetWebView() OVERRIDE; + extensions::AppWindow* app_window_; scoped_ptr<extensions::ShellAppWindow> shell_app_window_; DISALLOW_COPY_AND_ASSIGN(ShellAppActivity); |