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/app_mode/kiosk_app_launcher.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" | 11 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" |
12 #include "chrome/browser/chromeos/cros/cert_library.h" | |
13 #include "chrome/browser/chromeos/cros/cros_library.h" | |
14 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 12 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
15 #include "chrome/browser/chromeos/login/login_utils.h" | 13 #include "chrome/browser/chromeos/login/login_utils.h" |
16 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 15 #include "chrome/browser/lifetime/application_lifetime.h" |
18 #include "chromeos/cryptohome/async_method_caller.h" | 16 #include "chromeos/cryptohome/async_method_caller.h" |
| 17 #include "chromeos/cryptohome/cryptohome_library.h" |
19 #include "chromeos/dbus/cryptohome_client.h" | 18 #include "chromeos/dbus/cryptohome_client.h" |
20 #include "chromeos/dbus/dbus_thread_manager.h" | 19 #include "chromeos/dbus/dbus_thread_manager.h" |
21 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
22 | 21 |
23 using content::BrowserThread; | 22 using content::BrowserThread; |
24 | 23 |
25 namespace chromeos { | 24 namespace chromeos { |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Saves the error and ends the session to go back to login screen. | 170 // Saves the error and ends the session to go back to login screen. |
172 KioskAppLaunchError::Save(error); | 171 KioskAppLaunchError::Save(error); |
173 chrome::AttemptUserExit(); | 172 chrome::AttemptUserExit(); |
174 } | 173 } |
175 | 174 |
176 delete this; | 175 delete this; |
177 } | 176 } |
178 | 177 |
179 void KioskAppLauncher::StartMount() { | 178 void KioskAppLauncher::StartMount() { |
180 const std::string token = | 179 const std::string token = |
181 CrosLibrary::Get()->GetCertLibrary()->EncryptWithSystemSalt(app_id_); | 180 CryptohomeLibrary::Get()->EncryptWithSystemSalt(app_id_); |
182 | 181 |
183 cryptohome::AsyncMethodCaller::GetInstance()->AsyncMount( | 182 cryptohome::AsyncMethodCaller::GetInstance()->AsyncMount( |
184 app_id_, | 183 app_id_, |
185 token, | 184 token, |
186 cryptohome::CREATE_IF_MISSING, | 185 cryptohome::CREATE_IF_MISSING, |
187 base::Bind(&KioskAppLauncher::MountCallback, | 186 base::Bind(&KioskAppLauncher::MountCallback, |
188 base::Unretained(this))); | 187 base::Unretained(this))); |
189 } | 188 } |
190 | 189 |
191 void KioskAppLauncher::MountCallback(bool mount_success, | 190 void KioskAppLauncher::MountCallback(bool mount_success, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 (new chromeos::StartupAppLauncher(profile, app_id_))->Start(); | 231 (new chromeos::StartupAppLauncher(profile, app_id_))->Start(); |
233 | 232 |
234 if (LoginDisplayHostImpl::default_host()) | 233 if (LoginDisplayHostImpl::default_host()) |
235 LoginDisplayHostImpl::default_host()->OnSessionStart(); | 234 LoginDisplayHostImpl::default_host()->OnSessionStart(); |
236 UserManager::Get()->SessionStarted(); | 235 UserManager::Get()->SessionStarted(); |
237 | 236 |
238 ReportLaunchResult(KioskAppLaunchError::NONE); | 237 ReportLaunchResult(KioskAppLaunchError::NONE); |
239 } | 238 } |
240 | 239 |
241 } // namespace chromeos | 240 } // namespace chromeos |
OLD | NEW |