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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Update after review. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // LoginPerformer will delete itself. 151 // LoginPerformer will delete itself.
152 login_performer_->set_delegate(NULL); 152 login_performer_->set_delegate(NULL);
153 ignore_result(login_performer_.release()); 153 ignore_result(login_performer_.release());
154 154
155 // If we are launching a demo session, we need to start MountGuest with the 155 // If we are launching a demo session, we need to start MountGuest with the
156 // guest username; this is because there are several places in the cros code 156 // guest username; this is because there are several places in the cros code
157 // which rely on the username sent to cryptohome to be $guest. Back in Chrome 157 // which rely on the username sent to cryptohome to be $guest. Back in Chrome
158 // we switch this back to the demo user name to correctly identify this 158 // we switch this back to the demo user name to correctly identify this
159 // user as a demo user. 159 // user as a demo user.
160 UserContext context = user_context; 160 UserContext context = user_context;
161 if (context.GetUserID() == chromeos::login::kGuestUserName) 161 if (context.GetAccountId() == login::GuestAccountId())
162 context.SetUserID(login::DemoAccountId().GetUserEmail()); 162 context.SetUserID(login::DemoAccountId().GetUserEmail());
163 UserSessionManager::GetInstance()->StartSession( 163 UserSessionManager::GetInstance()->StartSession(
164 context, UserSessionManager::PRIMARY_USER_SESSION, 164 context, UserSessionManager::PRIMARY_USER_SESSION,
165 false, // has_auth_cookies 165 false, // has_auth_cookies
166 false, // Start session for user. 166 false, // Start session for user.
167 this); 167 this);
168 } 168 }
169 169
170 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) { 170 void KioskProfileLoader::OnAuthFailure(const AuthFailure& error) {
171 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error)); 171 ReportLaunchResult(LoginFailureToKioskAppLaunchError(error));
(...skipping 11 matching lines...) Expand all
183 bool browser_launched) { 183 bool browser_launched) {
184 // This object could be deleted any time after successfully reporting 184 // This object could be deleted any time after successfully reporting
185 // a profile load, so invalidate the delegate now. 185 // a profile load, so invalidate the delegate now.
186 UserSessionManager::GetInstance()->DelegateDeleted(this); 186 UserSessionManager::GetInstance()->DelegateDeleted(this);
187 187
188 delegate_->OnProfileLoaded(profile); 188 delegate_->OnProfileLoaded(profile);
189 ReportLaunchResult(KioskAppLaunchError::NONE); 189 ReportLaunchResult(KioskAppLaunchError::NONE);
190 } 190 }
191 191
192 } // namespace chromeos 192 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698