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 "athena/main/public/athena_launcher.h" | 5 #include "athena/main/public/athena_launcher.h" |
6 | 6 |
7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
9 #include "athena/content/public/app_registry.h" | 9 #include "athena/content/public/app_registry.h" |
10 #include "athena/content/public/content_activity_factory_creator.h" | 10 #include "athena/content/public/content_activity_factory_creator.h" |
11 #include "athena/env/public/athena_env.h" | 11 #include "athena/env/public/athena_env.h" |
12 #include "athena/extensions/public/extension_app_model_builder.h" | 12 #include "athena/extensions/public/extension_app_model_builder.h" |
13 #include "athena/extensions/public/extensions_delegate.h" | 13 #include "athena/extensions/public/extensions_delegate.h" |
14 #include "athena/home/public/home_card.h" | 14 #include "athena/home/public/home_card.h" |
15 #include "athena/input/public/input_manager.h" | 15 #include "athena/input/public/input_manager.h" |
16 #include "athena/main/athena_views_delegate.h" | 16 #include "athena/main/athena_views_delegate.h" |
17 #include "athena/main/placeholder.h" | 17 #include "athena/main/placeholder.h" |
18 #include "athena/main/placeholder.h" | 18 #include "athena/main/placeholder.h" |
19 #include "athena/main/url_search_provider.h" | 19 #include "athena/main/url_search_provider.h" |
20 #include "athena/resource_manager/public/resource_manager.h" | 20 #include "athena/resource_manager/public/resource_manager.h" |
21 #include "athena/screen/public/screen_manager.h" | 21 #include "athena/screen/public/screen_manager.h" |
22 #include "athena/screen_lock/public/screen_lock_manager.h" | |
22 #include "athena/system/public/system_ui.h" | 23 #include "athena/system/public/system_ui.h" |
23 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" | 24 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
24 #include "athena/wm/public/window_manager.h" | 25 #include "athena/wm/public/window_manager.h" |
25 #include "base/command_line.h" | 26 #include "base/command_line.h" |
26 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
28 #include "ui/app_list/app_list_switches.h" | 29 #include "ui/app_list/app_list_switches.h" |
29 #include "ui/aura/window_property.h" | 30 #include "ui/aura/window_property.h" |
30 #include "ui/aura/window_tree_host.h" | 31 #include "ui/aura/window_tree_host.h" |
31 #include "ui/keyboard/keyboard_controller.h" | 32 #include "ui/keyboard/keyboard_controller.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 | 121 |
121 athena::ScreenManager::Get()->GetContext()->SetProperty( | 122 athena::ScreenManager::Get()->GetContext()->SetProperty( |
122 kAthenaEnvStateKey, env_state); | 123 kAthenaEnvStateKey, env_state); |
123 } | 124 } |
124 | 125 |
125 void CreateVirtualKeyboardWithContext(content::BrowserContext* context) { | 126 void CreateVirtualKeyboardWithContext(content::BrowserContext* context) { |
126 athena::VirtualKeyboardManager::Create(context); | 127 athena::VirtualKeyboardManager::Create(context); |
127 } | 128 } |
128 | 129 |
129 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 130 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
131 athena::ScreenLockManager::Create(); | |
130 athena::ExtensionsDelegate::CreateExtensionsDelegate(context); | 132 athena::ExtensionsDelegate::CreateExtensionsDelegate(context); |
131 StartAthenaSession(athena::CreateContentActivityFactory(), | 133 StartAthenaSession(athena::CreateContentActivityFactory(), |
132 new athena::ExtensionAppModelBuilder(context)); | 134 new athena::ExtensionAppModelBuilder(context)); |
133 athena::HomeCard::Get()->RegisterSearchProvider( | 135 athena::HomeCard::Get()->RegisterSearchProvider( |
134 new athena::UrlSearchProvider(context)); | 136 new athena::UrlSearchProvider(context)); |
135 AthenaEnvState* env_state = | 137 AthenaEnvState* env_state = |
136 athena::ScreenManager::Get()->GetContext()->GetProperty( | 138 athena::ScreenManager::Get()->GetContext()->GetProperty( |
137 kAthenaEnvStateKey); | 139 kAthenaEnvStateKey); |
138 | 140 |
139 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); | 141 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); |
140 CreateTestPages(context); | 142 CreateTestPages(context); |
141 } | 143 } |
142 | 144 |
143 void StartAthenaSession(athena::ActivityFactory* activity_factory, | 145 void StartAthenaSession(athena::ActivityFactory* activity_factory, |
144 athena::AppModelBuilder* app_model_builder) { | 146 athena::AppModelBuilder* app_model_builder) { |
145 DCHECK(!session_started); | 147 DCHECK(!session_started); |
146 session_started = true; | 148 session_started = true; |
147 athena::HomeCard::Create(app_model_builder); | 149 athena::HomeCard::Create(app_model_builder); |
148 athena::ActivityManager::Create(); | 150 athena::ActivityManager::Create(); |
149 athena::ResourceManager::Create(); | 151 athena::ResourceManager::Create(); |
150 athena::ActivityFactory::RegisterActivityFactory(activity_factory); | 152 athena::ActivityFactory::RegisterActivityFactory(activity_factory); |
151 } | 153 } |
152 | 154 |
153 void ShutdownAthena() { | 155 void ShutdownAthena() { |
154 if (session_started) { | 156 if (session_started) { |
157 athena::ScreenLockManager::Shutdown(); | |
oshima
2014/10/13 18:52:20
please keep the reverse order of the creation orde
Dmitry Polukhin
2014/10/14 11:20:33
Done.
| |
155 athena::ActivityFactory::Shutdown(); | 158 athena::ActivityFactory::Shutdown(); |
156 athena::ResourceManager::Shutdown(); | 159 athena::ResourceManager::Shutdown(); |
157 athena::ActivityManager::Shutdown(); | 160 athena::ActivityManager::Shutdown(); |
158 athena::HomeCard::Shutdown(); | 161 athena::HomeCard::Shutdown(); |
159 athena::ExtensionsDelegate::Shutdown(); | 162 athena::ExtensionsDelegate::Shutdown(); |
160 session_started = false; | 163 session_started = false; |
161 } | 164 } |
162 athena::AppRegistry::ShutDown(); | 165 athena::AppRegistry::ShutDown(); |
163 athena::WindowManager::Shutdown(); | 166 athena::WindowManager::Shutdown(); |
164 athena::SystemUI::Shutdown(); | 167 athena::SystemUI::Shutdown(); |
165 athena::ScreenManager::Shutdown(); | 168 athena::ScreenManager::Shutdown(); |
166 athena::InputManager::Shutdown(); | 169 athena::InputManager::Shutdown(); |
167 athena::AthenaEnv::Shutdown(); | 170 athena::AthenaEnv::Shutdown(); |
168 | 171 |
169 ShutdownAthenaViewsDelegate(); | 172 ShutdownAthenaViewsDelegate(); |
170 } | 173 } |
171 | 174 |
172 } // namespace athena | 175 } // namespace athena |
OLD | NEW |