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/athena_launcher.h" | 5 #include "athena/main/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/content_activity_factory.h" | 9 #include "athena/content/public/content_activity_factory.h" |
10 #include "athena/content/public/content_app_model_builder.h" | 10 #include "athena/content/public/content_app_model_builder.h" |
| 11 #include "athena/extensions/public/extensions_delegate.h" |
11 #include "athena/home/public/home_card.h" | 12 #include "athena/home/public/home_card.h" |
12 #include "athena/home/public/home_card.h" | 13 #include "athena/home/public/home_card.h" |
13 #include "athena/input/public/input_manager.h" | 14 #include "athena/input/public/input_manager.h" |
14 #include "athena/main/debug/debug_window.h" | 15 #include "athena/main/debug/debug_window.h" |
15 #include "athena/main/placeholder.h" | 16 #include "athena/main/placeholder.h" |
16 #include "athena/main/placeholder.h" | 17 #include "athena/main/placeholder.h" |
17 #include "athena/main/url_search_provider.h" | 18 #include "athena/main/url_search_provider.h" |
18 #include "athena/screen/public/screen_manager.h" | 19 #include "athena/screen/public/screen_manager.h" |
19 #include "athena/screen/public/screen_manager.h" | 20 #include "athena/screen/public/screen_manager.h" |
20 #include "athena/system/public/system_ui.h" | 21 #include "athena/system/public/system_ui.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 athena::InputManager::Create()->OnRootWindowCreated(root_window); | 119 athena::InputManager::Create()->OnRootWindowCreated(root_window); |
119 athena::ScreenManager::Create(root_window); | 120 athena::ScreenManager::Create(root_window); |
120 athena::WindowManager::Create(); | 121 athena::WindowManager::Create(); |
121 SetupBackgroundImage(); | 122 SetupBackgroundImage(); |
122 | 123 |
123 athena::ScreenManager::Get()->GetContext()->SetProperty( | 124 athena::ScreenManager::Get()->GetContext()->SetProperty( |
124 kAthenaEnvStateKey, env_state); | 125 kAthenaEnvStateKey, env_state); |
125 } | 126 } |
126 | 127 |
127 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 128 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
| 129 athena::ExtensionsDelegate::InitExtensionsDelegateForShell(context); |
128 StartAthenaSession(new athena::ContentActivityFactory(), | 130 StartAthenaSession(new athena::ContentActivityFactory(), |
129 new athena::ContentAppModelBuilder(context)); | 131 new athena::ContentAppModelBuilder(context)); |
130 athena::VirtualKeyboardManager::Create(context); | 132 athena::VirtualKeyboardManager::Create(context); |
131 athena::HomeCard::Get()->RegisterSearchProvider( | 133 athena::HomeCard::Get()->RegisterSearchProvider( |
132 new athena::UrlSearchProvider(context)); | 134 new athena::UrlSearchProvider(context)); |
133 AthenaEnvState* env_state = | 135 AthenaEnvState* env_state = |
134 athena::ScreenManager::Get()->GetContext()->GetProperty( | 136 athena::ScreenManager::Get()->GetContext()->GetProperty( |
135 kAthenaEnvStateKey); | 137 kAthenaEnvStateKey); |
136 | 138 |
137 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); | 139 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); |
138 CreateTestPages(context); | 140 CreateTestPages(context); |
139 CreateDebugWindow(); | 141 CreateDebugWindow(); |
140 } | 142 } |
141 | 143 |
142 void StartAthenaSession(athena::ActivityFactory* activity_factory, | 144 void StartAthenaSession(athena::ActivityFactory* activity_factory, |
143 athena::AppModelBuilder* app_model_builder) { | 145 athena::AppModelBuilder* app_model_builder) { |
144 athena::HomeCard::Create(app_model_builder); | 146 athena::HomeCard::Create(app_model_builder); |
145 athena::ActivityManager::Create(); | 147 athena::ActivityManager::Create(); |
146 athena::ActivityFactory::RegisterActivityFactory(activity_factory); | 148 athena::ActivityFactory::RegisterActivityFactory(activity_factory); |
147 } | 149 } |
148 | 150 |
149 void ShutdownAthena() { | 151 void ShutdownAthena() { |
150 athena::ActivityFactory::Shutdown(); | 152 athena::ActivityFactory::Shutdown(); |
151 athena::ActivityManager::Shutdown(); | 153 athena::ActivityManager::Shutdown(); |
152 athena::HomeCard::Shutdown(); | 154 athena::HomeCard::Shutdown(); |
153 athena::WindowManager::Shutdown(); | 155 athena::WindowManager::Shutdown(); |
154 athena::ScreenManager::Shutdown(); | 156 athena::ScreenManager::Shutdown(); |
155 athena::InputManager::Shutdown(); | 157 athena::InputManager::Shutdown(); |
156 athena::SystemUI::Shutdown(); | 158 athena::SystemUI::Shutdown(); |
| 159 athena::ExtensionsDelegate::Shutdown(); |
157 | 160 |
158 delete views::ViewsDelegate::views_delegate; | 161 delete views::ViewsDelegate::views_delegate; |
159 } | 162 } |
160 | 163 |
161 } // namespace athena | 164 } // namespace athena |
OLD | NEW |