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/main/athena_launcher.h" | 8 #include "athena/main/athena_launcher.h" |
9 #include "athena/main/placeholder.h" | 9 #include "athena/main/placeholder.h" |
10 #include "content/public/app/content_main.h" | 10 #include "content/public/app/content_main.h" |
11 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
12 #include "ui/wm/core/visibility_controller.h" | 12 #include "ui/wm/core/visibility_controller.h" |
13 | 13 |
14 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { | 14 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
15 public: | 15 public: |
16 AthenaBrowserMainDelegate() {} | 16 AthenaBrowserMainDelegate() {} |
17 virtual ~AthenaBrowserMainDelegate() {} | 17 virtual ~AthenaBrowserMainDelegate() {} |
18 | 18 |
19 // apps::ShellBrowserMainDelegate: | 19 // apps::ShellBrowserMainDelegate: |
20 virtual void Start(content::BrowserContext* context) OVERRIDE { | 20 virtual void Start(content::BrowserContext* context) OVERRIDE { |
21 athena::StartAthena(apps::ShellDesktopController::instance() | 21 athena::StartAthena( |
22 ->GetWindowTreeHost() | 22 apps::ShellDesktopController::instance()->host()->window()); |
23 ->window()); | |
24 CreateTestWindows(); | 23 CreateTestWindows(); |
25 } | 24 } |
26 | 25 |
27 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } | 26 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } |
28 | 27 |
| 28 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { |
| 29 // TODO(mukai): create Athena's own ShellDesktopController subclass so that |
| 30 // it can initialize its own window manager logic. |
| 31 return new apps::ShellDesktopController(); |
| 32 } |
| 33 |
29 private: | 34 private: |
30 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 35 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
31 }; | 36 }; |
32 | 37 |
33 class AthenaMainDelegate : public apps::ShellMainDelegate { | 38 class AthenaMainDelegate : public apps::ShellMainDelegate { |
34 public: | 39 public: |
35 AthenaMainDelegate() {} | 40 AthenaMainDelegate() {} |
36 virtual ~AthenaMainDelegate() {} | 41 virtual ~AthenaMainDelegate() {} |
37 | 42 |
38 private: | 43 private: |
39 // apps::ShellMainDelegate: | 44 // apps::ShellMainDelegate: |
40 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() | 45 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() |
41 OVERRIDE { | 46 OVERRIDE { |
42 return new AthenaBrowserMainDelegate(); | 47 return new AthenaBrowserMainDelegate(); |
43 } | 48 } |
44 | 49 |
45 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); |
46 }; | 51 }; |
47 | 52 |
48 int main(int argc, const char** argv) { | 53 int main(int argc, const char** argv) { |
49 AthenaMainDelegate delegate; | 54 AthenaMainDelegate delegate; |
50 content::ContentMainParams params(&delegate); | 55 content::ContentMainParams params(&delegate); |
51 | 56 |
52 params.argc = argc; | 57 params.argc = argc; |
53 params.argv = argv; | 58 params.argv = argv; |
54 | 59 |
55 return content::ContentMain(params); | 60 return content::ContentMain(params); |
56 } | 61 } |
OLD | NEW |