| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/login/app_launch_controller.h" | 5 #include "chrome/browser/chromeos/login/app_launch_controller.h" |
| 6 | 6 |
| 7 #include "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
| 8 #include "apps/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/json/json_file_value_serializer.h" | 12 #include "base/json/json_file_value_serializer.h" |
| 13 #include "base/logging.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h" | 20 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h" |
| 20 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 21 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 21 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" | 22 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" |
| 22 #include "chrome/browser/chromeos/login/login_display_host.h" | 23 #include "chrome/browser/chromeos/login/login_display_host.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 136 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
| 136 content::NotificationService::AllSources()); | 137 content::NotificationService::AllSources()); |
| 137 } | 138 } |
| 138 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue(); | 139 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue(); |
| 139 | 140 |
| 140 // TODO(tengs): Add a loading profile app launch state. | 141 // TODO(tengs): Add a loading profile app launch state. |
| 141 app_launch_splash_screen_actor_->SetDelegate(this); | 142 app_launch_splash_screen_actor_->SetDelegate(this); |
| 142 app_launch_splash_screen_actor_->Show(app_id_); | 143 app_launch_splash_screen_actor_->Show(app_id_); |
| 143 | 144 |
| 144 KioskAppManager::App app; | 145 KioskAppManager::App app; |
| 145 CHECK(KioskAppManager::Get() && | 146 CHECK(KioskAppManager::Get()); |
| 146 KioskAppManager::Get()->GetApp(app_id_, &app)); | 147 CHECK(KioskAppManager::Get()->GetApp(app_id_, &app)); |
| 147 kiosk_profile_loader_.reset( | 148 kiosk_profile_loader_.reset( |
| 148 new KioskProfileLoader(app.user_id, false, this)); | 149 new KioskProfileLoader(app.user_id, false, this)); |
| 149 kiosk_profile_loader_->Start(); | 150 kiosk_profile_loader_->Start(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 // static | 153 // static |
| 153 void AppLaunchController::SkipSplashWaitForTesting() { | 154 void AppLaunchController::SkipSplashWaitForTesting() { |
| 154 skip_splash_wait_ = true; | 155 skip_splash_wait_ = true; |
| 155 } | 156 } |
| 156 | 157 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 << ", error=" << error; | 398 << ", error=" << error; |
| 398 DCHECK_NE(KioskAppLaunchError::NONE, error); | 399 DCHECK_NE(KioskAppLaunchError::NONE, error); |
| 399 | 400 |
| 400 // Saves the error and ends the session to go back to login screen. | 401 // Saves the error and ends the session to go back to login screen. |
| 401 KioskAppLaunchError::Save(error); | 402 KioskAppLaunchError::Save(error); |
| 402 chrome::AttemptUserExit(); | 403 chrome::AttemptUserExit(); |
| 403 CleanUp(); | 404 CleanUp(); |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace chromeos | 407 } // namespace chromeos |
| OLD | NEW |