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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_profile_loader.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/app_mode/kiosk_profile_loader.cc
diff --git a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc
index d1de8428026d6208918deb7b923dc5fdda2ab88f..cd386b89b1cdb41b5ec8c26c3eae268f06195473 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc
+++ b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_util.h"
#include "base/sys_info.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
+#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
#include "chrome/browser/chromeos/login/login_display_host_impl.h"
#include "chrome/browser/chromeos/login/login_status_consumer.h"
#include "chrome/browser/chromeos/login/login_utils.h"
@@ -149,7 +150,15 @@ void KioskProfileLoader::OnLoginSuccess(const UserContext& user_context) {
login_performer_->set_delegate(NULL);
ignore_result(login_performer_.release());
- LoginUtils::Get()->PrepareProfile(user_context,
+ // If we are launching a demo session, we need to start MountGuest with the
+ // guest username; this is because there are several places in the cros code
+ // which rely on the username sent to cryptohome to be $guest. Back in Chrome
+ // we switch this back to the demo user name to correctly identify this
+ // user as a demo user.
+ UserContext context = user_context;
+ if (context.username == UserManager::kGuestUserName)
+ context.username = DemoAppLauncher::kDemoUserName;
+ LoginUtils::Get()->PrepareProfile(context,
std::string(), // display email
false, // has_cookies
false, // has_active_session

Powered by Google App Engine
This is Rietveld 408576698