[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 1 | |
| 2 | // Copyright 2023 The Chromium Authors |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | |
| 6 | #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_BROWSER_UTILS_H_ |
| 7 | #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_BROWSER_UTILS_H_ |
| 8 | |
Aga Wronska | e482265 | 2023-05-22 16:45:23 | [diff] [blame] | 9 | #include <string> |
| 10 | |
[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 11 | #include "content/public/browser/web_contents.h" |
| 12 | #include "url/gurl.h" |
| 13 | |
Duong Dac | e474915 | 2023-05-04 19:10:12 | [diff] [blame] | 14 | class ProfileSelections; |
Aga Wronska | e482265 | 2023-05-22 16:45:23 | [diff] [blame] | 15 | class Profile; |
Duong Dac | e474915 | 2023-05-04 19:10:12 | [diff] [blame] | 16 | |
[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 17 | namespace supervised_user { |
| 18 | |
Duong Dac | e474915 | 2023-05-04 19:10:12 | [diff] [blame] | 19 | // Returns true if both the extensions are enabled and the provided url is a |
| 20 | // Webstore or Download url. |
[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 21 | bool IsSupportedChromeExtensionURL(const GURL& effective_url); |
| 22 | |
Nohemi Fernandez | 0ff0640 | 2024-08-06 10:07:18 | [diff] [blame^] | 23 | // Returns true if the extension handling mode for skipping parent approval is |
| 24 | // enabled and the parent has authorized installing extensions without their |
| 25 | // approval. |
| 26 | // Returns false if the user is not supervised. |
| 27 | bool SupervisedUserCanSkipExtensionParentApprovals(const Profile* profile); |
| 28 | |
Liza Bipin | c8f3830 | 2024-08-02 08:39:55 | [diff] [blame] | 29 | // Returns true if the extensions permissions parental control is enabled |
| 30 | // for supervised users. |
| 31 | // Returns false if the user is not supervised. |
| 32 | bool AreExtensionsPermissionsEnabled(Profile* profile); |
| 33 | |
[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 34 | // Returns true if the parent allowlist should be skipped. |
| 35 | bool ShouldContentSkipParentAllowlistFiltering(content::WebContents* contents); |
| 36 | |
Duong Dac | e474915 | 2023-05-04 19:10:12 | [diff] [blame] | 37 | // Returns how supervised_user factories that are needed in Guest profile |
| 38 | // should be created. |
| 39 | ProfileSelections BuildProfileSelectionsForRegularAndGuest(); |
| 40 | |
Aga Wronska | e482265 | 2023-05-22 16:45:23 | [diff] [blame] | 41 | // Returns given name of the primary account associated with the profile. |
| 42 | std::string GetAccountGivenName(Profile& profile); |
| 43 | |
[email protected] | 503e292 | 2023-06-23 13:38:37 | [diff] [blame] | 44 | // Asserts that `is_child` matches the child status of the primary user. |
| 45 | // Terminates user session in case of status mismatch in order to prevent |
| 46 | // supervision incidents. Relevant on Chrome OS platform that has the concept |
| 47 | // of the user. |
| 48 | void AssertChildStatusOfTheUser(Profile* profile, bool is_child); |
| 49 | |
[email protected] | 6ff1c33 | 2023-03-08 10:01:47 | [diff] [blame] | 50 | } // namespace supervised_user |
| 51 | |
| 52 | #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_BROWSER_UTILS_H_ |