Commit d48d3261 authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Update chrome://management for Connectors

Context for those string changes can be found in the bug.
After this change the page will look like
http://screen/TMKxaozRA7m.png
when every Connector is enabled.

Bug: 1092559
Change-Id: I955dd062d464641add5fd332766f94fbe54b28c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254459
Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarYann Dago <ydago@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781297}
parent 7fb97788
......@@ -195,9 +195,9 @@
</div>
<table class="content-indented">
<tr>
<th class="protection-name">$i18n{extensionName}</th>
<th class="protection-name">$i18n{connectorEvent}</th>
<th class="protection-permissions">
$i18n{extensionPermissions}
$i18n{connectorVisibleData}
</th>
</tr>
<template is="dom-repeat"
......
......@@ -95,17 +95,21 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) {
{kManagementExtensionReportUserBrowsingData,
IDS_MANAGEMENT_EXTENSION_REPORT_USER_BROWSING_DATA},
{kThreatProtectionTitle, IDS_MANAGEMENT_THREAT_PROTECTION},
{kManagementDataLossPreventionName,
IDS_MANAGEMENT_DATA_LOSS_PREVENTION_NAME},
{kManagementDataLossPreventionPermissions,
IDS_MANAGEMENT_DATA_LOSS_PREVENTION_PERMISSIONS},
{kManagementMalwareScanningName, IDS_MANAGEMENT_MALWARE_SCANNING_NAME},
{kManagementMalwareScanningPermissions,
IDS_MANAGEMENT_MALWARE_SCANNING_PERMISSIONS},
{kManagementEnterpriseReportingName,
IDS_MANAGEMENT_ENTERPRISE_REPORTING_NAME},
{kManagementEnterpriseReportingPermissions,
IDS_MANAGEMENT_ENTERPRISE_REPORTING_PERMISSIONS},
{"connectorEvent", IDS_MANAGEMENT_CONNECTORS_EVENT},
{"connectorVisibleData", IDS_MANAGEMENT_CONNECTORS_VISIBLE_DATA},
{kManagementEnterpriseReportingEvent,
IDS_MANAGEMENT_ENTERPRISE_REPORTING_EVENT},
{kManagementEnterpriseReportingVisibleData,
IDS_MANAGEMENT_ENTERPRISE_REPORTING_VISIBLE_DATA},
{kManagementOnFileAttachedEvent, IDS_MANAGEMENT_FILE_ATTACHED_EVENT},
{kManagementOnFileAttachedVisibleData,
IDS_MANAGEMENT_FILE_ATTACHED_VISIBLE_DATA},
{kManagementOnFileDownloadedEvent, IDS_MANAGEMENT_FILE_DOWNLOADED_EVENT},
{kManagementOnFileDownloadedVisibleData,
IDS_MANAGEMENT_FILE_DOWNLOADED_VISIBLE_DATA},
{kManagementOnBulkDataEntryEvent, IDS_MANAGEMENT_TEXT_ENTERED_EVENT},
{kManagementOnBulkDataEntryVisibleData,
IDS_MANAGEMENT_TEXT_ENTERED_VISIBLE_DATA},
};
AddLocalizedStringsBulk(source, kLocalizedStrings);
......
......@@ -113,10 +113,21 @@ const char kManagementDataLossPreventionPermissions[] =
const char kManagementMalwareScanningName[] = "managementMalwareScanningName";
const char kManagementMalwareScanningPermissions[] =
"managementMalwareScanningPermissions";
const char kManagementEnterpriseReportingName[] =
"managementEnterpriseReportingName";
const char kManagementEnterpriseReportingPermissions[] =
"managementEnterpriseReportingPermissions";
const char kManagementEnterpriseReportingEvent[] =
"managementEnterpriseReportingEvent";
const char kManagementEnterpriseReportingVisibleData[] =
"managementEnterpriseReportingVisibleData";
const char kManagementOnFileAttachedEvent[] = "managementOnFileAttachedEvent";
const char kManagementOnFileAttachedVisibleData[] =
"managementOnFileAttachedVisibleData";
const char kManagementOnFileDownloadedEvent[] =
"managementOnFileDownloadedEvent";
const char kManagementOnFileDownloadedVisibleData[] =
"managementOnFileDownloadedVisibleData";
const char kManagementOnBulkDataEntryEvent[] = "managementOnBulkDataEntryEvent";
const char kManagementOnBulkDataEntryVisibleData[] =
"managementOnBulkDataEntryVisibleData";
const char kReportingTypeDevice[] = "device";
const char kReportingTypeExtensions[] = "extensions";
......@@ -682,41 +693,44 @@ base::Value ManagementUIHandler::GetThreatProtectionInfo(
const policy::PolicyService* policy_service = GetPolicyService();
const auto& chrome_policies = policy_service->GetPolicies(
policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string()));
// CheckContentCompliance is a int-enum policy. The accepted values are
// defined in the enum CheckContentComplianceValues.
auto* check_content_compliance_value =
chrome_policies.GetValue(policy::key::kCheckContentCompliance);
if (check_content_compliance_value &&
check_content_compliance_value->GetInt() > safe_browsing::CHECK_NONE &&
check_content_compliance_value->GetInt() <=
safe_browsing::CHECK_CONTENT_COMPLIANCE_MAX) {
auto* on_file_attached =
chrome_policies.GetValue(policy::key::kOnFileAttachedEnterpriseConnector);
if (on_file_attached && on_file_attached->is_list() &&
!on_file_attached->GetList().empty()) {
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementOnFileAttachedEvent);
value.SetStringKey("permission", kManagementOnFileAttachedVisibleData);
info.Append(std::move(value));
}
auto* on_file_downloaded = chrome_policies.GetValue(
policy::key::kOnFileDownloadedEnterpriseConnector);
if (on_file_downloaded && on_file_downloaded->is_list() &&
!on_file_downloaded->GetList().empty()) {
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementDataLossPreventionName);
value.SetStringKey("permission", kManagementDataLossPreventionPermissions);
value.SetStringKey("title", kManagementOnFileDownloadedEvent);
value.SetStringKey("permission", kManagementOnFileDownloadedVisibleData);
info.Append(std::move(value));
}
// SendFilesForMalwareCheck is a int-enum policy. The accepted values are
// defined in the enum SendFilesForMalwareCheckValues.
auto* send_files_for_malware_check_value =
chrome_policies.GetValue(policy::key::kSendFilesForMalwareCheck);
if (send_files_for_malware_check_value &&
send_files_for_malware_check_value->GetInt() >
safe_browsing::DO_NOT_SCAN &&
send_files_for_malware_check_value->GetInt() <=
safe_browsing::SEND_FILES_FOR_MALWARE_CHECK_MAX) {
auto* on_bulk_data_entry = chrome_policies.GetValue(
policy::key::kOnBulkDataEntryEnterpriseConnector);
if (on_bulk_data_entry && on_bulk_data_entry->is_list() &&
!on_bulk_data_entry->GetList().empty()) {
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementMalwareScanningName);
value.SetStringKey("permission", kManagementMalwareScanningPermissions);
value.SetStringKey("title", kManagementOnBulkDataEntryEvent);
value.SetStringKey("permission", kManagementOnBulkDataEntryVisibleData);
info.Append(std::move(value));
}
auto* unsafe_event_reporting_value =
chrome_policies.GetValue(policy::key::kUnsafeEventsReportingEnabled);
if (unsafe_event_reporting_value && unsafe_event_reporting_value->GetBool()) {
auto* on_security_event = chrome_policies.GetValue(
policy::key::kOnSecurityEventEnterpriseConnector);
if (on_security_event && on_security_event->is_list() &&
!on_security_event->GetList().empty()) {
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementEnterpriseReportingName);
value.SetStringKey("permission", kManagementEnterpriseReportingPermissions);
value.SetStringKey("title", kManagementEnterpriseReportingEvent);
value.SetStringKey("permission", kManagementEnterpriseReportingVisibleData);
info.Append(std::move(value));
}
......
......@@ -59,8 +59,14 @@ extern const char kManagementDataLossPreventionName[];
extern const char kManagementDataLossPreventionPermissions[];
extern const char kManagementMalwareScanningName[];
extern const char kManagementMalwareScanningPermissions[];
extern const char kManagementEnterpriseReportingName[];
extern const char kManagementEnterpriseReportingPermissions[];
extern const char kManagementEnterpriseReportingEvent[];
extern const char kManagementEnterpriseReportingVisibleData[];
extern const char kManagementOnFileAttachedEvent[];
extern const char kManagementOnFileAttachedVisibleData[];
extern const char kManagementOnFileDownloadedEvent[];
extern const char kManagementOnFileDownloadedVisibleData[];
extern const char kManagementOnBulkDataEntryEvent[];
extern const char kManagementOnBulkDataEntryVisibleData[];
extern const char kPolicyKeyReportMachineIdData[];
extern const char kPolicyKeyReportUserIdData[];
......
......@@ -7,6 +7,7 @@
#include <string>
#include "base/files/file_path.h"
#include "base/json/json_reader.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/utf_string_conversions.h"
......@@ -242,19 +243,29 @@ class ManagementUIHandlerTests : public TestingBaseClass {
std::make_unique<base::Value>(true), nullptr);
}
void SetPolicyValue(const char* policy_key,
policy::PolicyMap& policies,
int value) {
int value,
policy::PolicyMap& policies) {
policies.Set(policy_key, policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD,
std::make_unique<base::Value>(value), nullptr);
}
void SetPolicyValue(const char* policy_key,
policy::PolicyMap& policies,
bool value) {
bool value,
policy::PolicyMap& policies) {
policies.Set(policy_key, policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD,
std::make_unique<base::Value>(value), nullptr);
}
void SetConnectorPolicyValue(const char* policy_key,
const std::string& value,
policy::PolicyMap& policies) {
auto policy_value = base::JSONReader::Read(value);
EXPECT_TRUE(policy_value.has_value());
policies.Set(policy_key, policy::POLICY_LEVEL_MANDATORY,
policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD,
std::make_unique<base::Value>(std::move(policy_value.value())),
nullptr);
}
base::string16 ExtractPathFromDict(const base::Value& data,
const std::string path) {
......@@ -918,7 +929,7 @@ TEST_F(ManagementUIHandlerTests, CloudReportingPolicy) {
policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string());
EXPECT_CALL(policy_service_, GetPolicies(_))
.WillRepeatedly(ReturnRef(chrome_policies));
SetPolicyValue(policy::key::kCloudReportingEnabled, chrome_policies, true);
SetPolicyValue(policy::key::kCloudReportingEnabled, true, chrome_policies);
const std::set<std::string> expected_messages = {
kManagementExtensionReportMachineName, kManagementExtensionReportUsername,
......@@ -1020,10 +1031,15 @@ TEST_F(ManagementUIHandlerTests, ThreatReportingInfo) {
base::UTF8ToUTF16(*threat_protection_info->FindStringKey("description")));
// When policies are set to uninteresting values, nothing to report.
SetPolicyValue(policy::key::kCheckContentCompliance, chrome_policies, 0);
SetPolicyValue(policy::key::kSendFilesForMalwareCheck, chrome_policies, 0);
SetPolicyValue(policy::key::kUnsafeEventsReportingEnabled, chrome_policies,
false);
SetConnectorPolicyValue(policy::key::kOnFileAttachedEnterpriseConnector, "[]",
chrome_policies);
SetConnectorPolicyValue(policy::key::kOnFileDownloadedEnterpriseConnector,
"[]", chrome_policies);
SetConnectorPolicyValue(policy::key::kOnBulkDataEntryEnterpriseConnector,
"[]", chrome_policies);
SetConnectorPolicyValue(policy::key::kOnSecurityEventEnterpriseConnector,
"[]", chrome_policies);
info = handler_.GetThreatProtectionInfo(profile_known_domain.get());
info.GetAsDictionary(&threat_protection_info);
EXPECT_TRUE(threat_protection_info->FindListKey("info")->GetList().empty());
......@@ -1032,13 +1048,22 @@ TEST_F(ManagementUIHandlerTests, ThreatReportingInfo) {
base::UTF8ToUTF16(*threat_protection_info->FindStringKey("description")));
// When policies are set to values that enable the feature, report it.
SetPolicyValue(policy::key::kCheckContentCompliance, chrome_policies, 1);
SetPolicyValue(policy::key::kSendFilesForMalwareCheck, chrome_policies, 2);
SetPolicyValue(policy::key::kUnsafeEventsReportingEnabled, chrome_policies,
true);
SetConnectorPolicyValue(policy::key::kOnFileAttachedEnterpriseConnector,
"[{\"service_provider\":\"google\"}]",
chrome_policies);
SetConnectorPolicyValue(policy::key::kOnFileDownloadedEnterpriseConnector,
"[{\"service_provider\":\"google\"}]",
chrome_policies);
SetConnectorPolicyValue(policy::key::kOnBulkDataEntryEnterpriseConnector,
"[{\"service_provider\":\"google\"}]",
chrome_policies);
SetConnectorPolicyValue(policy::key::kOnSecurityEventEnterpriseConnector,
"[{\"service_provider\":\"google\"}]",
chrome_policies);
info = handler_.GetThreatProtectionInfo(profile_no_domain.get());
info.GetAsDictionary(&threat_protection_info);
EXPECT_EQ(3u, threat_protection_info->FindListKey("info")->GetList().size());
EXPECT_EQ(4u, threat_protection_info->FindListKey("info")->GetList().size());
EXPECT_EQ(
l10n_util::GetStringUTF16(IDS_MANAGEMENT_THREAT_PROTECTION_DESCRIPTION),
base::UTF8ToUTF16(*threat_protection_info->FindStringKey("description")));
......@@ -1046,20 +1071,26 @@ TEST_F(ManagementUIHandlerTests, ThreatReportingInfo) {
base::Value expected_info(base::Value::Type::LIST);
{
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementDataLossPreventionName);
value.SetStringKey("permission", kManagementDataLossPreventionPermissions);
value.SetStringKey("title", kManagementOnFileAttachedEvent);
value.SetStringKey("permission", kManagementOnFileAttachedVisibleData);
expected_info.Append(std::move(value));
}
{
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementOnFileDownloadedEvent);
value.SetStringKey("permission", kManagementOnFileDownloadedVisibleData);
expected_info.Append(std::move(value));
}
{
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementMalwareScanningName);
value.SetStringKey("permission", kManagementMalwareScanningPermissions);
value.SetStringKey("title", kManagementOnBulkDataEntryEvent);
value.SetStringKey("permission", kManagementOnBulkDataEntryVisibleData);
expected_info.Append(std::move(value));
}
{
base::Value value(base::Value::Type::DICTIONARY);
value.SetStringKey("title", kManagementEnterpriseReportingName);
value.SetStringKey("permission", kManagementEnterpriseReportingPermissions);
value.SetStringKey("title", kManagementEnterpriseReportingEvent);
value.SetStringKey("permission", kManagementEnterpriseReportingVisibleData);
expected_info.Append(std::move(value));
}
......
......@@ -48,10 +48,10 @@
<!-- Browser managed status section -->
<if expr="not chromeos">
<message name="IDS_MANAGEMENT_BROWSER_NOTICE" desc="Message shown when the browser is managed, it indicates what the administrator can do on the browser.">
Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Chrome. <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Learn More<ph name="END_LINK">&lt;/a&gt;</ph>
Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Chrome. <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;</ph>
</message>
<message name="IDS_MANAGEMENT_NOT_MANAGED_NOTICE" desc="Message indicating that the browser is not managed">
This browser is not managed by a company or other organization. Activity on this device may be managed outside of Chrome. <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Learn More<ph name="END_LINK">&lt;/a&gt;</ph>
This browser is not managed by a company or other organization. Activity on this device may be managed outside of Chrome. <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>Learn more<ph name="END_LINK">&lt;/a&gt;</ph>
</message>
</if>
......@@ -178,27 +178,39 @@
Chrome Enterprise Connectors
</message>
<message name="IDS_MANAGEMENT_THREAT_PROTECTION_DESCRIPTION" desc="Description of the Chrome Enterprise Connectors section of the page">
Your administrator has enabled Chrome Enterprise Connectors on your browser. These connectors have access to some of your data.
Your administrator has turned on Chrome Enterprise Connectors on your browser. These connectors have access to some of your data.
</message>
<message name="IDS_MANAGEMENT_THREAT_PROTECTION_DESCRIPTION_BY" desc="Description of the Chrome Enterprise Connectors section of the page">
<ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph> has enabled Chrome Enterprise Connectors on your browser. These connectors have access to some of your data.
<ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph> has turned on Chrome Enterprise Connectors on your browser. These connectors have access to some of your data.
</message>
<message name="IDS_MANAGEMENT_DATA_LOSS_PREVENTION_NAME" desc="Name for the data loss prevention feature">
Data Loss Prevention
<message name="IDS_MANAGEMENT_CONNECTORS_EVENT" desc="Title of a column of the Connectors table showing the event that triggers a Connector">
Event
</message>
<message name="IDS_MANAGEMENT_DATA_LOSS_PREVENTION_PERMISSIONS" desc="Permissions description for the data loss prevention feature. The part that says 'that you download or upload in Chrome' applies only to files, not the clipboard">
Scan the contents of the clipboard, as well as files that you download or upload in Chrome.
<message name="IDS_MANAGEMENT_CONNECTORS_VISIBLE_DATA" desc="Title of a column of the Connectors table showing the data visible to a Connector">
Visible data
</message>
<message name="IDS_MANAGEMENT_MALWARE_SCANNING_NAME" desc="Name for the malware scanning feature">
Malware Scanning
<message name="IDS_MANAGEMENT_FILE_ATTACHED_EVENT" desc="Event for the file attachment scanning feature.">
File is attached
</message>
<message name="IDS_MANAGEMENT_MALWARE_SCANNING_PERMISSIONS" desc="Permissions description for the malware scanning feature">
Scan files that you download or upload in Chrome.
<message name="IDS_MANAGEMENT_FILE_DOWNLOADED_EVENT" desc="Event for the file download scanning feature.">
File is downloaded
</message>
<message name="IDS_MANAGEMENT_ENTERPRISE_REPORTING_NAME" desc="Name for the enterprise reporting feature">
Enterprise Reporting
<message name="IDS_MANAGEMENT_TEXT_ENTERED_EVENT" desc="Event for the text entry scanning feature.">
Text is entered
</message>
<message name="IDS_MANAGEMENT_ENTERPRISE_REPORTING_PERMISSIONS" desc="Permissions description for the enterprise reporting feature">
Share data about security events that have been flagged by Chrome Enterprise Connectors with your administrator. This may include URLs of pages you visit, file names or metadata, and the username you use to sign in to your device and Chrome.
<message name="IDS_MANAGEMENT_ENTERPRISE_REPORTING_EVENT" desc="Event for the enterprise reporting feature">
Unsafe event occurs
</message>
<message name="IDS_MANAGEMENT_FILE_ATTACHED_VISIBLE_DATA" desc="Description of the visible data for the file attachment scanning feature.">
Files you upload or attach are sent to Google Cloud or third parties for analysis. For example, they might be scanned for sensitive data or malware.
</message>
<message name="IDS_MANAGEMENT_FILE_DOWNLOADED_VISIBLE_DATA" desc="Description of the visible data for the file download scanning feature.">
Files you download are sent to Google Cloud or third parties for analysis. For example, they might be scanned for sensitive data or malware.
</message>
<message name="IDS_MANAGEMENT_TEXT_ENTERED_VISIBLE_DATA" desc="Description of the visible data for the text entry scanning feature.">
Text you paste or attach is sent to Google Cloud or third parties for analysis. For example, it might be scanned for sensitive data.
</message>
<message name="IDS_MANAGEMENT_ENTERPRISE_REPORTING_VISIBLE_DATA" desc="Description of the visible data for the Connectors reporting feature">
When security events are flagged by Chrome Enterprise Connectors, relevant data about the event is sent to your administrator. This can include URLs of pages you visit in Chrome, file names or metadata, and the username that you use to sign in to your device and Chrome.
</message>
</grit-part>
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
41e9b241d5925a357d906c76fec5e8c25af5f062
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
5505d954ef9c93b2b717d4d3bb7e3de3a55fb778
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
5505d954ef9c93b2b717d4d3bb7e3de3a55fb778
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
5505d954ef9c93b2b717d4d3bb7e3de3a55fb778
\ No newline at end of file
fe07e19a701b3e8ee95eb5062063ac53cfdbe4f3
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment