arc: Consolidate IsArcAllowedForUser logic

BUG=722876
TEST=ArcUtilTest.IsArcAllowedForUser

Review-Url: https://codereview.chromium.org/2885933003
Cr-Commit-Position: refs/heads/master@{#474646}
diff --git a/components/arc/arc_util.h b/components/arc/arc_util.h
index 2e5ddd3..d1423e14 100644
--- a/components/arc/arc_util.h
+++ b/components/arc/arc_util.h
@@ -17,6 +17,10 @@
 class CommandLine;
 }  // namespace base
 
+namespace user_manager {
+class User;
+}  // namespace user_manager
+
 namespace arc {
 
 // Returns true if ARC is installed and the current device is officially
@@ -62,6 +66,13 @@
 // should also return true in that case.
 bool IsArcKioskMode();
 
+// Returns true if ARC is allowed for the given user. Note this should not be
+// used as a signal of whether ARC is allowed alone because it only considers
+// user meta data. e.g. a user could be allowed for ARC but if the user signs in
+// as a secondary user or signs in to create a supervised user, ARC should be
+// disabled for such cases.
+bool IsArcAllowedForUser(const user_manager::User* user);
+
 // Checks if opt-in verification was disabled by switch in command line.
 // In most cases, it is disabled for testing purpose.
 bool IsArcOptInVerificationDisabled();