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

Unified Diff: chrome/browser/chromeos/login/screens/user_selection_screen.cc

Issue 2879393003: cros: No migration banner if user not allowed for 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/screens/user_selection_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.cc b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
index 5578bd0709e3249607a3b7e135938d6a501baf7c..ed7ea4636810226a835f26872ebf757d62965dac 100644
--- a/chrome/browser/chromeos/login/screens/user_selection_screen.cc
+++ b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
@@ -149,6 +149,20 @@ bool ShouldCheckNeedDircryptoMigration() {
arc::IsArcAvailable();
}
+// Returns true if the user can run ARC based on the user type.
+bool IsUserAllowedForARC(const AccountId& account_id) {
+ if (!user_manager::UserManager::IsInitialized())
+ return false;
+
+ const user_manager::User* user =
+ user_manager::UserManager::Get()->FindUser(account_id);
+ if (!user)
+ return false;
+
+ return user->HasGaiaAccount() || (user->IsActiveDirectoryUser() &&
kinaba 2017/05/16 05:12:39 Can this check filter out the profile->IsLegacySup
xiyuan 2017/05/16 06:21:58 Yes, legacy supervised user is managed locally (i.
hidehiko 2017/05/16 06:31:54 What about Ephemeral case? Also, can the logic ac
kinaba 2017/05/16 07:20:11 I believe ephemeral users don't have homedir to mi
xiyuan 2017/05/16 16:02:55 Correct. Ephemeral users would not have their cryp
+ arc::IsArcAllowedForActiveDirectoryUsers());
+}
+
} // namespace
// Helper class to call cryptohome to check whether a user needs dircrypto
@@ -169,6 +183,12 @@ class UserSelectionScreen::DircryptoMigrationChecker {
return;
}
+ // No banner if the user is not allowed for ARC.
+ if (!IsUserAllowedForARC(account_id)) {
+ UpdateUI(account_id, false);
+ return;
+ }
+
DBusThreadManager::Get()
->GetCryptohomeClient()
->WaitForServiceToBeAvailable(
« 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