| 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/app_registry.h" | 9 #include "athena/content/public/app_registry.h" |
| 10 #include "athena/content/public/content_activity_factory.h" | 10 #include "athena/content/public/content_activity_factory.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 class AthenaViewsDelegate : public views::ViewsDelegate { | 82 class AthenaViewsDelegate : public views::ViewsDelegate { |
| 83 public: | 83 public: |
| 84 AthenaViewsDelegate() {} | 84 AthenaViewsDelegate() {} |
| 85 virtual ~AthenaViewsDelegate() {} | 85 virtual ~AthenaViewsDelegate() {} |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 // views::ViewsDelegate: | 88 // views::ViewsDelegate: |
| 89 virtual void OnBeforeWidgetInit( | 89 virtual void OnBeforeWidgetInit( |
| 90 views::Widget::InitParams* params, | 90 views::Widget::InitParams* params, |
| 91 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { | 91 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { |
| 92 params->context = athena::ScreenManager::Get()->GetContext(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); | 95 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 void StartAthenaEnv(scoped_refptr<base::TaskRunner> file_runner) { | 98 void StartAthenaEnv(scoped_refptr<base::TaskRunner> file_runner) { |
| 98 athena::AthenaEnv::Create(); | 99 athena::AthenaEnv::Create(); |
| 99 | 100 |
| 100 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 101 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 101 | 102 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 123 athena::ScreenManager::Create(root_window); | 124 athena::ScreenManager::Create(root_window); |
| 124 athena::WindowManager::Create(); | 125 athena::WindowManager::Create(); |
| 125 athena::AppRegistry::Create(); | 126 athena::AppRegistry::Create(); |
| 126 SetupBackgroundImage(); | 127 SetupBackgroundImage(); |
| 127 | 128 |
| 128 athena::ScreenManager::Get()->GetContext()->SetProperty( | 129 athena::ScreenManager::Get()->GetContext()->SetProperty( |
| 129 kAthenaEnvStateKey, env_state); | 130 kAthenaEnvStateKey, env_state); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void StartAthenaSessionWithContext(content::BrowserContext* context) { | 133 void StartAthenaSessionWithContext(content::BrowserContext* context) { |
| 133 athena::ExtensionsDelegate::CreateExtensionsDelegateForShell(context); | |
| 134 StartAthenaSession(new athena::ContentActivityFactory(), | 134 StartAthenaSession(new athena::ContentActivityFactory(), |
| 135 new athena::ContentAppModelBuilder(context)); | 135 new athena::ContentAppModelBuilder(context)); |
| 136 athena::VirtualKeyboardManager::Create(context); | 136 athena::VirtualKeyboardManager::Create(context); |
| 137 athena::HomeCard::Get()->RegisterSearchProvider( | 137 athena::HomeCard::Get()->RegisterSearchProvider( |
| 138 new athena::UrlSearchProvider(context)); | 138 new athena::UrlSearchProvider(context)); |
| 139 AthenaEnvState* env_state = | 139 AthenaEnvState* env_state = |
| 140 athena::ScreenManager::Get()->GetContext()->GetProperty( | 140 athena::ScreenManager::Get()->GetContext()->GetProperty( |
| 141 kAthenaEnvStateKey); | 141 kAthenaEnvStateKey); |
| 142 | 142 |
| 143 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); | 143 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 161 athena::ScreenManager::Shutdown(); | 161 athena::ScreenManager::Shutdown(); |
| 162 athena::InputManager::Shutdown(); | 162 athena::InputManager::Shutdown(); |
| 163 athena::SystemUI::Shutdown(); | 163 athena::SystemUI::Shutdown(); |
| 164 athena::ExtensionsDelegate::Shutdown(); | 164 athena::ExtensionsDelegate::Shutdown(); |
| 165 athena::AthenaEnv::Shutdown(); | 165 athena::AthenaEnv::Shutdown(); |
| 166 | 166 |
| 167 delete views::ViewsDelegate::views_delegate; | 167 delete views::ViewsDelegate::views_delegate; |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace athena | 170 } // namespace athena |
| OLD | NEW |