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

Unified Diff: components/arc/arc_util.h

Issue 2648213004: Migrate --enable-arc and --arc-available part 1. (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 | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_util.h
diff --git a/components/arc/arc_util.h b/components/arc/arc_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ef99d40bd20a0fe2b95d6836793964ead96c3ff
--- /dev/null
+++ b/components/arc/arc_util.h
@@ -0,0 +1,38 @@
+// 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 COMPONENTS_ARC_ARC_UTIL_H_
+#define COMPONENTS_ARC_ARC_UTIL_H_
+
+// This file contains utility to see ARC functionality status controlled by
+// outside of ARC, e.g. CommandLine flag, attribute of global data/state,
+// users' preferences, and FeatureList.
+
+namespace base {
+class CommandLine;
+} // namespace base
+
+namespace arc {
+
+// Returns true if ARC is installed and the current device is officially
+// supported to run ARC.
+// Note that, to run ARC practically, it is necessary to meet more conditions,
+// e.g., ARC supports only on Primary User Profile. To see if ARC can actually
+// run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is
+// the function for that purpose. Please see also its comment, too.
+// Also note that, ARC singleton classes (e.g. ArcSessionManager,
+// ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this
+// check, so it is ok to access them directly.
+bool IsArcAvailable();
+
+// For testing ARC in browser tests, this function should be called in
+// SetUpCommandLine(), and its argument should be passed to this function.
+// Also, in unittests, this can be called in SetUp() with
+// base::CommandLine::ForCurrentProcess().
+// |command_line| must not be nullptr.
+void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line);
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_ARC_UTIL_H_
« no previous file with comments | « components/arc/arc_bridge_service.cc ('k') | components/arc/arc_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698