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

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

Issue 2888653004: Merge "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 aef9766aca8197d4b31eaca774483f3f2ca09f2c..ab28d4b0d5483f00befacf47477515a6bcb75bed 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() &&
+ 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