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

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

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: address comments Created 3 years, 11 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 | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | chrome/browser/chromeos/arc/arc_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_util.h
diff --git a/chrome/browser/chromeos/arc/arc_util.h b/chrome/browser/chromeos/arc/arc_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f7422dfade687d811df6f155df68913cfa60a19
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_util.h
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_
+
+// Most utility should be put in components/arc/arc_util.{h,cc}, rather than
+// here. However, some utility implementation requires other modules defined in
+// chrome/, so this file contains such utilities.
+// Note that it is not allowed to have dependency from components/ to chrome/
+// by DEPS.
+
+class Profile;
+
+namespace arc {
+
+// Returns true if ARC is allowed to run for the given profile.
+// Otherwise, returns false, e.g. if the Profile is not for the primary user,
+// ARC is not available on the device, it is in the flow to set up managed
+// account creation.
+// nullptr can be safely passed to this function. In that case, returns false.
+bool IsArcAllowedForProfile(const Profile* profile);
+
+// Disallows ARC for all profiles for testing.
+// In most cases, disabling ARC should be done via commandline. However,
+// there are some cases to be tested where ARC is available, but ARC is not
+// supported for some reasons (e.g. incognito mode, supervised user,
+// secondary profile). On the other hand, some test infra does not support
+// such situations (e.g. API test). This is for workaround to emulate the
+// case.
+void DisallowArcForTesting();
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | chrome/browser/chromeos/arc/arc_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698