Commit 22805f8c authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Default crostini username emperor for when profile has no username

Bug: 996439
Change-Id: I95a6882119196e3f8c1448df71225d831b8db284
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846636
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703591}
parent ff60fb54
......@@ -470,6 +470,9 @@ std::string CryptohomeIdForProfile(Profile* profile) {
std::string DefaultContainerUserNameForProfile(Profile* profile) {
// Get rid of the @domain.name in the profile user name (an email address).
std::string container_username = profile->GetProfileUserName();
if (container_username.empty()) {
return kCrostiniDefaultUsername;
}
if (container_username.find('@') != std::string::npos) {
// gaia::CanonicalizeEmail CHECKs its argument contains'@'.
container_username = gaia::CanonicalizeEmail(container_username);
......
......@@ -164,6 +164,7 @@ constexpr char kCrostiniTerminalId[] = "oajcgpnkmhaalajejhlfpacbiokdnnfe";
constexpr char kCrostiniDefaultVmName[] = "termina";
constexpr char kCrostiniDefaultContainerName[] = "penguin";
constexpr char kCrostiniDefaultUsername[] = "emperor";
constexpr char kCrostiniCroshBuiltinAppId[] =
"nkoccljplnhpfnfiajclkommnmllphnl";
// In order to be compatible with sync folder id must match standard.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment