| 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" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 private: | 84 private: |
| 85 // views::ViewsDelegate: | 85 // views::ViewsDelegate: |
| 86 virtual void OnBeforeWidgetInit( | 86 virtual void OnBeforeWidgetInit( |
| 87 views::Widget::InitParams* params, | 87 views::Widget::InitParams* params, |
| 88 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { | 88 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { |
| 89 } | 89 } |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); | 91 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 void StartAthenaEnv(aura::Window* root_window) { | 94 void StartAthenaEnv(aura::Window* root_window, |
| 95 athena::ScreenManagerDelegate* delegate) { |
| 95 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 96 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 96 | 97 |
| 97 // Force showing in the experimental app-list view. | 98 // Force showing in the experimental app-list view. |
| 98 command_line->AppendSwitch(app_list::switches::kEnableExperimentalAppList); | 99 command_line->AppendSwitch(app_list::switches::kEnableExperimentalAppList); |
| 99 command_line->AppendSwitch(switches::kEnableOverlayScrollbar); | 100 command_line->AppendSwitch(switches::kEnableOverlayScrollbar); |
| 100 | 101 |
| 101 #if defined(USE_X11) | 102 #if defined(USE_X11) |
| 102 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 103 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
| 103 #endif | 104 #endif |
| 104 | 105 |
| 105 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); | 106 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); |
| 106 | 107 |
| 107 AthenaEnvState* env_state = new AthenaEnvState; | 108 AthenaEnvState* env_state = new AthenaEnvState; |
| 108 | 109 |
| 109 // Setup VisibilityClient | 110 // Setup VisibilityClient |
| 110 env_state->visibility_client.reset(new ::wm::VisibilityController); | 111 env_state->visibility_client.reset(new ::wm::VisibilityController); |
| 111 | 112 |
| 112 aura::client::SetVisibilityClient(root_window, | 113 aura::client::SetVisibilityClient(root_window, |
| 113 env_state->visibility_client.get()); | 114 env_state->visibility_client.get()); |
| 114 | 115 |
| 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::InputManager::Create()->OnRootWindowCreated(root_window); |
| 119 athena::ScreenManager::Create(root_window); | 120 athena::ScreenManager::Create(delegate, 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) { |
| 128 StartAthenaSession(new athena::ContentActivityFactory(), | 129 StartAthenaSession(new athena::ContentActivityFactory(), |
| 129 new athena::ContentAppModelBuilder(context)); | 130 new athena::ContentAppModelBuilder(context)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 152 athena::HomeCard::Shutdown(); | 153 athena::HomeCard::Shutdown(); |
| 153 athena::WindowManager::Shutdown(); | 154 athena::WindowManager::Shutdown(); |
| 154 athena::ScreenManager::Shutdown(); | 155 athena::ScreenManager::Shutdown(); |
| 155 athena::InputManager::Shutdown(); | 156 athena::InputManager::Shutdown(); |
| 156 athena::SystemUI::Shutdown(); | 157 athena::SystemUI::Shutdown(); |
| 157 | 158 |
| 158 delete views::ViewsDelegate::views_delegate; | 159 delete views::ViewsDelegate::views_delegate; |
| 159 } | 160 } |
| 160 | 161 |
| 161 } // namespace athena | 162 } // namespace athena |
| OLD | NEW |