1 // Copyright 2020 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.
5 #include "components/permissions/pref_names.h"
6 #include "components/permissions/permission_actions_history.h"
7 #include "components/pref_registry/pref_registry_syncable.h"
9 #include "build/build_config.h"
11 namespace permissions {
14 // List containing a history of past permission actions, for all permission
16 const char kPermissionActions[] = "profile.content_settings.permission_actions";
18 #if BUILDFLAG(IS_ANDROID)
19 // The current level of backoff for showing the location settings dialog for the
20 // default search engine.
21 const char kLocationSettingsBackoffLevelDSE[] =
22 "location_settings_backoff_level_dse";
24 // The current level of backoff for showing the location settings dialog for
25 // sites other than the default search engine.
26 const char kLocationSettingsBackoffLevelDefault[] =
27 "location_settings_backoff_level_default";
29 // The next time the location settings dialog can be shown for the default
31 const char kLocationSettingsNextShowDSE[] = "location_settings_next_show_dse";
33 // The next time the location settings dialog can be shown for sites other than
34 // the default search engine.
35 const char kLocationSettingsNextShowDefault[] =
36 "location_settings_next_show_default";
37 #else // BUILDFLAG(IS_ANDROID)
38 // The number of one time permission prompts a user has seen.
39 const char kOneTimePermissionPromptsDecidedCount[] =
40 "profile.one_time_permission_prompts_decided_count";
41 #endif // BUILDFLAG(IS_ANDROID)
43 // Boolean that specifies whether or not unused site permissions should be
44 // revoked by Safety Hub. It is used only when kSafetyHub flag is on.
45 // Conditioned because currently Safety Hub is available only on desktop.
46 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
47 const char kUnusedSitePermissionsRevocationEnabled[] =
48 "safety_hub.unused_site_permissions_revocation.enabled";
49 #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
52 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
53 PermissionActionsHistory::RegisterProfilePrefs(registry);
55 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
56 registry->RegisterBooleanPref(prefs::kUnusedSitePermissionsRevocationEnabled,
58 #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
61 } // namespace permissions