| 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_profile_loader.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 context.SetAccountId(user_manager::DemoAccountId()); | 179 context.SetAccountId(user_manager::DemoAccountId()); |
| 180 UserSessionManager::GetInstance()->StartSession( | 180 UserSessionManager::GetInstance()->StartSession( |
| 181 context, UserSessionManager::PRIMARY_USER_SESSION, | 181 context, UserSessionManager::PRIMARY_USER_SESSION, |
| 182 false, // has_auth_cookies | 182 false, // has_auth_cookies |
| 183 false, // Start session for user. | 183 false, // Start session for user. |
| 184 this); | 184 this); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { | 187 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { |
| 188 LOG(ERROR) << "Kiosk auth failure: error=" << error.GetErrorString(); | 188 LOG(ERROR) << "Kiosk auth failure: error=" << error.GetErrorString(); |
| 189 KioskAppLaunchError::SaveCryptohomeFailure(error); |
| 189 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); | 190 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void KioskProfileLoader::WhiteListCheckFailed(const std::string& email) { | 193 void KioskProfileLoader::WhiteListCheckFailed(const std::string& email) { |
| 193 NOTREACHED(); | 194 NOTREACHED(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void KioskProfileLoader::PolicyLoadFailed() { | 197 void KioskProfileLoader::PolicyLoadFailed() { |
| 197 ReportLaunchResult(KioskAppLaunchError::POLICY_LOAD_FAILED); | 198 ReportLaunchResult(KioskAppLaunchError::POLICY_LOAD_FAILED); |
| 198 } | 199 } |
| 199 | 200 |
| 200 void KioskProfileLoader::SetAuthFlowOffline(bool offline) { | 201 void KioskProfileLoader::SetAuthFlowOffline(bool offline) { |
| 201 NOTREACHED(); | 202 NOTREACHED(); |
| 202 } | 203 } |
| 203 | 204 |
| 204 void KioskProfileLoader::OnProfilePrepared(Profile* profile, | 205 void KioskProfileLoader::OnProfilePrepared(Profile* profile, |
| 205 bool browser_launched) { | 206 bool browser_launched) { |
| 206 // This object could be deleted any time after successfully reporting | 207 // This object could be deleted any time after successfully reporting |
| 207 // a profile load, so invalidate the delegate now. | 208 // a profile load, so invalidate the delegate now. |
| 208 UserSessionManager::GetInstance()->DelegateDeleted(this); | 209 UserSessionManager::GetInstance()->DelegateDeleted(this); |
| 209 | 210 |
| 210 delegate_->OnProfileLoaded(profile); | 211 delegate_->OnProfileLoaded(profile); |
| 211 ReportLaunchResult(KioskAppLaunchError::NONE); | 212 ReportLaunchResult(KioskAppLaunchError::NONE); |
| 212 } | 213 } |
| 213 | 214 |
| 214 } // namespace chromeos | 215 } // namespace chromeos |
| OLD | NEW |