Fixes for re-enabling more MSVC level 4 warnings: mojo/ edition
[chromium-blink-merge.git] / athena / main / athena_launcher.cc
blob5da92745ca6d3341ca24254c67bfc1f4f46c077d
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
3 // found in the LICENSE file.
5 #include "athena/main/athena_launcher.h"
7 #include "athena/activity/public/activity_factory.h"
8 #include "athena/activity/public/activity_manager.h"
9 #include "athena/home/public/home_card.h"
10 #include "athena/input/public/input_manager.h"
11 #include "athena/main/placeholder.h"
12 #include "athena/screen/public/screen_manager.h"
13 #include "athena/wm/public/window_manager.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "ui/aura/window_property.h"
16 #include "ui/wm/core/visibility_controller.h"
18 #if defined(USE_X11)
19 #include "ui/events/x/touch_factory_x11.h"
20 #endif
22 namespace athena {
23 struct RootWindowState;
26 DECLARE_WINDOW_PROPERTY_TYPE(athena::RootWindowState*);
28 namespace athena {
30 // Athena's per root window state.
31 struct RootWindowState {
32 scoped_ptr< ::wm::VisibilityController> visibility_client;
35 DEFINE_OWNED_WINDOW_PROPERTY_KEY(athena::RootWindowState,
36 kRootWindowStateKey,
37 NULL);
39 void StartAthena(aura::Window* root_window,
40 athena::ActivityFactory* activity_factory,
41 athena::AppModelBuilder* app_model_builder) {
42 #if defined(USE_X11)
43 ui::TouchFactory::SetTouchDeviceListFromCommandLine();
44 #endif
45 RootWindowState* root_window_state = new RootWindowState;
46 root_window->SetProperty(kRootWindowStateKey, root_window_state);
48 root_window_state->visibility_client.reset(new ::wm::VisibilityController);
49 aura::client::SetVisibilityClient(root_window,
50 root_window_state->visibility_client.get());
52 athena::InputManager::Create()->OnRootWindowCreated(root_window);
53 athena::ScreenManager::Create(root_window);
54 athena::WindowManager::Create();
55 athena::HomeCard::Create(app_model_builder);
56 athena::ActivityManager::Create();
57 athena::ActivityFactory::RegisterActivityFactory(activity_factory);
58 SetupBackgroundImage();
61 void ShutdownAthena() {
62 athena::ActivityFactory::Shutdown();
63 athena::ActivityManager::Shutdown();
64 athena::HomeCard::Shutdown();
65 athena::WindowManager::Shutdown();
66 athena::ScreenManager::Shutdown();
67 athena::InputManager::Shutdown();
70 } // namespace athena