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

Unified Diff: components/arc/arc_util.cc

Issue 2655873002: Get enrollment token from DMServer when an Active Directory user uses ARC (Closed)
Patch Set: Fix unit test after renaming flag 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: components/arc/arc_util.cc
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 6e74ad0de154926c7a1cd22abfe57b8691d70e73..0b0fc75e1de05737e0d8613db699c63b20ad78ca 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -25,6 +25,8 @@ const base::Feature kEnableArcFeature{"EnableARC",
constexpr char kAvailabilityNone[] = "none";
constexpr char kAvailabilityInstalled[] = "installed";
constexpr char kAvailabilityOfficiallySupported[] = "officially-supported";
+constexpr char kAvailabilityOfficiallySupportedWithActiveDirectory[] =
+ "officially-supported-with-active-directory";
} // namespace
@@ -34,13 +36,14 @@ bool IsArcAvailable() {
if (command_line->HasSwitch(chromeos::switches::kArcAvailability)) {
std::string value = command_line->GetSwitchValueASCII(
chromeos::switches::kArcAvailability);
- DCHECK(value == kAvailabilityNone ||
- value == kAvailabilityInstalled ||
- value == kAvailabilityOfficiallySupported)
+ DCHECK(value == kAvailabilityNone || value == kAvailabilityInstalled ||
+ value == kAvailabilityOfficiallySupported ||
+ value == kAvailabilityOfficiallySupportedWithActiveDirectory)
<< "Unknown flag value: " << value;
return value == kAvailabilityOfficiallySupported ||
- (value == kAvailabilityInstalled &&
- base::FeatureList::IsEnabled(kEnableArcFeature));
+ value == kAvailabilityOfficiallySupportedWithActiveDirectory ||
+ (value == kAvailabilityInstalled &&
+ base::FeatureList::IsEnabled(kEnableArcFeature));
}
// For transition, fallback to old flags.
@@ -60,6 +63,16 @@ bool IsArcKioskMode() {
return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
}
+bool IsArcAllowedForActiveDirectoryUsers() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(chromeos::switches::kArcAvailability)) {
Luis Héctor Chávez 2017/02/07 16:33:03 nit: if (!command_line->HasSwitch(...)) return
Marton Hunyady 2017/02/07 17:28:48 Done.
+ return command_line->GetSwitchValueASCII(
+ chromeos::switches::kArcAvailability) ==
+ kAvailabilityOfficiallySupportedWithActiveDirectory;
+ }
+ return false;
+}
+
bool IsArcOptInVerificationDisabled() {
const auto* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(

Powered by Google App Engine
This is Rietveld 408576698