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/app_window.h" | 7 #include "apps/app_window.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 135 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
135 content::NotificationService::AllSources()); | 136 content::NotificationService::AllSources()); |
136 } | 137 } |
137 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue(); | 138 launch_splash_start_time_ = base::TimeTicks::Now().ToInternalValue(); |
138 | 139 |
139 // TODO(tengs): Add a loading profile app launch state. | 140 // TODO(tengs): Add a loading profile app launch state. |
140 app_launch_splash_screen_actor_->SetDelegate(this); | 141 app_launch_splash_screen_actor_->SetDelegate(this); |
141 app_launch_splash_screen_actor_->Show(app_id_); | 142 app_launch_splash_screen_actor_->Show(app_id_); |
142 | 143 |
143 KioskAppManager::App app; | 144 KioskAppManager::App app; |
144 CHECK(KioskAppManager::Get() && | 145 CHECK(KioskAppManager::Get()); |
145 KioskAppManager::Get()->GetApp(app_id_, &app)); | 146 CHECK(KioskAppManager::Get()->GetApp(app_id_, &app)); |
146 kiosk_profile_loader_.reset( | 147 kiosk_profile_loader_.reset( |
147 new KioskProfileLoader(app.user_id, false, this)); | 148 new KioskProfileLoader(app.user_id, false, this)); |
148 kiosk_profile_loader_->Start(); | 149 kiosk_profile_loader_->Start(); |
149 } | 150 } |
150 | 151 |
151 // static | 152 // static |
152 void AppLaunchController::SkipSplashWaitForTesting() { | 153 void AppLaunchController::SkipSplashWaitForTesting() { |
153 skip_splash_wait_ = true; | 154 skip_splash_wait_ = true; |
154 } | 155 } |
155 | 156 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 << ", error=" << error; | 397 << ", error=" << error; |
397 DCHECK_NE(KioskAppLaunchError::NONE, error); | 398 DCHECK_NE(KioskAppLaunchError::NONE, error); |
398 | 399 |
399 // Saves the error and ends the session to go back to login screen. | 400 // Saves the error and ends the session to go back to login screen. |
400 KioskAppLaunchError::Save(error); | 401 KioskAppLaunchError::Save(error); |
401 chrome::AttemptUserExit(); | 402 chrome::AttemptUserExit(); |
402 CleanUp(); | 403 CleanUp(); |
403 } | 404 } |
404 | 405 |
405 } // namespace chromeos | 406 } // namespace chromeos |
OLD | NEW |