| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/chromeos/cros/cert_library.h" | 10 #include "chrome/browser/chromeos/cros/cert_library.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 running_instance_ = NULL; | 119 running_instance_ = NULL; |
| 120 success_ = success; | 120 success_ = success; |
| 121 | 121 |
| 122 if (!callback_.is_null()) | 122 if (!callback_.is_null()) |
| 123 callback_.Run(success_); | 123 callback_.Run(success_); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void KioskAppLauncher::StartMount() { | 126 void KioskAppLauncher::StartMount() { |
| 127 const std::string token = | 127 const std::string token = |
| 128 CrosLibrary::Get()->GetCertLibrary()->EncryptToken(app_id_); | 128 CrosLibrary::Get()->GetCertLibrary()->EncryptWithUserKey(app_id_); |
| 129 | 129 |
| 130 cryptohome::AsyncMethodCaller::GetInstance()->AsyncMount( | 130 cryptohome::AsyncMethodCaller::GetInstance()->AsyncMount( |
| 131 app_id_, | 131 app_id_, |
| 132 token, | 132 token, |
| 133 cryptohome::CREATE_IF_MISSING, | 133 cryptohome::CREATE_IF_MISSING, |
| 134 base::Bind(&KioskAppLauncher::MountCallback, | 134 base::Bind(&KioskAppLauncher::MountCallback, |
| 135 base::Unretained(this))); | 135 base::Unretained(this))); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void KioskAppLauncher::MountCallback(bool mount_success, | 138 void KioskAppLauncher::MountCallback(bool mount_success, |
| 139 cryptohome::MountError mount_error) { | 139 cryptohome::MountError mount_error) { |
| 140 if (!mount_success) { | 140 if (!mount_success) { |
| 141 LOG(ERROR) << "Failed to mount, error=" << mount_error; | 141 LOG(ERROR) << "Failed to mount, error=" << mount_error; |
| 142 ReportLaunchResult(false); | 142 ReportLaunchResult(false); |
| 143 return; | 143 return; |
| 144 } | 144 } |
| 145 | 145 |
| 146 RestartChrome(GetKioskAppCommandLine(app_id_)); | 146 RestartChrome(GetKioskAppCommandLine(app_id_)); |
| 147 ReportLaunchResult(true); | 147 ReportLaunchResult(true); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace chromeos | 150 } // namespace chromeos |
| OLD | NEW |