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

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

Issue 2884203002: cros: Stop showing migration UI in some conditions where users can't start ARC. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 599bee481839165ac9af105ba6145431101697c4..8334a9f6ca7cd02f68bfbb273aa92871c5d2e6ef 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -178,10 +178,29 @@ void RecordPasswordChangeFlow(LoginPasswordChangeFlow flow) {
LOGIN_PASSWORD_CHANGE_FLOW_COUNT);
}
-bool ShouldForceDircrypto() {
- return !base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kDisableEncryptionMigration) &&
- arc::IsArcAvailable();
+bool ShouldForceDircrypto(const AccountId& account_id) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kDisableEncryptionMigration)) {
+ return false;
+ }
+ // If the device is not officially supported to run ARC, we don't need to
+ // force Ext4 dircrypto.
+ if (!arc::IsArcAvailable())
+ return false;
+
+ // In some login flows (e.g. when siging in supervised user), ARC can not
+ // start. For such cases, we don't need to force Ext4 dircrypto.
+ chromeos::UserFlow* user_flow =
+ chromeos::ChromeUserManager::Get()->GetUserFlow(account_id);
+ if (!user_flow || !user_flow->CanStartArc())
+ return false;
+
+ // When a user is signing in as a secondary user, we don't need to force Ext4
+ // dircrypto since the user can not run ARC.
+ if (UserAddingScreen::Get()->IsRunning())
+ return false;
+
+ return true;
}
} // namespace
@@ -472,7 +491,8 @@ void ExistingUserController::PerformLogin(
// sure that the user's cryptohome is encrypted in ext4 dircrypto to run the
// latest Android runtime.
UserContext new_user_context = user_context;
- new_user_context.SetIsForcingDircrypto(ShouldForceDircrypto());
+ new_user_context.SetIsForcingDircrypto(
+ ShouldForceDircrypto(new_user_context.GetAccountId()));
login_performer_->PerformLogin(new_user_context, auth_mode);
RecordPasswordLoginEvent(new_user_context);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698