Index: athena/main/athena_main.cc |
diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc |
index 8ce723694d27aa1abb8f531b6dbbf1493f8b814c..9e266ec67e2ddfde72a6750d9b07f8927d81e509 100644 |
--- a/athena/main/athena_main.cc |
+++ b/athena/main/athena_main.cc |
@@ -12,6 +12,7 @@ |
#include "athena/main/placeholder.h" |
#include "athena/main/url_search_provider.h" |
#include "athena/screen/public/screen_manager.h" |
+#include "athena/screen/public/screen_manager_delegate.h" |
#include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
#include "base/command_line.h" |
#include "base/file_util.h" |
@@ -75,6 +76,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() {} |
@@ -102,8 +125,14 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { |
extension_system->LoadApp(app_absolute_dir); |
} |
+ extensions::ShellDesktopController* desktop_controller = |
+ extensions::ShellDesktopController::instance(); |
+ screen_manager_delegate_.reset( |
+ new AthenaScreenManagerDelegate(desktop_controller)); |
+ |
athena::StartAthena( |
- extensions::ShellDesktopController::instance()->host()->window(), |
+ desktop_controller->host()->window(), |
+ screen_manager_delegate_.get(), |
new athena::ContentActivityFactory(), |
new athena::ContentAppModelBuilder(context)); |
athena::HomeCard::Get()->RegisterSearchProvider( |
@@ -131,6 +160,7 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { |
private: |
scoped_ptr<VirtualKeyboardObserver> keyboard_observer_; |
+ scoped_ptr<AthenaScreenManagerDelegate> screen_manager_delegate_; |
DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
}; |