blob: 490824080637360851efc92d17ae18e71c469fed [file] [log] [blame]
Jason Hua06a229e2024-05-04 01:40:061// Copyright 2024 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Radu Nitescue47d5712024-07-12 10:29:025#ifndef COMPONENTS_LENS_LENS_OVERLAY_PERMISSION_UTILS_H_
6#define COMPONENTS_LENS_LENS_OVERLAY_PERMISSION_UTILS_H_
Jason Hua06a229e2024-05-04 01:40:067
8class PrefService;
9
10namespace syncer {
11class SyncService;
12} // namespace syncer
13
Mohamad Ahmadieb5d1222024-05-06 17:12:4314namespace user_prefs {
15class PrefRegistrySyncable;
16} // namespace user_prefs
17
Jason Hua06a229e2024-05-04 01:40:0618namespace lens {
Mohamad Ahmadieb5d1222024-05-06 17:12:4319namespace prefs {
20
Justin Donnellyd4704342024-05-28 20:32:2621// The possible values for the Lens Overlay enterprise policy. The value is an
22// integer rather than a boolean to allow for additional states to be added in
23// the future.
24enum class LensOverlaySettingsPolicyValue {
25 kEnabled = 0,
26 kDisabled = 1,
27};
28
29// An integer setting indicating whether the Lens Overlay feature is enabled or
30// disabled by the 'LensOverlaySettings' enterprise policy.
31inline constexpr char kLensOverlaySettings[] =
32 "lens.policy.lens_overlay_settings";
33
Duncan Mercer24c4edf2024-11-08 23:07:3934// The possible values for the GenAI Lens Overlay enterprise policy. Currently,
35// 0 and 1 are treated the same, since no server-side logging is done for the
36// Lens Overlay. If this changes in the future, and the server needs to
37// log, this policy will control whether logging is allowed for a request.
38enum class GenAiLensOverlaySettingsPolicyValue {
39 kAllowed = 0,
40 kAllowedWithoutLogging = 1,
41 kDisabled = 2,
42};
43
44// An integer setting indicating whether the Lens Overlay feature is enabled or
45// disabled by the 'GenAiLensOverlaySettings' enterprise policy. This policy
46// deprecated the old kLensOverlaySettings policy above.
47inline constexpr char kGenAiLensOverlaySettings[] =
48 "lens.policy.gen_ai_lens_overlay_settings";
49
Mohamad Ahmadieb5d1222024-05-06 17:12:4350// A boolean indicating whether the whether the user has permitted sharing page
51// screenshot with the Lens Overlay server.
52inline constexpr char kLensSharingPageScreenshotEnabled[] =
53 "lens.sharing_page_screenshot.enabled";
54
Nihar Majmudar12008212024-10-09 16:53:5355// A boolean indicating whether the whether the user has permitted sharing page
56// content with the Lens Overlay server. Used for the contextual searchbox.
57inline constexpr char kLensSharingPageContentEnabled[] =
58 "lens.sharing_page_content.enabled";
59
Mohamad Ahmadieb5d1222024-05-06 17:12:4360// Registers the prefs used by the Lens Overlay.
61void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
62
63} // namespace prefs
64
65// Returns true if the user, i.e., the local, current profile, is permitted to
66// share the the page screenshot with the Lens Overlay server.
67bool CanSharePageScreenshotWithLensOverlay(PrefService* pref_service);
Jason Hua06a229e2024-05-04 01:40:0668
69// Returns true if the user, i.e., the local, current profile, is permitted to
Nihar Majmudar12008212024-10-09 16:53:5370// share the the page context with the Lens Overlay server.
71bool CanSharePageContentWithLensOverlay(PrefService* pref_service);
72
73// Returns true if the user, i.e., the local, current profile, is permitted to
74// share the the page URL with the the Lens Overlay server. This can be through
75// MSBB or accepting the CSB permission bubble, which informs the user about
76// sharing the page URL.
Jason Hua06a229e2024-05-04 01:40:0677bool CanSharePageURLWithLensOverlay(PrefService* pref_service);
78
79// Returns true if the user, i.e., the local, current profile, is permitted to
80// share the information about the page title with the the Lens Overlay server.
Nihar Majmudar12008212024-10-09 16:53:5381// This can be through history sync or accepting the CSB permission bubble,
82// which informs the user about sharing the page title.
83bool CanSharePageTitleWithLensOverlay(syncer::SyncService* sync_service,
84 PrefService* pref_service);
Jason Hua06a229e2024-05-04 01:40:0685
86} // namespace lens
87
Radu Nitescue47d5712024-07-12 10:29:0288#endif // COMPONENTS_LENS_LENS_OVERLAY_PERMISSION_UTILS_H_