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

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 Luis's comments 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
« no previous file with comments | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_util.cc
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 6e74ad0de154926c7a1cd22abfe57b8691d70e73..32d97009a76ee6af9372c953aefb2dae38e9a8ef 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,17 @@ bool IsArcKioskMode() {
return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
}
+bool IsArcAllowedForActiveDirectoryUsers() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
+
+ if (!command_line->HasSwitch(chromeos::switches::kArcAvailability))
+ return false;
+
+ return command_line->GetSwitchValueASCII(
+ chromeos::switches::kArcAvailability) ==
+ kAvailabilityOfficiallySupportedWithActiveDirectory;
+}
+
bool IsArcOptInVerificationDisabled() {
const auto* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(
« no previous file with comments | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698