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

Unified Diff: components/arc/arc_util.cc

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_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
new file mode 100644
index 0000000000000000000000000000000000000000..b2fbdd6afb4d9061d8740fb08bfea3f96474c9ea
--- /dev/null
+++ b/components/arc/arc_util.cc
@@ -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.
+
+#include "components/arc/arc_util.h"
+
+#include "base/command_line.h"
+#include "base/feature_list.h"
+#include "chromeos/chromeos_switches.h"
+
+namespace arc {
+
+namespace {
+
+// This is for finch. See also crbug.com/633704 for details.
+// TODO(hidehiko): More comments of the intention how this works, when
+// we unify the commandline flags.
+const base::Feature kEnableArcFeature{"EnableARC",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+} // namespace
+
+bool IsArcAvailable() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
+ // TODO(hidehiko): Unify --enable-arc and --arc-available flags.
+ // If switches::kEnableArc is set, the device is officially supported to run
+ // ARC. If it is not, but switches::kArcAvailable is set, ARC is installed
+ // but is not allowed to run unless |kEnableArcFeature| is true.
+ return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
+ (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
+ base::FeatureList::IsEnabled(kEnableArcFeature));
+}
+
+void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line) {
+ command_line->AppendSwitch(chromeos::switches::kEnableArc);
+}
+
+} // namespace arc
« 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