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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 login_performer_->set_delegate(NULL); | 153 login_performer_->set_delegate(NULL); |
154 ignore_result(login_performer_.release()); | 154 ignore_result(login_performer_.release()); |
155 | 155 |
156 // If we are launching a demo session, we need to start MountGuest with the | 156 // If we are launching a demo session, we need to start MountGuest with the |
157 // guest username; this is because there are several places in the cros code | 157 // guest username; this is because there are several places in the cros code |
158 // which rely on the username sent to cryptohome to be $guest. Back in Chrome | 158 // which rely on the username sent to cryptohome to be $guest. Back in Chrome |
159 // we switch this back to the demo user name to correctly identify this | 159 // we switch this back to the demo user name to correctly identify this |
160 // user as a demo user. | 160 // user as a demo user. |
161 UserContext context = user_context; | 161 UserContext context = user_context; |
162 if (context.GetAccountId() == login::GuestAccountId()) | 162 if (context.GetAccountId() == login::GuestAccountId()) |
163 context.SetUserID(login::DemoAccountId().GetUserEmail()); | 163 context.SetAccountId(login::DemoAccountId()); |
164 UserSessionManager::GetInstance()->StartSession( | 164 UserSessionManager::GetInstance()->StartSession( |
165 context, UserSessionManager::PRIMARY_USER_SESSION, | 165 context, UserSessionManager::PRIMARY_USER_SESSION, |
166 false, // has_auth_cookies | 166 false, // has_auth_cookies |
167 false, // Start session for user. | 167 false, // Start session for user. |
168 this); | 168 this); |
169 } | 169 } |
170 | 170 |
171 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { | 171 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { |
172 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); | 172 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); |
173 } | 173 } |
(...skipping 14 matching lines...) Expand all Loading... |
188 bool browser_launched) { | 188 bool browser_launched) { |
189 // This object could be deleted any time after successfully reporting | 189 // This object could be deleted any time after successfully reporting |
190 // a profile load, so invalidate the delegate now. | 190 // a profile load, so invalidate the delegate now. |
191 UserSessionManager::GetInstance()->DelegateDeleted(this); | 191 UserSessionManager::GetInstance()->DelegateDeleted(this); |
192 | 192 |
193 delegate_->OnProfileLoaded(profile); | 193 delegate_->OnProfileLoaded(profile); |
194 ReportLaunchResult(KioskAppLaunchError::NONE); | 194 ReportLaunchResult(KioskAppLaunchError::NONE); |
195 } | 195 } |
196 | 196 |
197 } // namespace chromeos | 197 } // namespace chromeos |
OLD | NEW |