Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6775)

Unified Diff: chrome/browser/chromeos/login/parallel_authenticator.cc

Issue 171423009: Use MountGuest to mount cryptohome for a demo user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/parallel_authenticator.cc
diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc
index 85ae4b9739f53f3c7e48bcb36fd416e20073f0ec..29ffe01df4da276ab7900e54bca1ab2e094bd509 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator.cc
@@ -348,19 +348,28 @@ void ParallelAuthenticator::LoginAsPublicAccount(const std::string& username) {
void ParallelAuthenticator::LoginAsKioskAccount(
const std::string& app_user_id, bool force_ephemeral) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ std::string user_id =
+ force_ephemeral ? UserManager::kGuestUserName : app_user_id;
current_state_.reset(new AuthAttemptState(
- UserContext(app_user_id,
+ UserContext(user_id,
std::string(), // password
std::string()), // auth_code
std::string(), // login_token
std::string(), // login_captcha
User::USER_TYPE_KIOSK_APP,
false));
+
remove_user_data_on_failure_ = true;
- int ephemeral_flag = force_ephemeral ? cryptohome::ENSURE_EPHEMERAL : 0;
- MountPublic(current_state_.get(),
- scoped_refptr<ParallelAuthenticator>(this),
- cryptohome::CREATE_IF_MISSING | ephemeral_flag);
+ if (!force_ephemeral) {
+ MountPublic(current_state_.get(),
+ scoped_refptr<ParallelAuthenticator>(this),
+ cryptohome::CREATE_IF_MISSING);
+ } else {
+ ephemeral_mount_attempted_ = true;
+ MountGuest(current_state_.get(),
+ scoped_refptr<ParallelAuthenticator>(this));
+ }
}
void ParallelAuthenticator::OnRetailModeLoginSuccess() {
« chrome/browser/chromeos/login/login_utils.cc ('K') | « chrome/browser/chromeos/login/login_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698