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/home/public/home_card.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/input/public/input_manager.h" | 13 #include "athena/input/public/input_manager.h" |
14 #include "athena/main/debug/debug_window.h" | |
15 #include "athena/main/placeholder.h" | 14 #include "athena/main/placeholder.h" |
16 #include "athena/main/placeholder.h" | 15 #include "athena/main/placeholder.h" |
17 #include "athena/main/url_search_provider.h" | 16 #include "athena/main/url_search_provider.h" |
18 #include "athena/screen/public/screen_manager.h" | 17 #include "athena/screen/public/screen_manager.h" |
19 #include "athena/screen/public/screen_manager.h" | 18 #include "athena/screen/public/screen_manager.h" |
20 #include "athena/system/public/system_ui.h" | 19 #include "athena/system/public/system_ui.h" |
21 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" | 20 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
22 #include "athena/wm/public/window_manager.h" | 21 #include "athena/wm/public/window_manager.h" |
23 #include "base/command_line.h" | 22 #include "base/command_line.h" |
24 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); | 104 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); |
106 | 105 |
107 AthenaEnvState* env_state = new AthenaEnvState; | 106 AthenaEnvState* env_state = new AthenaEnvState; |
108 | 107 |
109 // Setup VisibilityClient | 108 // Setup VisibilityClient |
110 env_state->visibility_client.reset(new ::wm::VisibilityController); | 109 env_state->visibility_client.reset(new ::wm::VisibilityController); |
111 | 110 |
112 aura::client::SetVisibilityClient(root_window, | 111 aura::client::SetVisibilityClient(root_window, |
113 env_state->visibility_client.get()); | 112 env_state->visibility_client.get()); |
114 | 113 |
| 114 athena::InputManager::Create()->OnRootWindowCreated(root_window); |
| 115 athena::ScreenManager::Create(root_window); |
115 athena::SystemUI::Create( | 116 athena::SystemUI::Create( |
116 content::BrowserThread::GetMessageLoopProxyForThread( | 117 content::BrowserThread::GetMessageLoopProxyForThread( |
117 content::BrowserThread::FILE)); | 118 content::BrowserThread::FILE)); |
118 athena::InputManager::Create()->OnRootWindowCreated(root_window); | |
119 athena::ScreenManager::Create(root_window); | |
120 athena::WindowManager::Create(); | 119 athena::WindowManager::Create(); |
121 SetupBackgroundImage(); | 120 SetupBackgroundImage(); |
122 | 121 |
123 athena::ScreenManager::Get()->GetContext()->SetProperty( | 122 athena::ScreenManager::Get()->GetContext()->SetProperty( |
124 kAthenaEnvStateKey, env_state); | 123 kAthenaEnvStateKey, env_state); |
125 } | 124 } |
126 | 125 |
127 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 126 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
128 StartAthenaSession(new athena::ContentActivityFactory(), | 127 StartAthenaSession(new athena::ContentActivityFactory(), |
129 new athena::ContentAppModelBuilder(context)); | 128 new athena::ContentAppModelBuilder(context)); |
130 athena::VirtualKeyboardManager::Create(context); | 129 athena::VirtualKeyboardManager::Create(context); |
131 athena::HomeCard::Get()->RegisterSearchProvider( | 130 athena::HomeCard::Get()->RegisterSearchProvider( |
132 new athena::UrlSearchProvider(context)); | 131 new athena::UrlSearchProvider(context)); |
133 AthenaEnvState* env_state = | 132 AthenaEnvState* env_state = |
134 athena::ScreenManager::Get()->GetContext()->GetProperty( | 133 athena::ScreenManager::Get()->GetContext()->GetProperty( |
135 kAthenaEnvStateKey); | 134 kAthenaEnvStateKey); |
136 | 135 |
137 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); | 136 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); |
138 CreateTestPages(context); | 137 CreateTestPages(context); |
139 CreateDebugWindow(); | |
140 } | 138 } |
141 | 139 |
142 void StartAthenaSession(athena::ActivityFactory* activity_factory, | 140 void StartAthenaSession(athena::ActivityFactory* activity_factory, |
143 athena::AppModelBuilder* app_model_builder) { | 141 athena::AppModelBuilder* app_model_builder) { |
144 athena::HomeCard::Create(app_model_builder); | 142 athena::HomeCard::Create(app_model_builder); |
145 athena::ActivityManager::Create(); | 143 athena::ActivityManager::Create(); |
146 athena::ActivityFactory::RegisterActivityFactory(activity_factory); | 144 athena::ActivityFactory::RegisterActivityFactory(activity_factory); |
147 } | 145 } |
148 | 146 |
149 void ShutdownAthena() { | 147 void ShutdownAthena() { |
150 athena::ActivityFactory::Shutdown(); | 148 athena::ActivityFactory::Shutdown(); |
151 athena::ActivityManager::Shutdown(); | 149 athena::ActivityManager::Shutdown(); |
152 athena::HomeCard::Shutdown(); | 150 athena::HomeCard::Shutdown(); |
153 athena::WindowManager::Shutdown(); | 151 athena::WindowManager::Shutdown(); |
| 152 athena::SystemUI::Shutdown(); |
154 athena::ScreenManager::Shutdown(); | 153 athena::ScreenManager::Shutdown(); |
155 athena::InputManager::Shutdown(); | 154 athena::InputManager::Shutdown(); |
156 athena::SystemUI::Shutdown(); | |
157 | 155 |
158 delete views::ViewsDelegate::views_delegate; | 156 delete views::ViewsDelegate::views_delegate; |
159 } | 157 } |
160 | 158 |
161 } // namespace athena | 159 } // namespace athena |
OLD | NEW |