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

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

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: address review comments 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
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"
10 11
11 namespace arc { 12 namespace arc {
12 13
13 namespace { 14 namespace {
14 15
15 // This is for finch. See also crbug.com/633704 for details. 16 // This is for finch. See also crbug.com/633704 for details.
16 // TODO(hidehiko): More comments of the intention how this works, when 17 // TODO(hidehiko): More comments of the intention how this works, when
17 // we unify the commandline flags. 18 // we unify the commandline flags.
18 const base::Feature kEnableArcFeature{"EnableARC", 19 const base::Feature kEnableArcFeature{"EnableARC",
19 base::FEATURE_DISABLED_BY_DEFAULT}; 20 base::FEATURE_DISABLED_BY_DEFAULT};
20 21
21 } // namespace 22 } // namespace
22 23
23 bool IsArcAvailable() { 24 bool IsArcAvailable() {
24 const auto* command_line = base::CommandLine::ForCurrentProcess(); 25 const auto* command_line = base::CommandLine::ForCurrentProcess();
25 // TODO(hidehiko): Unify --enable-arc and --arc-available flags. 26 // TODO(hidehiko): Unify --enable-arc and --arc-available flags.
26 return command_line->HasSwitch(chromeos::switches::kEnableArc) || 27 return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
27 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && 28 (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
28 base::FeatureList::IsEnabled(kEnableArcFeature)); 29 base::FeatureList::IsEnabled(kEnableArcFeature));
29 } 30 }
30 31
32 bool IsArcKioskMode() {
33 return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
34 }
35
36 bool IsArcOptInVerificationDisabled() {
37 const auto* command_line = base::CommandLine::ForCurrentProcess();
38 return command_line->HasSwitch(
39 chromeos::switches::kDisableArcOptInVerification);
40 }
41
31 } // namespace arc 42 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698