| 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/apps_search_controller_factory.h" | 12 #include "athena/extensions/public/apps_search_controller_factory.h" |
| 13 #include "athena/extensions/public/extension_app_model_builder.h" | 13 #include "athena/extensions/public/extension_app_model_builder.h" |
| 14 #include "athena/extensions/public/extensions_delegate.h" | 14 #include "athena/extensions/public/extensions_delegate.h" |
| 15 #include "athena/home/public/home_card.h" | 15 #include "athena/home/public/home_card.h" |
| 16 #include "athena/home/public/search_controller_factory.h" | 16 #include "athena/home/public/search_controller_factory.h" |
| 17 #include "athena/input/public/input_manager.h" | 17 #include "athena/input/public/input_manager.h" |
| 18 #include "athena/main/athena_views_delegate.h" | 18 #include "athena/main/athena_views_delegate.h" |
| 19 #include "athena/main/debug_accelerator_handler.h" |
| 19 #include "athena/main/placeholder.h" | 20 #include "athena/main/placeholder.h" |
| 20 #include "athena/main/placeholder.h" | 21 #include "athena/main/placeholder.h" |
| 21 #include "athena/resource_manager/public/resource_manager.h" | 22 #include "athena/resource_manager/public/resource_manager.h" |
| 22 #include "athena/screen/public/screen_manager.h" | 23 #include "athena/screen/public/screen_manager.h" |
| 23 #include "athena/screen_lock/public/screen_lock_manager.h" | 24 #include "athena/screen_lock/public/screen_lock_manager.h" |
| 24 #include "athena/system/public/system_ui.h" | 25 #include "athena/system/public/system_ui.h" |
| 25 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" | 26 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
| 26 #include "athena/wm/public/window_manager.h" | 27 #include "athena/wm/public/window_manager.h" |
| 27 #include "base/command_line.h" | 28 #include "base/command_line.h" |
| 28 #include "base/memory/scoped_ptr.h" | 29 #include "base/memory/scoped_ptr.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 bool session_started = false; | 53 bool session_started = false; |
| 53 | 54 |
| 54 } // namespace | 55 } // namespace |
| 55 | 56 |
| 56 class VirtualKeyboardObserver; | 57 class VirtualKeyboardObserver; |
| 57 | 58 |
| 58 // Athena's env state. | 59 // Athena's env state. |
| 59 struct AthenaEnvState { | 60 struct AthenaEnvState { |
| 60 scoped_ptr< ::wm::VisibilityController> visibility_client; | 61 scoped_ptr< ::wm::VisibilityController> visibility_client; |
| 61 scoped_ptr<VirtualKeyboardObserver> virtual_keyboard_observer; | 62 scoped_ptr<VirtualKeyboardObserver> virtual_keyboard_observer; |
| 63 scoped_ptr<DebugAcceleratorHandler> debug_accelerator_handler; |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 DEFINE_OWNED_WINDOW_PROPERTY_KEY(athena::AthenaEnvState, | 66 DEFINE_OWNED_WINDOW_PROPERTY_KEY(athena::AthenaEnvState, |
| 65 kAthenaEnvStateKey, | 67 kAthenaEnvStateKey, |
| 66 nullptr); | 68 nullptr); |
| 67 | 69 |
| 68 // This class observes the change of the virtual keyboard and distribute the | 70 // This class observes the change of the virtual keyboard and distribute the |
| 69 // change to appropriate modules of athena. | 71 // change to appropriate modules of athena. |
| 70 // TODO(oshima): move the VK bounds logic to screen manager. | 72 // TODO(oshima): move the VK bounds logic to screen manager. |
| 71 class VirtualKeyboardObserver : public keyboard::KeyboardControllerObserver { | 73 class VirtualKeyboardObserver : public keyboard::KeyboardControllerObserver { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 aura::client::SetVisibilityClient(root_window, | 115 aura::client::SetVisibilityClient(root_window, |
| 114 env_state->visibility_client.get()); | 116 env_state->visibility_client.get()); |
| 115 | 117 |
| 116 athena::InputManager::Create()->OnRootWindowCreated(root_window); | 118 athena::InputManager::Create()->OnRootWindowCreated(root_window); |
| 117 athena::ScreenManager::Create(root_window); | 119 athena::ScreenManager::Create(root_window); |
| 118 athena::WindowManager::Create(); | 120 athena::WindowManager::Create(); |
| 119 athena::SystemUI::Create(blocking_task_runner); | 121 athena::SystemUI::Create(blocking_task_runner); |
| 120 athena::AppRegistry::Create(); | 122 athena::AppRegistry::Create(); |
| 121 SetupBackgroundImage(); | 123 SetupBackgroundImage(); |
| 122 | 124 |
| 125 env_state->debug_accelerator_handler.reset( |
| 126 new DebugAcceleratorHandler(root_window)); |
| 127 |
| 123 athena::ScreenManager::Get()->GetContext()->SetProperty( | 128 athena::ScreenManager::Get()->GetContext()->SetProperty( |
| 124 kAthenaEnvStateKey, env_state); | 129 kAthenaEnvStateKey, env_state); |
| 125 } | 130 } |
| 126 | 131 |
| 127 void CreateVirtualKeyboardWithContext(content::BrowserContext* context) { | 132 void CreateVirtualKeyboardWithContext(content::BrowserContext* context) { |
| 128 athena::VirtualKeyboardManager::Create(context); | 133 athena::VirtualKeyboardManager::Create(context); |
| 129 } | 134 } |
| 130 | 135 |
| 131 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 136 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
| 132 athena::ScreenLockManager::Create(); | 137 athena::ScreenLockManager::Create(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 athena::SystemUI::Shutdown(); | 174 athena::SystemUI::Shutdown(); |
| 170 athena::WindowManager::Shutdown(); | 175 athena::WindowManager::Shutdown(); |
| 171 athena::ScreenManager::Shutdown(); | 176 athena::ScreenManager::Shutdown(); |
| 172 athena::InputManager::Shutdown(); | 177 athena::InputManager::Shutdown(); |
| 173 athena::AthenaEnv::Shutdown(); | 178 athena::AthenaEnv::Shutdown(); |
| 174 | 179 |
| 175 ShutdownAthenaViewsDelegate(); | 180 ShutdownAthenaViewsDelegate(); |
| 176 } | 181 } |
| 177 | 182 |
| 178 } // namespace athena | 183 } // namespace athena |
| OLD | NEW |