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/home/public/home_card.h" | 9 #include "athena/home/public/home_card.h" |
10 #include "athena/input/public/input_manager.h" | 10 #include "athena/input/public/input_manager.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // views::ViewsDelegate: | 47 // views::ViewsDelegate: |
48 virtual void OnBeforeWidgetInit( | 48 virtual void OnBeforeWidgetInit( |
49 views::Widget::InitParams* params, | 49 views::Widget::InitParams* params, |
50 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { | 50 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { |
51 } | 51 } |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); | 53 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); |
54 }; | 54 }; |
55 | 55 |
56 void StartAthena(aura::Window* root_window, | 56 void StartAthena(aura::Window* root_window, |
| 57 athena::ScreenManagerDelegate* delegate, |
57 athena::ActivityFactory* activity_factory, | 58 athena::ActivityFactory* activity_factory, |
58 athena::AppModelBuilder* app_model_builder) { | 59 athena::AppModelBuilder* app_model_builder) { |
59 #if defined(USE_X11) | 60 #if defined(USE_X11) |
60 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 61 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
61 #endif | 62 #endif |
62 | 63 |
63 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); | 64 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate(); |
64 | 65 |
65 RootWindowState* root_window_state = new RootWindowState; | 66 RootWindowState* root_window_state = new RootWindowState; |
66 root_window->SetProperty(kRootWindowStateKey, root_window_state); | 67 root_window->SetProperty(kRootWindowStateKey, root_window_state); |
67 | 68 |
68 root_window_state->visibility_client.reset(new ::wm::VisibilityController); | 69 root_window_state->visibility_client.reset(new ::wm::VisibilityController); |
69 aura::client::SetVisibilityClient(root_window, | 70 aura::client::SetVisibilityClient(root_window, |
70 root_window_state->visibility_client.get()); | 71 root_window_state->visibility_client.get()); |
71 | 72 |
72 athena::SystemUI::Create(); | 73 athena::SystemUI::Create(); |
73 athena::InputManager::Create()->OnRootWindowCreated(root_window); | 74 athena::InputManager::Create()->OnRootWindowCreated(root_window); |
74 athena::ScreenManager::Create(root_window); | 75 athena::ScreenManager::Create(delegate, root_window); |
75 athena::WindowManager::Create(); | 76 athena::WindowManager::Create(); |
76 athena::HomeCard::Create(app_model_builder); | 77 athena::HomeCard::Create(app_model_builder); |
77 athena::ActivityManager::Create(); | 78 athena::ActivityManager::Create(); |
78 athena::ActivityFactory::RegisterActivityFactory(activity_factory); | 79 athena::ActivityFactory::RegisterActivityFactory(activity_factory); |
79 SetupBackgroundImage(); | 80 SetupBackgroundImage(); |
80 } | 81 } |
81 | 82 |
82 void ShutdownAthena() { | 83 void ShutdownAthena() { |
83 athena::ActivityFactory::Shutdown(); | 84 athena::ActivityFactory::Shutdown(); |
84 athena::ActivityManager::Shutdown(); | 85 athena::ActivityManager::Shutdown(); |
85 athena::HomeCard::Shutdown(); | 86 athena::HomeCard::Shutdown(); |
86 athena::WindowManager::Shutdown(); | 87 athena::WindowManager::Shutdown(); |
87 athena::ScreenManager::Shutdown(); | 88 athena::ScreenManager::Shutdown(); |
88 athena::InputManager::Shutdown(); | 89 athena::InputManager::Shutdown(); |
89 athena::SystemUI::Shutdown(); | 90 athena::SystemUI::Shutdown(); |
90 | 91 |
91 delete views::ViewsDelegate::views_delegate; | 92 delete views::ViewsDelegate::views_delegate; |
92 } | 93 } |
93 | 94 |
94 } // namespace athena | 95 } // namespace athena |
OLD | NEW |