1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
|
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SUPERVISED_USER_CORE_COMMON_SUPERVISED_USER_CONSTANTS_H_
#define COMPONENTS_SUPERVISED_USER_CORE_COMMON_SUPERVISED_USER_CONSTANTS_H_
#include "base/files/file_path.h"
#include "ui/base/page_transition_types.h"
namespace supervised_user {
// The result of local web approval flow.
// Used for metrics. Those values are logged to UMA. Entries should not be
// renumbered and numeric values should never be reused.
// LINT.IfChange(LocalApprovalResult)
enum class LocalApprovalResult {
// The parent has locally approved the website.
kApproved = 0,
// The parent has explicitly declined the approval.
kDeclined = 1,
// The local web approval is canceled without user intervention.
kCanceled = 2,
// The local web approval is interrupted due to an error, e.g. parsing error
// or unexpected `result` from the server.
kError = 3,
// Deprecated kMalformedPacpResult = 4,
kMaxValue = kError
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:FamilyLinkUserLocalWebApprovalResult)
// Used for metrics. These values are logged to UMA. Entries should not be
// renumbered and numeric values should never be reused.
// LINT.IfChange(ParentAccessWidgetError)
enum class ParentAccessWidgetError {
kOAuthError = 0,
kDelegateNotAvailable = 1,
kDecodingError = 2,
kParsingError = 3,
kUnknownCallback = 4,
kMaxValue = kUnknownCallback
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:FamilyLinkUserParentAccessWidgetError)
// Type of error that was encountered during a local web approval flow.
// Used for metrics. Those values are logged to UMA. Entries should not be
// renumbered and numeric values should never be reused.
// LINT.IfChange(LocalWebApprovalErrorType)
enum class LocalWebApprovalErrorType : int {
kFailureToDecodePacpResponse = 0,
kFailureToParsePacpResponse = 1,
kUnexpectedPacpResponse = 2,
kPacpTimeoutExceeded = 3,
kPacpEmptyResponse = 4,
kMaxValue = kPacpEmptyResponse
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:LocalWebApprovalErrorType)
// Describes the current web filter type, which is derived either from Family
// Link or local settings. The URL filter is present whenever the supervised
// user service is in use, and consequently offers "disabled" state for those
// who are not subject to parental controls.
// Entries must not be renumbered and numeric values should never be reused.
// LINT.IfChange(FamilyLinkWebFilterType)
enum class WebFilterType {
// The web filter is set to "Allow all sites".
kAllowAllSites = 0,
// The web filter is set to "Try to block mature sites".
kTryToBlockMatureSites = 1,
// The web filter is set to "Only allow certain sites".
kCertainSites = 2,
// Used for UMA only. There are multiple web filters on the device.
kMixed = 3,
// Web filter is neutralized: it behaves as if there were no filtering and is
// not recording metrics.
kDisabled = 4,
// Used for UMA. Update kMaxValue to the last value. Add future entries
// above this comment. Sync with enums.xml.
kMaxValue = kDisabled,
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:FamilyLinkWebFilterType)
// Returns the string equivalent of a Web Filter type. This is a user-visible
// string included in the user feedback log.
std::string WebFilterTypeToDisplayString(WebFilterType web_filter_type);
// Declaration for gtest: defining in prod code is not required.
void PrintTo(const WebFilterType& web_filter_type, std::ostream* os);
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
//
// LINT.IfChange(ToggleState)
enum class ToggleState {
kDisabled = 0,
kEnabled = 1,
kMixed = 2,
kMaxValue = kMixed,
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:SupervisedUserToggleState)
// These values corresponds to SupervisedUserSafetyFilterResult in
// tools/metrics/histograms/enums.xml. If you change anything here, make
// sure to also update enums.xml accordingly.
enum SupervisedUserSafetyFilterResult {
FILTERING_BEHAVIOR_ALLOW = 1,
FILTERING_BEHAVIOR_ALLOW_UNCERTAIN = 2,
FILTERING_BEHAVIOR_BLOCK_DENYLIST = 3, // deprecated
FILTERING_BEHAVIOR_BLOCK_SAFESITES = 4,
FILTERING_BEHAVIOR_BLOCK_MANUAL = 5,
FILTERING_BEHAVIOR_BLOCK_DEFAULT = 6,
FILTERING_BEHAVIOR_ALLOW_ALLOWLIST = 7, // deprecated
FILTERING_BEHAVIOR_MAX = FILTERING_BEHAVIOR_ALLOW_ALLOWLIST
};
// Indicates why the filtering was issued.
// LINT.IfChange(top_level_filtering_context)
enum class FilteringContext : int {
// Default setting used if filtering context is not explicitly specified
// (eg. for tools in chrome:// internal pages).
kDefault = 0,
// Use for filtering triggered by content::NavigationThrottle events.
kNavigationThrottle = 1,
// Use for filtering triggered by content::WebContentsObserver events.
kNavigationObserver = 2,
// Use for filtering triggered by changes to Family Link.
kFamilyLinkSettingsUpdated = 3
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/histograms.xml:top_level_filtering_context)
// LINT.IfChange(top_level_filtering_result)
// This enum, together with `::FilteringContext`, constitutes value for the
// `ManagedUser.TopLevelFilteringResult` histogram: value = context * spacing +
// result (spacing is 100).
enum class SupervisedUserFilterTopLevelResult : int {
// A parent has explicitly allowed the domain on the allowlist or all sites
// are allowed through parental controls.
kAllow = 0,
// Site is blocked by the safe sites filter
kBlockSafeSites = 1,
// Sites that were blocked due to being on the blocklist
kBlockManual = 2,
// Sites are blocked by default when the "Only allow certain sites" setting is
// enabled for the supervised user. Sites on the allowlist are not blocked.
kBlockNotInAllowlist = 3,
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/families/enums.xml:top_level_filtering_result)
// Constants used by SupervisedUserURLFilter::RecordFilterResultEvent.
extern const int kHistogramFilteringBehaviorSpacing;
extern const int kSupervisedUserURLFilteringResultHistogramMax;
int GetHistogramValueForTransitionType(ui::PageTransition transition_type);
// Keys for supervised user settings. These are configured remotely and mapped
// to preferences by the SupervisedUserPrefStore.
extern const char kAuthorizationHeader[];
extern const char kCameraMicDisabled[];
extern const char kContentPackDefaultFilteringBehavior[];
extern const char kContentPackManualBehaviorHosts[];
extern const char kContentPackManualBehaviorURLs[];
extern const char kCookiesAlwaysAllowed[];
extern const char kGeolocationDisabled[];
extern const char kSafeSitesEnabled[];
extern const char kSigninAllowed[];
extern const char kSigninAllowedOnNextStartup[];
extern const char kSkipParentApprovalToInstallExtensions[];
// A special supervised user ID used for child accounts.
extern const char kChildAccountSUID[];
// A special supervised user ID used for self-managed supervised profiles.
extern const char kSupervisedProfileSUID[];
// Keys for supervised user shared settings. These can be configured remotely or
// SupervisedUserPrefMappingService.
extern const char kChromeAvatarIndex[];
extern const char kChromeOSAvatarIndex[];
extern const char kChromeOSPasswordData[];
// A group of preferences of both primary and secondary custodians.
extern const char* const kCustodianInfoPrefs[10];
// Filenames.
extern const base::FilePath::CharType kSupervisedUserSettingsFilename[];
extern const char kSyncGoogleDashboardURL[];
// Histogram name to log FamilyLink user type segmentation.
extern const char kFamilyLinkUserLogSegmentHistogramName[];
// Histogram name to log Family Link user web filter type segmentation.
// This filter only applies to supervised user accounts.
extern const char kFamilyLinkUserLogSegmentWebFilterHistogramName[];
// Histogram name to log Family Link site permissions toggle state.
extern const char kSitesMayRequestCameraMicLocationHistogramName[];
// Histogram name to log Family Link extensions permissions toggle state.
extern const char kSkipParentApprovalToInstallExtensionsHistogramName[];
// Histogram name to log URL filtering results with reason for filter and page
// transition.
extern const char kSupervisedUserURLFilteringResultHistogramName[];
// Histogram name to log top level URL filtering results with reason for filter
extern const char kSupervisedUserTopLevelURLFilteringResultHistogramName[];
// Histogram name to log top level URL filtering results with reason for filter,
// for use in the navigation throttle context.
extern const char kSupervisedUserTopLevelURLFilteringResult2HistogramName[];
// Histogram name to log the result of a local url approval request.
extern const char kLocalWebApprovalResultHistogramName[];
// The URL which the "Managed by your parent" UI links to.
extern const char kManagedByParentUiMoreInfoUrl[];
// The url that displays a user's Family info.
// The navigations in the via PACP widget redirect to this url.
extern const char kFamilyManagementUrl[];
// The string used to denote an account that does not have a family member role.
extern const char kDefaultEmptyFamilyMemberRole[];
// Feedback source name for family member role in Family Link.
extern const char kFamilyMemberRoleFeedbackTag[];
// Histogram name to track throttle's headroom before its decision was required.
extern const char kClassifiedEarlierThanContentResponseHistogramName[];
// Histogram name to track how much throttle delayed the navigation.
extern const char kClassifiedLaterThanContentResponseHistogramName[];
// Histogram name to track intermediate throttle states.
extern const char kClassifyUrlThrottleStatusHistogramName[];
// Histogram name to track the final throttle verdict.
extern const char kClassifyUrlThrottleFinalStatusHistogramName[];
// Histogram name to track the duration of successful local web approval flows,
// in milliseconds.
extern const char kLocalWebApprovalDurationMillisecondsHistogramName[];
// Histogram name to track the different error types that may occur during the
// local web approval flow.
extern const char kLocalWebApprovalErrorTypeHistogramName[];
// Name of the Android's secure setting to observe the content filters.
extern const char kBrowserContentFiltersSettingName[];
extern const char kSearchContentFiltersSettingName[];
// Url for the help center article about content filters.
extern const char kDeviceFiltersHelpCenterUrl[];
} // namespace supervised_user
#endif // COMPONENTS_SUPERVISED_USER_CORE_COMMON_SUPERVISED_USER_CONSTANTS_H_
|