Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: athena/main/athena_launcher.cc

Issue 498023003: Delete activity upon window deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reformat Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 class AthenaViewsDelegate : public views::ViewsDelegate { 80 class AthenaViewsDelegate : public views::ViewsDelegate {
81 public: 81 public:
82 AthenaViewsDelegate() {} 82 AthenaViewsDelegate() {}
83 virtual ~AthenaViewsDelegate() {} 83 virtual ~AthenaViewsDelegate() {}
84 84
85 private: 85 private:
86 // views::ViewsDelegate: 86 // views::ViewsDelegate:
87 virtual void OnBeforeWidgetInit( 87 virtual void OnBeforeWidgetInit(
88 views::Widget::InitParams* params, 88 views::Widget::InitParams* params,
89 views::internal::NativeWidgetDelegate* delegate) OVERRIDE { 89 views::internal::NativeWidgetDelegate* delegate) OVERRIDE {
90 params->context = athena::ScreenManager::Get()->GetContext();
90 } 91 }
91 92
92 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate); 93 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate);
93 }; 94 };
94 95
95 void StartAthenaEnv(aura::Window* root_window, 96 void StartAthenaEnv(aura::Window* root_window,
96 athena::ScreenManagerDelegate* delegate, 97 athena::ScreenManagerDelegate* delegate,
97 scoped_refptr<base::TaskRunner> file_runner) { 98 scoped_refptr<base::TaskRunner> file_runner) {
98 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 99 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
99 100
(...skipping 20 matching lines...) Expand all
120 athena::ScreenManager::Create(delegate, root_window); 121 athena::ScreenManager::Create(delegate, root_window);
121 athena::WindowManager::Create(); 122 athena::WindowManager::Create();
122 athena::AppRegistry::Create(); 123 athena::AppRegistry::Create();
123 SetupBackgroundImage(); 124 SetupBackgroundImage();
124 125
125 athena::ScreenManager::Get()->GetContext()->SetProperty( 126 athena::ScreenManager::Get()->GetContext()->SetProperty(
126 kAthenaEnvStateKey, env_state); 127 kAthenaEnvStateKey, env_state);
127 } 128 }
128 129
129 void StartAthenaSessionWithContext(content::BrowserContext* context) { 130 void StartAthenaSessionWithContext(content::BrowserContext* context) {
130 athena::ExtensionsDelegate::CreateExtensionsDelegateForShell(context);
131 StartAthenaSession(new athena::ContentActivityFactory(), 131 StartAthenaSession(new athena::ContentActivityFactory(),
132 new athena::ContentAppModelBuilder(context)); 132 new athena::ContentAppModelBuilder(context));
133 athena::VirtualKeyboardManager::Create(context); 133 athena::VirtualKeyboardManager::Create(context);
134 athena::HomeCard::Get()->RegisterSearchProvider( 134 athena::HomeCard::Get()->RegisterSearchProvider(
135 new athena::UrlSearchProvider(context)); 135 new athena::UrlSearchProvider(context));
136 AthenaEnvState* env_state = 136 AthenaEnvState* env_state =
137 athena::ScreenManager::Get()->GetContext()->GetProperty( 137 athena::ScreenManager::Get()->GetContext()->GetProperty(
138 kAthenaEnvStateKey); 138 kAthenaEnvStateKey);
139 139
140 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver); 140 env_state->virtual_keyboard_observer.reset(new VirtualKeyboardObserver);
(...skipping 16 matching lines...) Expand all
157 athena::WindowManager::Shutdown(); 157 athena::WindowManager::Shutdown();
158 athena::ScreenManager::Shutdown(); 158 athena::ScreenManager::Shutdown();
159 athena::InputManager::Shutdown(); 159 athena::InputManager::Shutdown();
160 athena::SystemUI::Shutdown(); 160 athena::SystemUI::Shutdown();
161 athena::ExtensionsDelegate::Shutdown(); 161 athena::ExtensionsDelegate::Shutdown();
162 162
163 delete views::ViewsDelegate::views_delegate; 163 delete views::ViewsDelegate::views_delegate;
164 } 164 }
165 165
166 } // namespace athena 166 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698