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 "apps/shell/browser/shell_extension_system.h" | 8 #include "apps/shell/browser/shell_extension_system.h" |
9 #include "apps/shell/renderer/shell_renderer_main_delegate.h" | 9 #include "apps/shell/renderer/shell_renderer_main_delegate.h" |
10 #include "athena/content/public/content_activity_factory.h" | 10 #include "athena/content/public/content_activity_factory.h" |
11 #include "athena/content/public/content_app_model_builder.h" | 11 #include "athena/content/public/content_app_model_builder.h" |
12 #include "athena/home/public/home_card.h" | 12 #include "athena/home/public/home_card.h" |
13 #include "athena/main/athena_app_window_controller.h" | 13 #include "athena/main/athena_app_window_controller.h" |
14 #include "athena/main/athena_launcher.h" | 14 #include "athena/main/athena_launcher.h" |
15 #include "athena/main/placeholder.h" | 15 #include "athena/main/placeholder.h" |
16 #include "athena/main/url_search_provider.h" | 16 #include "athena/main/url_search_provider.h" |
| 17 #include "athena/virtual_keyboard/public/virtual_keyboard_bindings.h" |
| 18 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
17 #include "base/command_line.h" | 19 #include "base/command_line.h" |
18 #include "base/file_util.h" | 20 #include "base/file_util.h" |
19 #include "content/public/app/content_main.h" | 21 #include "content/public/app/content_main.h" |
20 #include "ui/aura/window_tree_host.h" | 22 #include "ui/aura/window_tree_host.h" |
21 #include "ui/wm/core/visibility_controller.h" | 23 #include "ui/wm/core/visibility_controller.h" |
22 | 24 |
23 namespace { | 25 namespace { |
24 const std::string kAppSwitch = "app"; | 26 const std::string kAppSwitch = "app"; |
25 } // namespace | 27 } // namespace |
26 | 28 |
(...skipping 13 matching lines...) Expand all Loading... |
40 extensions::ExtensionSystem::Get(context)); | 42 extensions::ExtensionSystem::Get(context)); |
41 extension_system->LoadApp(app_absolute_dir); | 43 extension_system->LoadApp(app_absolute_dir); |
42 } | 44 } |
43 | 45 |
44 athena::StartAthena( | 46 athena::StartAthena( |
45 apps::ShellDesktopController::instance()->host()->window(), | 47 apps::ShellDesktopController::instance()->host()->window(), |
46 new athena::ContentActivityFactory(), | 48 new athena::ContentActivityFactory(), |
47 new athena::ContentAppModelBuilder(context)); | 49 new athena::ContentAppModelBuilder(context)); |
48 athena::HomeCard::Get()->RegisterSearchProvider( | 50 athena::HomeCard::Get()->RegisterSearchProvider( |
49 new athena::UrlSearchProvider(context)); | 51 new athena::UrlSearchProvider(context)); |
| 52 athena::VirtualKeyboardManager::Create(context); |
| 53 |
50 CreateTestPages(context); | 54 CreateTestPages(context); |
51 } | 55 } |
52 | 56 |
53 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } | 57 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } |
54 | 58 |
55 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { | 59 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { |
56 // TODO(mukai): create Athena's own ShellDesktopController subclass so that | 60 // TODO(mukai): create Athena's own ShellDesktopController subclass so that |
57 // it can initialize its own window manager logic. | 61 // it can initialize its own window manager logic. |
58 apps::ShellDesktopController* desktop = new apps::ShellDesktopController(); | 62 apps::ShellDesktopController* desktop = new apps::ShellDesktopController(); |
59 desktop->SetAppWindowController(new athena::AthenaAppWindowController()); | 63 desktop->SetAppWindowController(new athena::AthenaAppWindowController()); |
60 return desktop; | 64 return desktop; |
61 } | 65 } |
62 | 66 |
63 private: | 67 private: |
64 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
65 }; | 69 }; |
66 | 70 |
67 class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate { | 71 class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate { |
68 public: | 72 public: |
69 AthenaRendererMainDelegate() {} | 73 AthenaRendererMainDelegate() {} |
70 virtual ~AthenaRendererMainDelegate() {} | 74 virtual ~AthenaRendererMainDelegate() {} |
71 | 75 |
72 private: | 76 private: |
73 // apps::ShellRendererMainDelegate: | 77 // apps::ShellRendererMainDelegate: |
74 virtual void OnThreadStarted(content::RenderThread* thread) OVERRIDE {} | 78 virtual void OnThreadStarted(content::RenderThread* thread) OVERRIDE {} |
75 | 79 |
76 virtual void OnViewCreated(content::RenderView* render_view) OVERRIDE {} | 80 virtual void OnViewCreated(content::RenderView* render_view) OVERRIDE { |
| 81 athena::VirtualKeyboardBindings::Create(render_view); |
| 82 } |
77 | 83 |
78 DISALLOW_COPY_AND_ASSIGN(AthenaRendererMainDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(AthenaRendererMainDelegate); |
79 }; | 85 }; |
80 | 86 |
81 class AthenaMainDelegate : public apps::ShellMainDelegate { | 87 class AthenaMainDelegate : public apps::ShellMainDelegate { |
82 public: | 88 public: |
83 AthenaMainDelegate() {} | 89 AthenaMainDelegate() {} |
84 virtual ~AthenaMainDelegate() {} | 90 virtual ~AthenaMainDelegate() {} |
85 | 91 |
86 private: | 92 private: |
(...skipping 14 matching lines...) Expand all Loading... |
101 | 107 |
102 int main(int argc, const char** argv) { | 108 int main(int argc, const char** argv) { |
103 AthenaMainDelegate delegate; | 109 AthenaMainDelegate delegate; |
104 content::ContentMainParams params(&delegate); | 110 content::ContentMainParams params(&delegate); |
105 | 111 |
106 params.argc = argc; | 112 params.argc = argc; |
107 params.argv = argv; | 113 params.argv = argv; |
108 | 114 |
109 return content::ContentMain(params); | 115 return content::ContentMain(params); |
110 } | 116 } |
OLD | NEW |