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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 athena::InputManager::Create()->OnRootWindowCreated(root_window); | 120 athena::InputManager::Create()->OnRootWindowCreated(root_window); |
120 athena::ScreenManager::Create(delegate, root_window); | 121 athena::ScreenManager::Create(delegate, root_window); |
121 athena::WindowManager::Create(); | 122 athena::WindowManager::Create(); |
122 SetupBackgroundImage(); | 123 SetupBackgroundImage(); |
123 | 124 |
124 athena::ScreenManager::Get()->GetContext()->SetProperty( | 125 athena::ScreenManager::Get()->GetContext()->SetProperty( |
125 kAthenaEnvStateKey, env_state); | 126 kAthenaEnvStateKey, env_state); |
126 } | 127 } |
127 | 128 |
128 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 129 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
130 athena::ExtensionsDelegate::CreateExtensionsDelegateForShell(context); | |
129 StartAthenaSession(new athena::ContentActivityFactory(), | 131 StartAthenaSession(new athena::ContentActivityFactory(), |
130 new athena::ContentAppModelBuilder(context)); | 132 new athena::ContentAppModelBuilder(context)); |
131 athena::VirtualKeyboardManager::Create(context); | 133 athena::VirtualKeyboardManager::Create(context); |
132 athena::HomeCard::Get()->RegisterSearchProvider( | 134 athena::HomeCard::Get()->RegisterSearchProvider( |
133 new athena::UrlSearchProvider(context)); | 135 new athena::UrlSearchProvider(context)); |
134 AthenaEnvState* env_state = | 136 AthenaEnvState* env_state = |
135 athena::ScreenManager::Get()->GetContext()->GetProperty( | 137 athena::ScreenManager::Get()->GetContext()->GetProperty( |
136 kAthenaEnvStateKey); | 138 kAthenaEnvStateKey); |
137 | 139 |
138 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); | 140 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); |
139 CreateTestPages(context); | 141 CreateTestPages(context); |
140 CreateDebugWindow(); | 142 CreateDebugWindow(); |
141 } | 143 } |
142 | 144 |
143 void StartAthenaSession(athena::ActivityFactory* activity_factory, | 145 void StartAthenaSession(athena::ActivityFactory* activity_factory, |
Jun Mukai
2014/08/22 16:53:55
So far, StartAthenaSession() is used for tests onl
oshima
2014/08/22 17:06:23
You're right. I moved it to athena_test_helper.
| |
144 athena::AppModelBuilder* app_model_builder) { | 146 athena::AppModelBuilder* app_model_builder) { |
147 athena::ExtensionsDelegate::CreateExtensionsDelegateForTest(); | |
145 athena::HomeCard::Create(app_model_builder); | 148 athena::HomeCard::Create(app_model_builder); |
146 athena::ActivityManager::Create(); | 149 athena::ActivityManager::Create(); |
147 athena::ActivityFactory::RegisterActivityFactory(activity_factory); | 150 athena::ActivityFactory::RegisterActivityFactory(activity_factory); |
148 } | 151 } |
149 | 152 |
150 void ShutdownAthena() { | 153 void ShutdownAthena() { |
151 athena::ActivityFactory::Shutdown(); | 154 athena::ActivityFactory::Shutdown(); |
152 athena::ActivityManager::Shutdown(); | 155 athena::ActivityManager::Shutdown(); |
153 athena::HomeCard::Shutdown(); | 156 athena::HomeCard::Shutdown(); |
154 athena::WindowManager::Shutdown(); | 157 athena::WindowManager::Shutdown(); |
155 athena::ScreenManager::Shutdown(); | 158 athena::ScreenManager::Shutdown(); |
156 athena::InputManager::Shutdown(); | 159 athena::InputManager::Shutdown(); |
157 athena::SystemUI::Shutdown(); | 160 athena::SystemUI::Shutdown(); |
161 athena::ExtensionsDelegate::Shutdown(); | |
158 | 162 |
159 delete views::ViewsDelegate::views_delegate; | 163 delete views::ViewsDelegate::views_delegate; |
160 } | 164 } |
161 | 165 |
162 } // namespace athena | 166 } // namespace athena |
OLD | NEW |