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" |
| 8 #include "athena/main/main_util.h" |
| 9 #include "athena/screen/public/screen_manager.h" |
| 10 #include "athena/wm/public/window_manager.h" |
7 #include "content/public/app/content_main.h" | 11 #include "content/public/app/content_main.h" |
| 12 #include "ui/aura/window_tree_host.h" |
8 | 13 |
9 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { | 14 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
10 public: | 15 public: |
11 AthenaBrowserMainDelegate() {} | 16 AthenaBrowserMainDelegate() {} |
12 virtual ~AthenaBrowserMainDelegate() {} | 17 virtual ~AthenaBrowserMainDelegate() {} |
13 | 18 |
14 // apps::ShellBrowserMainDelegate: | 19 // apps::ShellBrowserMainDelegate: |
15 virtual void Start(content::BrowserContext* context) OVERRIDE {} | 20 virtual void Start(content::BrowserContext* context) OVERRIDE { |
16 virtual void Shutdown() OVERRIDE {} | 21 athena::ScreenManager::Create(apps::ShellDesktopController::instance() |
| 22 ->GetWindowTreeHost() |
| 23 ->window()); |
| 24 athena::WindowManager::Create(); |
| 25 |
| 26 SetupBackgroundImage(); |
| 27 CreateTestApp(); |
| 28 } |
| 29 |
| 30 virtual void Shutdown() OVERRIDE { |
| 31 athena::WindowManager::Shutdown(); |
| 32 athena::ScreenManager::Shutdown(); |
| 33 } |
17 | 34 |
18 private: | 35 private: |
19 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
20 }; | 37 }; |
21 | 38 |
22 class AthenaMainDelegate : public apps::ShellMainDelegate { | 39 class AthenaMainDelegate : public apps::ShellMainDelegate { |
23 public: | 40 public: |
24 AthenaMainDelegate() {} | 41 AthenaMainDelegate() {} |
25 virtual ~AthenaMainDelegate() {} | 42 virtual ~AthenaMainDelegate() {} |
26 | 43 |
27 private: | 44 private: |
28 // apps::ShellMainDelegate: | 45 // apps::ShellMainDelegate: |
29 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() | 46 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() |
30 OVERRIDE { | 47 OVERRIDE { |
31 return new AthenaBrowserMainDelegate(); | 48 return new AthenaBrowserMainDelegate(); |
32 } | 49 } |
33 | 50 |
34 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); | 51 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); |
35 }; | 52 }; |
36 | 53 |
37 int main(int argc, const char** argv) { | 54 int main(int argc, const char** argv) { |
38 AthenaMainDelegate delegate; | 55 AthenaMainDelegate delegate; |
39 content::ContentMainParams params(&delegate); | 56 content::ContentMainParams params(&delegate); |
40 | 57 |
41 params.argc = argc; | 58 params.argc = argc; |
42 params.argv = argv; | 59 params.argv = argv; |
43 | 60 |
44 return content::ContentMain(params); | 61 return content::ContentMain(params); |
45 } | 62 } |
OLD | NEW |