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

Unified Diff: athena/main/athena_launcher.cc

Issue 549453005: Run athena on device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | athena/wm/window_list_provider_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/athena_launcher.cc
diff --git a/athena/main/athena_launcher.cc b/athena/main/athena_launcher.cc
index a553997b92000ebfffb6e2d0e229fd36f282accc..e85975d18f7f1dbe4efdc845c03769717cbca697 100644
--- a/athena/main/athena_launcher.cc
+++ b/athena/main/athena_launcher.cc
@@ -44,6 +44,12 @@ DECLARE_WINDOW_PROPERTY_TYPE(athena::AthenaEnvState*);
namespace athena {
+namespace {
+
+bool session_started = false;
+
+} // namespace
+
class VirtualKeyboardObserver;
// Athena's env state.
@@ -131,6 +137,8 @@ void StartAthenaSessionWithContext(content::BrowserContext* context) {
void StartAthenaSession(athena::ActivityFactory* activity_factory,
athena::AppModelBuilder* app_model_builder) {
+ DCHECK(!session_started);
+ session_started = true;
athena::HomeCard::Create(app_model_builder);
athena::ActivityManager::Create();
athena::ResourceManager::Create();
@@ -138,10 +146,13 @@ void StartAthenaSession(athena::ActivityFactory* activity_factory,
}
void ShutdownAthena() {
- athena::ActivityFactory::Shutdown();
- athena::ResourceManager::Shutdown();
- athena::ActivityManager::Shutdown();
- athena::HomeCard::Shutdown();
+ if (session_started) {
+ athena::ActivityFactory::Shutdown();
+ athena::ResourceManager::Shutdown();
+ athena::ActivityManager::Shutdown();
+ athena::HomeCard::Shutdown();
+ session_started = false;
+ }
athena::AppRegistry::ShutDown();
athena::WindowManager::Shutdown();
athena::SystemUI::Shutdown();
« no previous file with comments | « ash/shell.cc ('k') | athena/wm/window_list_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698