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

Side by Side Diff: components/arc/arc_util.cc

Issue 2668153002: Revert of Move more utility functions to arc_util. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/arc/arc_util.h" 5 #include "components/arc/arc_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "chromeos/chromeos_switches.h" 9 #include "chromeos/chromeos_switches.h"
10 #include "components/user_manager/user_manager.h"
11 10
12 namespace arc { 11 namespace arc {
13 12
14 namespace { 13 namespace {
15 14
16 // This is for finch. See also crbug.com/633704 for details. 15 // This is for finch. See also crbug.com/633704 for details.
17 // TODO(hidehiko): More comments of the intention how this works, when 16 // TODO(hidehiko): More comments of the intention how this works, when
18 // we unify the commandline flags. 17 // we unify the commandline flags.
19 const base::Feature kEnableArcFeature{"EnableARC", 18 const base::Feature kEnableArcFeature{"EnableARC",
20 base::FEATURE_DISABLED_BY_DEFAULT}; 19 base::FEATURE_DISABLED_BY_DEFAULT};
21 20
22 } // namespace 21 } // namespace
23 22
24 bool IsArcAvailable() { 23 bool IsArcAvailable() {
25 const auto* command_line = base::CommandLine::ForCurrentProcess(); 24 const auto* command_line = base::CommandLine::ForCurrentProcess();
26 // TODO(hidehiko): Unify --enable-arc and --arc-available flags. 25 // TODO(hidehiko): Unify --enable-arc and --arc-available flags.
27 // If switches::kEnableArc is set, the device is officially supported to run 26 // If switches::kEnableArc is set, the device is officially supported to run
28 // ARC. If it is not, but switches::kArcAvailable is set, ARC is installed 27 // ARC. If it is not, but switches::kArcAvailable is set, ARC is installed
29 // but is not allowed to run unless |kEnableArcFeature| is true. 28 // but is not allowed to run unless |kEnableArcFeature| is true.
30 return command_line->HasSwitch(chromeos::switches::kEnableArc) || 29 return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
31 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && 30 (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
32 base::FeatureList::IsEnabled(kEnableArcFeature)); 31 base::FeatureList::IsEnabled(kEnableArcFeature));
33 } 32 }
34 33
35 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line) { 34 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line) {
36 command_line->AppendSwitch(chromeos::switches::kEnableArc); 35 command_line->AppendSwitch(chromeos::switches::kEnableArc);
37 } 36 }
38 37
39 bool IsArcKioskMode() {
40 return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
41 }
42
43 bool IsArcOptInVerificationDisabled() {
44 const auto* command_line = base::CommandLine::ForCurrentProcess();
45 return command_line->HasSwitch(
46 chromeos::switches::kDisableArcOptInVerification);
47 }
48
49 } // namespace arc 38 } // namespace arc
OLDNEW
« 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