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

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

Issue 2926893002: arc: Start ARC for Public Session users.
Patch Set: Update unit tests. Created 3 years, 6 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.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // base::CommandLine::ForCurrentProcess(). 59 // base::CommandLine::ForCurrentProcess().
60 // |command_line| must not be nullptr. 60 // |command_line| must not be nullptr.
61 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); 61 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line);
62 62
63 // Returns true if ARC should run under Kiosk mode for the current profile. 63 // Returns true if ARC should run under Kiosk mode for the current profile.
64 // As it can return true only when user is already initialized, it implies 64 // As it can return true only when user is already initialized, it implies
65 // that ARC availability was checked before and IsArcKioskAvailable() 65 // that ARC availability was checked before and IsArcKioskAvailable()
66 // should also return true in that case. 66 // should also return true in that case.
67 bool IsArcKioskMode(); 67 bool IsArcKioskMode();
68 68
69 // Returns true if current user is a public session.
70 // In that case ARC should also be started if available, using the same
71 // authentication flow as ARC Kiosk mode.
72 bool IsPublicSessionMode();
hidehiko 2017/06/08 12:02:27 (Optional) Looks not ARC specific? I'm ok to keep
Sergey Poromov 2017/06/08 13:56:18 The check is not ARC specific, but is designed to
73
69 // Returns true if ARC is allowed for the given user. Note this should not be 74 // Returns true if ARC is allowed for the given user. Note this should not be
70 // used as a signal of whether ARC is allowed alone because it only considers 75 // used as a signal of whether ARC is allowed alone because it only considers
71 // user meta data. e.g. a user could be allowed for ARC but if the user signs in 76 // user meta data. e.g. a user could be allowed for ARC but if the user signs in
72 // as a secondary user or signs in to create a supervised user, ARC should be 77 // as a secondary user or signs in to create a supervised user, ARC should be
73 // disabled for such cases. 78 // disabled for such cases.
74 bool IsArcAllowedForUser(const user_manager::User* user); 79 bool IsArcAllowedForUser(const user_manager::User* user);
75 80
76 // Checks if opt-in verification was disabled by switch in command line. 81 // Checks if opt-in verification was disabled by switch in command line.
77 // In most cases, it is disabled for testing purpose. 82 // In most cases, it is disabled for testing purpose.
78 bool IsArcOptInVerificationDisabled(); 83 bool IsArcOptInVerificationDisabled();
79 84
80 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When 85 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When
81 // |window| is nullptr, returns false. 86 // |window| is nullptr, returns false.
82 bool IsArcAppWindow(aura::Window* window); 87 bool IsArcAppWindow(aura::Window* window);
83 88
84 // Adjusts the amount of CPU the ARC instance is allowed to use. When 89 // Adjusts the amount of CPU the ARC instance is allowed to use. When
85 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly 90 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly
86 // restricted CPU resources. 91 // restricted CPU resources.
87 void SetArcCpuRestriction(bool do_restrict); 92 void SetArcCpuRestriction(bool do_restrict);
88 93
89 } // namespace arc 94 } // namespace arc
90 95
91 #endif // COMPONENTS_ARC_ARC_UTIL_H_ 96 #endif // COMPONENTS_ARC_ARC_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698