blob: 2fa9c8d438d24227ee131158086dd2835c59905b [file] [log] [blame]
[email protected]6ff1c332023-03-08 10:01:471
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 Wronskae4822652023-05-22 16:45:239#include <string>
10
[email protected]6ff1c332023-03-08 10:01:4711#include "content/public/browser/web_contents.h"
12#include "url/gurl.h"
13
Duong Dace4749152023-05-04 19:10:1214class ProfileSelections;
Aga Wronskae4822652023-05-22 16:45:2315class Profile;
Duong Dace4749152023-05-04 19:10:1216
[email protected]6ff1c332023-03-08 10:01:4717namespace supervised_user {
18
Duong Dace4749152023-05-04 19:10:1219// Returns true if both the extensions are enabled and the provided url is a
20// Webstore or Download url.
[email protected]6ff1c332023-03-08 10:01:4721bool IsSupportedChromeExtensionURL(const GURL& effective_url);
22
Liza Bipinc8f38302024-08-02 08:39:5523// Returns true if the extensions permissions parental control is enabled
24// for supervised users.
25// Returns false if the user is not supervised.
26bool AreExtensionsPermissionsEnabled(Profile* profile);
27
[email protected]6ff1c332023-03-08 10:01:4728// Returns true if the parent allowlist should be skipped.
29bool ShouldContentSkipParentAllowlistFiltering(content::WebContents* contents);
30
Duong Dace4749152023-05-04 19:10:1231// Returns how supervised_user factories that are needed in Guest profile
32// should be created.
33ProfileSelections BuildProfileSelectionsForRegularAndGuest();
34
Aga Wronskae4822652023-05-22 16:45:2335// Returns given name of the primary account associated with the profile.
36std::string GetAccountGivenName(Profile& profile);
37
[email protected]503e292c2023-06-23 13:38:3738// Asserts that `is_child` matches the child status of the primary user.
39// Terminates user session in case of status mismatch in order to prevent
40// supervision incidents. Relevant on Chrome OS platform that has the concept
41// of the user.
42void AssertChildStatusOfTheUser(Profile* profile, bool is_child);
43
[email protected]6ff1c332023-03-08 10:01:4744} // namespace supervised_user
45
46#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_BROWSER_UTILS_H_