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
|
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/enterprise/connectors/core/connectors_prefs.h"
#include <algorithm>
#include <string>
#include <vector>
#include "build/build_config.h"
#include "components/enterprise/buildflags/buildflags.h"
#include "components/enterprise/connectors/core/common.h"
#include "components/enterprise/connectors/core/service_provider_config.h"
#include "components/enterprise/device_trust/prefs.h"
#include "components/prefs/pref_registry_simple.h"
#if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
#include "components/enterprise/client_certificates/core/prefs.h"
#endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
namespace enterprise_connectors {
// Profile Prefs
const char kOnFileAttachedPref[] = "enterprise_connectors.on_file_attached";
const char kOnFileDownloadedPref[] = "enterprise_connectors.on_file_downloaded";
const char kOnBulkDataEntryPref[] = "enterprise_connectors.on_bulk_data_entry";
const char kOnPrintPref[] = "enterprise_connectors.on_print";
#if BUILDFLAG(IS_CHROMEOS)
const char kOnFileTransferPref[] = "enterprise_connectors.on_file_transfer";
#endif
const char kOnSecurityEventPref[] = "enterprise_connectors.on_security_event";
const char kOnFileAttachedScopePref[] =
"enterprise_connectors.scope.on_file_attached";
const char kOnFileDownloadedScopePref[] =
"enterprise_connectors.scope.on_file_downloaded";
const char kOnBulkDataEntryScopePref[] =
"enterprise_connectors.scope.on_bulk_data_entry";
const char kOnPrintScopePref[] = "enterprise_connectors.scope.on_print";
#if BUILDFLAG(IS_CHROMEOS)
const char kOnFileTransferScopePref[] =
"enterprise_connectors.scope.on_file_transfer";
#endif
const char kOnSecurityEventScopePref[] =
"enterprise_connectors.scope.on_security_event";
// Local State Prefs
const char kLatestCrashReportCreationTime[] =
"enterprise_connectors.latest_crash_report_creation_time";
const char kLatestTelomereReportCreationTime[] =
"enterprise_connectors.latest_telomere_report_creation_time";
void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(kEnterpriseRealTimeUrlCheckMode,
REAL_TIME_CHECK_DISABLED);
registry->RegisterIntegerPref(kEnterpriseRealTimeUrlCheckScope, 0);
registry->RegisterListPref(kOnSecurityEventPref);
registry->RegisterIntegerPref(kOnSecurityEventScopePref, 0);
registry->RegisterIntegerPref(kWatermarkStyleFillOpacityPref,
kWatermarkStyleFillOpacityDefault);
registry->RegisterIntegerPref(kWatermarkStyleOutlineOpacityPref,
kWatermarkStyleOutlineOpacityDefault);
registry->RegisterIntegerPref(kWatermarkStyleFontSizePref,
kWatermarkStyleFontSizeDefault);
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
registry->RegisterListPref(kOnFileAttachedPref);
registry->RegisterListPref(kOnFileDownloadedPref);
registry->RegisterListPref(kOnBulkDataEntryPref);
registry->RegisterListPref(kOnPrintPref);
#if BUILDFLAG(IS_CHROMEOS)
registry->RegisterListPref(kOnFileTransferPref);
#endif
registry->RegisterIntegerPref(kOnFileAttachedScopePref, 0);
registry->RegisterIntegerPref(kOnFileDownloadedScopePref, 0);
registry->RegisterIntegerPref(kOnBulkDataEntryScopePref, 0);
registry->RegisterIntegerPref(kOnPrintScopePref, 0);
#if BUILDFLAG(IS_CHROMEOS)
registry->RegisterIntegerPref(kOnFileTransferScopePref, 0);
#endif
RegisterDeviceTrustConnectorProfilePrefs(registry);
#if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
client_certificates::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
}
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
registry->RegisterInt64Pref(kLatestCrashReportCreationTime, 0);
registry->RegisterInt64Pref(kLatestTelomereReportCreationTime, 0);
#if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
client_certificates::RegisterLocalStatePrefs(registry);
#endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES)
}
} // namespace enterprise_connectors
|