summaryrefslogtreecommitdiffstats
path: root/athena/main
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-21 15:09:13 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-21 15:10:36 +0000
commita105bc04f43ec8194b51796d4d59ec6dcec86acc (patch)
tree2b6e940644b005def4fc830d9b56652d918a0a02 /athena/main
parent935ae1dcbd5352a19ff292534adec4c792e0506f (diff)
downloadchromium_src-a105bc04f43ec8194b51796d4d59ec6dcec86acc.zip
chromium_src-a105bc04f43ec8194b51796d4d59ec6dcec86acc.tar.gz
chromium_src-a105bc04f43ec8194b51796d4d59ec6dcec86acc.tar.bz2
Make the minimized home card not overlap activities on Athena
BUG=402509 TEST=Manual, see bug NOTRY=true Review URL: https://codereview.chromium.org/465803002 Cr-Commit-Position: refs/heads/master@{#291072} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'athena/main')
-rw-r--r--athena/main/athena_launcher.cc5
-rw-r--r--athena/main/athena_launcher.h4
-rw-r--r--athena/main/athena_main.cc33
3 files changed, 37 insertions, 5 deletions
diff --git a/athena/main/athena_launcher.cc b/athena/main/athena_launcher.cc
index 6932435..de4dbc7 100644
--- a/athena/main/athena_launcher.cc
+++ b/athena/main/athena_launcher.cc
@@ -91,7 +91,8 @@ class AthenaViewsDelegate : public views::ViewsDelegate {
DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate);
};
-void StartAthenaEnv(aura::Window* root_window) {
+void StartAthenaEnv(aura::Window* root_window,
+ athena::ScreenManagerDelegate* delegate) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
// Force showing in the experimental app-list view.
@@ -116,7 +117,7 @@ void StartAthenaEnv(aura::Window* root_window) {
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::FILE));
athena::InputManager::Create()->OnRootWindowCreated(root_window);
- athena::ScreenManager::Create(root_window);
+ athena::ScreenManager::Create(delegate, root_window);
athena::WindowManager::Create();
SetupBackgroundImage();
diff --git a/athena/main/athena_launcher.h b/athena/main/athena_launcher.h
index 8069927..66a853c 100644
--- a/athena/main/athena_launcher.h
+++ b/athena/main/athena_launcher.h
@@ -16,9 +16,11 @@ class BrowserContext;
namespace athena {
class ActivityFactory;
class AppModelBuilder;
+class ScreenManagerDelegate;
// Starts/shuts down the athena shell environment.
-void StartAthenaEnv(aura::Window* root_window);
+void StartAthenaEnv(aura::Window* root_window,
+ ScreenManagerDelegate* screen_manager_delegate);
void StartAthenaSessionWithContext(content::BrowserContext* context);
diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc
index b4cde71..87982cc 100644
--- a/athena/main/athena_main.cc
+++ b/athena/main/athena_main.cc
@@ -6,6 +6,7 @@
#include "athena/main/athena_app_window_controller.h"
#include "athena/main/athena_launcher.h"
#include "athena/screen/public/screen_manager.h"
+#include "athena/screen/public/screen_manager_delegate.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -43,6 +44,28 @@ class AthenaDesktopController : public extensions::ShellDesktopController {
DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController);
};
+class AthenaScreenManagerDelegate : public athena::ScreenManagerDelegate {
+ public:
+ explicit AthenaScreenManagerDelegate(
+ extensions::ShellDesktopController* controller)
+ : controller_(controller) {
+ }
+
+ virtual ~AthenaScreenManagerDelegate() {
+ }
+
+ private:
+ // athena::ScreenManagerDelegate:
+ virtual void SetWorkAreaInsets(const gfx::Insets& insets) OVERRIDE {
+ controller_->SetDisplayWorkAreaInsets(insets);
+ }
+
+ // Not owned.
+ extensions::ShellDesktopController* controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(AthenaScreenManagerDelegate);
+};
+
class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
public:
AthenaBrowserMainDelegate() {}
@@ -66,8 +89,12 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
extension_system->LoadApp(app_absolute_dir);
}
- athena::StartAthenaEnv(
- extensions::ShellDesktopController::instance()->host()->window());
+ extensions::ShellDesktopController* desktop_controller =
+ extensions::ShellDesktopController::instance();
+ screen_manager_delegate_.reset(
+ new AthenaScreenManagerDelegate(desktop_controller));
+ athena::StartAthenaEnv(desktop_controller->host()->window(),
+ screen_manager_delegate_.get());
athena::StartAthenaSessionWithContext(context);
}
@@ -85,6 +112,8 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
}
private:
+ scoped_ptr<AthenaScreenManagerDelegate> screen_manager_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate);
};