OLD | NEW |
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. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // base::CommandLine::ForCurrentProcess(). | 71 // base::CommandLine::ForCurrentProcess(). |
72 // |command_line| must not be nullptr. | 72 // |command_line| must not be nullptr. |
73 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); | 73 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); |
74 | 74 |
75 // Returns true if ARC should run under Kiosk mode for the current profile. | 75 // Returns true if ARC should run under Kiosk mode for the current profile. |
76 // As it can return true only when user is already initialized, it implies | 76 // As it can return true only when user is already initialized, it implies |
77 // that ARC availability was checked before and IsArcKioskAvailable() | 77 // that ARC availability was checked before and IsArcKioskAvailable() |
78 // should also return true in that case. | 78 // should also return true in that case. |
79 bool IsArcKioskMode(); | 79 bool IsArcKioskMode(); |
80 | 80 |
| 81 // Returns true if current user is a robot account user. |
| 82 // These are Public Session and ARC Kiosk users. |
| 83 // As it can return true only when user is already initialized, it implies |
| 84 // that ARC availability was checked before. |
| 85 // The check is basically IsArcKioskMode() | IsPublicSessionMode(). |
| 86 bool IsRobotAccountMode(); |
| 87 |
81 // Returns true if ARC is allowed for the given user. Note this should not be | 88 // Returns true if ARC is allowed for the given user. Note this should not be |
82 // used as a signal of whether ARC is allowed alone because it only considers | 89 // used as a signal of whether ARC is allowed alone because it only considers |
83 // user meta data. e.g. a user could be allowed for ARC but if the user signs in | 90 // user meta data. e.g. a user could be allowed for ARC but if the user signs in |
84 // as a secondary user or signs in to create a supervised user, ARC should be | 91 // as a secondary user or signs in to create a supervised user, ARC should be |
85 // disabled for such cases. | 92 // disabled for such cases. |
86 bool IsArcAllowedForUser(const user_manager::User* user); | 93 bool IsArcAllowedForUser(const user_manager::User* user); |
87 | 94 |
88 // Checks if opt-in verification was disabled by switch in command line. | 95 // Checks if opt-in verification was disabled by switch in command line. |
89 // In most cases, it is disabled for testing purpose. | 96 // In most cases, it is disabled for testing purpose. |
90 bool IsArcOptInVerificationDisabled(); | 97 bool IsArcOptInVerificationDisabled(); |
91 | 98 |
92 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When | 99 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When |
93 // |window| is nullptr, returns false. | 100 // |window| is nullptr, returns false. |
94 bool IsArcAppWindow(aura::Window* window); | 101 bool IsArcAppWindow(aura::Window* window); |
95 | 102 |
96 // Adjusts the amount of CPU the ARC instance is allowed to use. When | 103 // Adjusts the amount of CPU the ARC instance is allowed to use. When |
97 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly | 104 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly |
98 // restricted CPU resources. | 105 // restricted CPU resources. |
99 // TODO(yusukes): Use enum instead of bool. | 106 // TODO(yusukes): Use enum instead of bool. |
100 void SetArcCpuRestriction(bool do_restrict); | 107 void SetArcCpuRestriction(bool do_restrict); |
101 | 108 |
102 } // namespace arc | 109 } // namespace arc |
103 | 110 |
104 #endif // COMPONENTS_ARC_ARC_UTIL_H_ | 111 #endif // COMPONENTS_ARC_ARC_UTIL_H_ |
OLD | NEW |