| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/shell/app/shell_main_delegate.h" | 5 #include "apps/shell/app/shell_main_delegate.h" |
| 6 #include "apps/shell/browser/shell_browser_main_delegate.h" | 6 #include "apps/shell/browser/shell_browser_main_delegate.h" |
| 7 #include "apps/shell/browser/shell_desktop_controller.h" | 7 #include "apps/shell/browser/shell_desktop_controller.h" |
| 8 #include "athena/content/public/content_activity_factory.h" | 8 #include "athena/content/public/content_activity_factory.h" |
| 9 #include "athena/main/athena_launcher.h" | 9 #include "athena/main/athena_launcher.h" |
| 10 #include "athena/main/placeholder.h" | 10 #include "athena/main/placeholder.h" |
| 11 #include "athena/main/placeholder_content.h" | 11 #include "athena/main/placeholder_content.h" |
| 12 #include "content/public/app/content_main.h" | 12 #include "content/public/app/content_main.h" |
| 13 #include "ui/aura/window_tree_host.h" | 13 #include "ui/aura/window_tree_host.h" |
| 14 #include "ui/wm/core/visibility_controller.h" | 14 #include "ui/wm/core/visibility_controller.h" |
| 15 | 15 |
| 16 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { | 16 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
| 17 public: | 17 public: |
| 18 AthenaBrowserMainDelegate() {} | 18 AthenaBrowserMainDelegate() {} |
| 19 virtual ~AthenaBrowserMainDelegate() {} | 19 virtual ~AthenaBrowserMainDelegate() {} |
| 20 | 20 |
| 21 // apps::ShellBrowserMainDelegate: | 21 // apps::ShellBrowserMainDelegate: |
| 22 virtual void Start(content::BrowserContext* context) OVERRIDE { | 22 virtual void Start(content::BrowserContext* context) OVERRIDE { |
| 23 athena::StartAthena( | 23 athena::StartAthena( |
| 24 apps::ShellDesktopController::instance()->host()->window()); | 24 apps::ShellDesktopController::instance()->host()->window(), |
| 25 athena::ActivityFactory::RegisterActivityFactory( | |
| 26 new athena::ContentActivityFactory()); | 25 new athena::ContentActivityFactory()); |
| 27 CreateTestWindows(); | 26 CreateTestWindows(); |
| 28 CreateTestPages(context); | 27 CreateTestPages(context); |
| 29 } | 28 } |
| 30 | 29 |
| 31 virtual void Shutdown() OVERRIDE { | 30 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } |
| 32 // TODO(mukai):cleanup the start/shutdown processes and the dependency to | |
| 33 // ContentActivityFactory. | |
| 34 athena::ActivityFactory::Shutdown(); | |
| 35 athena::ShutdownAthena(); | |
| 36 } | |
| 37 | 31 |
| 38 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { | 32 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { |
| 39 // TODO(mukai): create Athena's own ShellDesktopController subclass so that | 33 // TODO(mukai): create Athena's own ShellDesktopController subclass so that |
| 40 // it can initialize its own window manager logic. | 34 // it can initialize its own window manager logic. |
| 41 return new apps::ShellDesktopController(); | 35 return new apps::ShellDesktopController(); |
| 42 } | 36 } |
| 43 | 37 |
| 44 private: | 38 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
| 46 }; | 40 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 | 56 |
| 63 int main(int argc, const char** argv) { | 57 int main(int argc, const char** argv) { |
| 64 AthenaMainDelegate delegate; | 58 AthenaMainDelegate delegate; |
| 65 content::ContentMainParams params(&delegate); | 59 content::ContentMainParams params(&delegate); |
| 66 | 60 |
| 67 params.argc = argc; | 61 params.argc = argc; |
| 68 params.argv = argv; | 62 params.argv = argv; |
| 69 | 63 |
| 70 return content::ContentMain(params); | 64 return content::ContentMain(params); |
| 71 } | 65 } |
| OLD | NEW |