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

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

Issue 2885933003: arc: Consolidate IsArcAllowedForUser logic (Closed)
Patch Set: fix typo Created 3 years, 7 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 #ifndef COMPONENTS_ARC_ARC_UTIL_H_ 5 #ifndef COMPONENTS_ARC_ARC_UTIL_H_
6 #define COMPONENTS_ARC_ARC_UTIL_H_ 6 #define COMPONENTS_ARC_ARC_UTIL_H_
7 7
8 // This file contains utility to see ARC functionality status controlled by 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, 9 // outside of ARC, e.g. CommandLine flag, attribute of global data/state,
10 // users' preferences, and FeatureList. 10 // users' preferences, and FeatureList.
11 11
12 namespace base { 12 namespace base {
13 class CommandLine; 13 class CommandLine;
14 } // namespace base 14 } // namespace base
15 15
16 namespace user_manager {
17 class User;
18 }
hidehiko 2017/05/17 02:09:45 nit: // namespace user_manager for consistency.
xiyuan 2017/05/17 21:36:14 Done.
19
16 namespace arc { 20 namespace arc {
17 21
18 // Returns true if ARC is installed and the current device is officially 22 // Returns true if ARC is installed and the current device is officially
19 // supported to run ARC. 23 // supported to run ARC.
20 // Note that, to run ARC practically, it is necessary to meet more conditions, 24 // 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 25 // 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 26 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is
23 // the function for that purpose. Please see also its comment, too. 27 // the function for that purpose. Please see also its comment, too.
24 // Also note that, ARC singleton classes (e.g. ArcSessionManager, 28 // Also note that, ARC singleton classes (e.g. ArcSessionManager,
25 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this 29 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this
(...skipping 25 matching lines...) Expand all
51 // base::CommandLine::ForCurrentProcess(). 55 // base::CommandLine::ForCurrentProcess().
52 // |command_line| must not be nullptr. 56 // |command_line| must not be nullptr.
53 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); 57 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line);
54 58
55 // Returns true if ARC should run under Kiosk mode for the current profile. 59 // 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 60 // As it can return true only when user is already initialized, it implies
57 // that ARC availability was checked before and IsArcKioskAvailable() 61 // that ARC availability was checked before and IsArcKioskAvailable()
58 // should also return true in that case. 62 // should also return true in that case.
59 bool IsArcKioskMode(); 63 bool IsArcKioskMode();
60 64
65 // Returns true if ARC is allowed for the given user. Note this should not be
66 // used as a signal of whether ARC is allowed alone because it only considers
67 // user meta data. e.g. a user could be allowed for ARC but if the user signs in
68 // as a secondary user or signs in to create a supervised user, ARC should be
69 // disabled for such cases.
70 bool IsArcAllowedForUser(const user_manager::User* user);
71
61 // Returns true if it is allowed to use ARC with Active Directory managed 72 // Returns true if it is allowed to use ARC with Active Directory managed
62 // devices. 73 // devices.
63 bool IsArcAllowedForActiveDirectoryUsers(); 74 bool IsArcAllowedForActiveDirectoryUsers();
64 75
65 // Checks if opt-in verification was disabled by switch in command line. 76 // Checks if opt-in verification was disabled by switch in command line.
66 // In most cases, it is disabled for testing purpose. 77 // In most cases, it is disabled for testing purpose.
67 bool IsArcOptInVerificationDisabled(); 78 bool IsArcOptInVerificationDisabled();
68 79
69 } // namespace arc 80 } // namespace arc
70 81
71 #endif // COMPONENTS_ARC_ARC_UTIL_H_ 82 #endif // COMPONENTS_ARC_ARC_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698