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

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

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: Revert IsIntentHelperAvailable fix. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 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_bridge_service.h" 5 #include "components/arc/arc_util.h"
6
7 #include <utility>
8 6
9 #include "base/command_line.h" 7 #include "base/command_line.h"
10 #include "base/feature_list.h" 8 #include "base/feature_list.h"
11 #include "base/sequenced_task_runner.h"
12 #include "base/threading/thread_task_runner_handle.h"
13 #include "chromeos/chromeos_switches.h" 9 #include "chromeos/chromeos_switches.h"
10 #include "components/user_manager/user_manager.h"
14 11
15 namespace arc { 12 namespace arc {
13 namespace util {
16 14
17 namespace { 15 namespace {
18 16
19 const base::Feature kArcEnabledFeature{"EnableARC", 17 const base::Feature kArcEnabledFeature{"EnableARC",
Yusuke Sato 2017/01/19 22:39:31 This is for finch experiment right? A short commen
hidehiko 2017/01/24 17:46:12 Done.
20 base::FEATURE_DISABLED_BY_DEFAULT}; 18 base::FEATURE_DISABLED_BY_DEFAULT};
21 19
22 } // namespace 20 } // namespace
23 21
24 ArcBridgeService::ArcBridgeService() = default; 22 bool IsArcEnabled() {
25 23 const auto* command_line = base::CommandLine::ForCurrentProcess();
26 ArcBridgeService::~ArcBridgeService() = default;
27
28 // static
29 bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) {
30 return command_line->HasSwitch(chromeos::switches::kEnableArc) || 24 return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
31 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && 25 (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
32 base::FeatureList::IsEnabled(kArcEnabledFeature)); 26 base::FeatureList::IsEnabled(kArcEnabledFeature));
33 } 27 }
34 28
35 // static 29 bool IsArcAvailable() {
36 bool ArcBridgeService::GetAvailable(const base::CommandLine* command_line) { 30 const auto* command_line = base::CommandLine::ForCurrentProcess();
37 return command_line->HasSwitch(chromeos::switches::kArcAvailable); 31 return command_line->HasSwitch(chromeos::switches::kArcAvailable);
38 } 32 }
39 33
34 bool IsArcKioskMode() {
35 return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
36 }
37
38 bool IsOptInVerificationDisabled() {
39 const auto* command_line = base::CommandLine::ForCurrentProcess();
40 return command_line->HasSwitch(
41 chromeos::switches::kDisableArcOptInVerification);
42 }
43
44 } // namespace util
40 } // namespace arc 45 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698