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

Unified Diff: chrome/browser/chromeos/arc/arc_util.cc

Issue 2655873002: Get enrollment token from DMServer when an Active Directory user uses ARC (Closed)
Patch Set: Add ClientId to DMServer request. Created 3 years, 10 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: chrome/browser/chromeos/arc/arc_util.cc
diff --git a/chrome/browser/chromeos/arc/arc_util.cc b/chrome/browser/chromeos/arc/arc_util.cc
index 5a0eef24cd9d1bef5d8c7d1f3405ba2a1ddfe4b8..21907d8ae3ebf434ac43ecc001b7301d62d18103 100644
--- a/chrome/browser/chromeos/arc/arc_util.cc
+++ b/chrome/browser/chromeos/arc/arc_util.cc
@@ -4,11 +4,13 @@
#include "chrome/browser/chromeos/arc/arc_util.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "chrome/browser/chromeos/login/user_flow.h"
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_switches.h"
#include "components/arc/arc_util.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
@@ -56,11 +58,20 @@ bool IsArcAllowedForProfile(const Profile* profile) {
}
// Do not allow for public session. Communicating with Play Store requires
- // GAIA account. An exception is Kiosk mode, which uses different application
- // install mechanism. cf) crbug.com/605545
+ // GAIA account. An exception is Kiosk mode and Active Directory users, which
Luis Héctor Chávez 2017/02/06 22:00:15 nit: reword to "Play Store requires either an appr
Marton Hunyady 2017/02/07 14:53:42 Done.
+ // use different application install mechanism. cf) crbug.com/605545
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
- if ((!user || !user->HasGaiaAccount()) && !IsArcKioskMode()) {
+ // Arc is allowed if we have either...
Luis Héctor Chávez 2017/02/06 22:00:15 nit: s/Arc/ARC/ also, can we split off this huge
Marton Hunyady 2017/02/07 14:53:42 Done (without standalone functions).
+ if (!( // .. a GAIA account,
+ (user && user->HasGaiaAccount()) ||
+ // .. an AD user and using ARC with AD is allowed,
+ (user && user->IsActiveDirectoryUser() &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
Luis Héctor Chávez 2017/02/06 22:00:15 Please move all flag-related logic to components/a
Marton Hunyady 2017/02/07 14:53:42 Done.
+ switches::kEnableAndroidWithActiveDirectory)) ||
+ // .. or if it's a kiosk.
+ IsArcKioskMode())) {
+ // Otherwise fail.
VLOG(1) << "Users without GAIA accounts are not supported in ARC.";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698