blob: a9e69d36878ecbaae809ccdd1c2cb6a630a5eed6 [file] [log] [blame]
hidehikoaab3dea2017-01-30 14:36:461// 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#ifndef COMPONENTS_ARC_ARC_UTIL_H_
6#define COMPONENTS_ARC_ARC_UTIL_H_
7
8// This file contains utility to see ARC functionality status controlled by
9// outside of ARC, e.g. CommandLine flag, attribute of global data/state,
10// users' preferences, and FeatureList.
11
12namespace base {
13class CommandLine;
14} // namespace base
15
16namespace arc {
17
18// Returns true if ARC is installed and the current device is officially
19// supported to run ARC.
20// Note that, to run ARC practically, it is necessary to meet more conditions,
21// e.g., ARC supports only on Primary User Profile. To see if ARC can actually
22// run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is
23// the function for that purpose. Please see also its comment, too.
24// Also note that, ARC singleton classes (e.g. ArcSessionManager,
25// ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this
26// check, so it is ok to access them directly.
27bool IsArcAvailable();
28
victorhsiehec707852017-03-07 19:37:0629// Returns true if ARC should always start within the primary user session
30// (opted in user or not), and other supported mode such as guest and Kiosk
31// mode.
32bool ShouldArcAlwaysStart();
33
34// Enables to always start ARC for testing, by appending the command line flag.
35void SetArcAlwaysStartForTesting();
36
poromov4fdd0672017-02-09 17:30:0237// Returns true if ARC is installed and running ARC kiosk apps on the current
38// device is officially supported.
39// It doesn't follow that ARC is available for user sessions and
40// IsArcAvailable() will return true, although the reverse should be.
41// This is used to distinguish special cases when ARC kiosk is available on
42// the device, but is not yet supported for regular user sessions.
43// In most cases, IsArcAvailable() check should be used instead of this.
44// Also not that this function may return true when ARC is not running in
45// Kiosk mode, it checks only ARC Kiosk availability.
46bool IsArcKioskAvailable();
47
hidehikoaab3dea2017-01-30 14:36:4648// For testing ARC in browser tests, this function should be called in
49// SetUpCommandLine(), and its argument should be passed to this function.
50// Also, in unittests, this can be called in SetUp() with
51// base::CommandLine::ForCurrentProcess().
52// |command_line| must not be nullptr.
53void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line);
54
poromov4fdd0672017-02-09 17:30:0255// Returns true if ARC should run under Kiosk mode for the current profile.
56// As it can return true only when user is already initialized, it implies
57// that ARC availability was checked before and IsArcKioskAvailable()
58// should also return true in that case.
hidehiko0b75bce62017-01-31 13:13:0159bool IsArcKioskMode();
60
hunyadym56c49db62017-02-07 18:57:4261// Returns true if it is allowed to use ARC with Active Directory managed
62// devices.
63bool IsArcAllowedForActiveDirectoryUsers();
64
hidehiko0b75bce62017-01-31 13:13:0165// Checks if opt-in verification was disabled by switch in command line.
66// In most cases, it is disabled for testing purpose.
67bool IsArcOptInVerificationDisabled();
68
hidehikoaab3dea2017-01-30 14:36:4669} // namespace arc
70
71#endif // COMPONENTS_ARC_ARC_UTIL_H_