OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/arc/arc_util.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" |
| 9 #include "chromeos/chromeos_switches.h" |
| 10 |
| 11 namespace arc { |
| 12 |
| 13 namespace { |
| 14 |
| 15 // This is for finch. See also crbug.com/633704 for details. |
| 16 // TODO(hidehiko): More comments of the intention how this works, when |
| 17 // we unify the commandline flags. |
| 18 const base::Feature kEnableArcFeature{"EnableARC", |
| 19 base::FEATURE_DISABLED_BY_DEFAULT}; |
| 20 |
| 21 } // namespace |
| 22 |
| 23 bool IsArcAvailable() { |
| 24 const auto* command_line = base::CommandLine::ForCurrentProcess(); |
| 25 // TODO(hidehiko): Unify --enable-arc and --arc-available flags. |
| 26 // If switches::kEnableArc is set, the device is officially supported to run |
| 27 // ARC. If it is not, but switches::kArcAvailable is set, ARC is installed |
| 28 // but is not allowed to run unless |kEnableArcFeature| is true. |
| 29 return command_line->HasSwitch(chromeos::switches::kEnableArc) || |
| 30 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && |
| 31 base::FeatureList::IsEnabled(kEnableArcFeature)); |
| 32 } |
| 33 |
| 34 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line) { |
| 35 command_line->AppendSwitch(chromeos::switches::kEnableArc); |
| 36 } |
| 37 |
| 38 } // namespace arc |
OLD | NEW |