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

Unified Diff: components/arc/arc_util.cc

Issue 2885933003: arc: Consolidate IsArcAllowedForUser logic (Closed)
Patch Set: fix typo 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
Index: components/arc/arc_util.cc
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 7c3ee3f5a080b7e1b4d0b82dc0bbc686873c5b5e..4e3e165d037b679ac24087b09a09d470322e9712 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -94,6 +94,12 @@ bool IsArcKioskMode() {
user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
}
+bool IsArcAllowedForUser(const user_manager::User* user) {
+ return user &&
hidehiko 2017/05/17 02:09:45 Instead of oneline, could you use if-stmt, and vlo
xiyuan 2017/05/17 21:36:14 Done.
+ (user->HasGaiaAccount() || (user->IsActiveDirectoryUser() &&
+ IsArcAllowedForActiveDirectoryUsers()));
+}
+
bool IsArcAllowedForActiveDirectoryUsers() {
const auto* command_line = base::CommandLine::ForCurrentProcess();

Powered by Google App Engine
This is Rietveld 408576698