File: connectors_prefs.cc

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (104 lines) | stat: -rw-r--r-- 4,237 bytes parent folder | download | duplicates (3)
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