Commit 730e7724 authored by Roman Aleksandrov's avatar Roman Aleksandrov Committed by Commit Bot

Management WebUI: Add Crostini reporting

Add information to Transparency view about Crostini reporting.


Bug: 979286
Change-Id: I68ee9835ec92ae435f1f1c7670f3137828864ae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1685383Reviewed-by: default avatarThiemo Nagel <tnagel@chromium.org>
Reviewed-by: default avatarAlex Oldemeier <aoldemeier@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Roman Aleksandrov <raleksandrov@google.com>
Cr-Commit-Position: refs/heads/master@{#676373}
parent f7ca96ee
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<g id="report"><path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z"></path></g> <g id="report"><path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z"></path></g>
<g id="supervised-user"><path d="M11.99 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm3.61 6.34c1.07 0 1.93.86 1.93 1.93 0 1.07-.86 1.93-1.93 1.93-1.07 0-1.93-.86-1.93-1.93-.01-1.07.86-1.93 1.93-1.93zm-6-1.58c1.3 0 2.36 1.06 2.36 2.36 0 1.3-1.06 2.36-2.36 2.36s-2.36-1.06-2.36-2.36c0-1.31 1.05-2.36 2.36-2.36zm0 9.13v3.75c-2.4-.75-4.3-2.6-5.14-4.96 1.05-1.12 3.67-1.69 5.14-1.69.53 0 1.2.08 1.9.22-1.64.87-1.9 2.02-1.9 2.68zM11.99 20c-.27 0-.53-.01-.79-.04v-4.07c0-1.42 2.94-2.13 4.4-2.13 1.07 0 2.92.39 3.84 1.15-1.17 2.97-4.06 5.09-7.45 5.09z"></path></g> <g id="supervised-user"><path d="M11.99 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm3.61 6.34c1.07 0 1.93.86 1.93 1.93 0 1.07-.86 1.93-1.93 1.93-1.07 0-1.93-.86-1.93-1.93-.01-1.07.86-1.93 1.93-1.93zm-6-1.58c1.3 0 2.36 1.06 2.36 2.36 0 1.3-1.06 2.36-2.36 2.36s-2.36-1.06-2.36-2.36c0-1.31 1.05-2.36 2.36-2.36zm0 9.13v3.75c-2.4-.75-4.3-2.6-5.14-4.96 1.05-1.12 3.67-1.69 5.14-1.69.53 0 1.2.08 1.9.22-1.64.87-1.9 2.02-1.9 2.68zM11.99 20c-.27 0-.53-.01-.79-.04v-4.07c0-1.42 2.94-2.13 4.4-2.13 1.07 0 2.92.39 3.84 1.15-1.17 2.97-4.06 5.09-7.45 5.09z"></path></g>
<g id="timelapse"><path d="M16.24 7.76C15.07 6.59 13.54 6 12 6v6l-4.24 4.24c2.34 2.34 6.14 2.34 8.49 0 2.34-2.34 2.34-6.14-.01-8.48zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></g> <g id="timelapse"><path d="M16.24 7.76C15.07 6.59 13.54 6 12 6v6l-4.24 4.24c2.34 2.34 6.14 2.34 8.49 0 2.34-2.34 2.34-6.14-.01-8.48zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></g>
<g id="linux"><path d="M 6.9375 22.042969 C 3.867188 20.457031 1.886719 17.347656 1.824219 13.234375 C 1.527344 13.378906 1.1875 13.402344 0.800781 13.265625 C -0.3125 12.875 -0.0625 11.578125 0.34375 10.421875 C 0.683594 9.460938 1.835938 8.761719 2.402344 8.613281 C 3.71875 3.78125 6.804688 0 12 0 C 17.257812 0 20.367188 3.625 21.644531 8.628906 C 22.222656 8.796875 23.324219 9.484375 23.65625 10.421875 C 24.0625 11.578125 24.3125 12.875 23.199219 13.265625 C 22.8125 13.402344 22.472656 13.378906 22.175781 13.234375 C 22.117188 17.375 20.140625 20.472656 17.070312 22.046875 C 17.257812 22.191406 17.363281 22.375 17.363281 22.613281 C 17.363281 23.378906 17.75 24 14.898438 24 C 12.8125 24 12.457031 23.578125 12.417969 23.117188 C 12.28125 23.035156 12.140625 22.910156 12 22.910156 C 11.859375 22.910156 11.71875 23.042969 11.582031 23.128906 C 11.535156 23.582031 11.171875 24 9.101562 24 C 6.25 24 6.636719 23.378906 6.636719 22.613281 C 6.636719 22.371094 6.746094 22.183594 6.9375 22.042969 Z M 12 21.222656 C 17.929688 21.222656 20.070312 17.1875 20.070312 11.820312 C 20.070312 7.371094 18.125 3.28125 14.898438 2.597656 C 13.863281 2.378906 13.136719 4.761719 12 4.761719 C 10.863281 4.761719 10.035156 2.378906 9.101562 2.597656 C 5.863281 3.359375 3.929688 7.605469 3.929688 11.820312 C 3.929688 16.882812 6.070312 21.222656 12 21.222656 Z M 8.277344 9.324219 C 7.589844 9.324219 7.035156 8.789062 7.035156 8.132812 C 7.035156 7.476562 7.589844 6.941406 8.277344 6.941406 C 8.960938 6.941406 9.515625 7.476562 9.515625 8.132812 C 9.515625 8.789062 8.960938 9.324219 8.277344 9.324219 Z M 15.722656 9.324219 C 15.039062 9.324219 14.484375 8.789062 14.484375 8.132812 C 14.484375 7.476562 15.039062 6.941406 15.722656 6.941406 C 16.410156 6.941406 16.964844 7.476562 16.964844 8.132812 C 16.964844 8.789062 16.410156 9.324219 15.722656 9.324219 Z M 12.226562 9.964844 L 13.929688 10.683594 C 14.222656 10.804688 14.355469 11.132812 14.226562 11.414062 C 14.199219 11.46875 14.164062 11.519531 14.121094 11.5625 L 12.425781 13.308594 C 12.210938 13.535156 11.839844 13.546875 11.601562 13.339844 C 11.589844 13.332031 11.578125 13.320312 11.566406 13.308594 L 9.878906 11.558594 C 9.660156 11.332031 9.675781 10.980469 9.914062 10.773438 C 9.960938 10.734375 10.011719 10.703125 10.070312 10.679688 L 11.75 9.964844 C 11.898438 9.902344 12.074219 9.902344 12.226562 9.964844 Z M 12.226562 9.964844"></path></g>
</if> </if>
<g id="account-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"></path><path d="M0 0h24v24H0z" fill="none"></path></g> <g id="account-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"></path><path d="M0 0h24v24H0z" fill="none"></path></g>
<g id="public"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"></path></g> <g id="public"><path d="M0 0h24v24H0z" fill="none"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"></path></g>
......
...@@ -51,7 +51,8 @@ management.DeviceReportingType = { ...@@ -51,7 +51,8 @@ management.DeviceReportingType = {
STATISTIC: 'device statistics', STATISTIC: 'device statistics',
DEVICE: 'device', DEVICE: 'device',
LOGS: 'logs', LOGS: 'logs',
PRINT: 'print' PRINT: 'print',
CROSTINI: 'crostini'
}; };
......
...@@ -178,6 +178,8 @@ Polymer({ ...@@ -178,6 +178,8 @@ Polymer({
return 'management:report'; return 'management:report';
case management.DeviceReportingType.PRINT: case management.DeviceReportingType.PRINT:
return 'cr:print'; return 'cr:print';
case management.DeviceReportingType.CROSTINI:
return 'management:linux';
default: default:
return 'cr:computer'; return 'cr:computer';
} }
......
...@@ -58,6 +58,7 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) { ...@@ -58,6 +58,7 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) {
IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES}, IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES},
{kManagementReportUsers, IDS_MANAGEMENT_REPORT_DEVICE_USERS}, {kManagementReportUsers, IDS_MANAGEMENT_REPORT_DEVICE_USERS},
{kManagementPrinting, IDS_MANAGEMENT_REPORT_PRINTING}, {kManagementPrinting, IDS_MANAGEMENT_REPORT_PRINTING},
{kManagementCrostini, IDS_MANAGEMENT_CROSTINI},
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
{"browserReporting", IDS_MANAGEMENT_BROWSER_REPORTING}, {"browserReporting", IDS_MANAGEMENT_BROWSER_REPORTING},
{"browserReportingExplanation", {"browserReportingExplanation",
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "ui/base/webui/web_ui_util.h" #include "ui/base/webui/web_ui_util.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/policy_cert_service.h" #include "chrome/browser/chromeos/policy/policy_cert_service.h"
...@@ -117,6 +118,7 @@ const char kManagementReportNetworkInterfaces[] = ...@@ -117,6 +118,7 @@ const char kManagementReportNetworkInterfaces[] =
"managementReportNetworkInterfaces"; "managementReportNetworkInterfaces";
const char kManagementReportUsers[] = "managementReportUsers"; const char kManagementReportUsers[] = "managementReportUsers";
const char kManagementPrinting[] = "managementPrinting"; const char kManagementPrinting[] = "managementPrinting";
const char kManagementCrostini[] = "managementCrostini";
const char kAccountManagedInfo[] = "accountManagedInfo"; const char kAccountManagedInfo[] = "accountManagedInfo";
const char kDeviceManagedInfo[] = "deviceManagedInfo"; const char kDeviceManagedInfo[] = "deviceManagedInfo";
const char kOverview[] = "overview"; const char kOverview[] = "overview";
...@@ -153,7 +155,8 @@ enum class DeviceReportingType { ...@@ -153,7 +155,8 @@ enum class DeviceReportingType {
kDeviceStatistics, kDeviceStatistics,
kDevice, kDevice,
kLogs, kLogs,
kPrint kPrint,
kCrostini
}; };
// Corresponds to DeviceReportingType in management_browser_proxy.js // Corresponds to DeviceReportingType in management_browser_proxy.js
...@@ -171,6 +174,8 @@ std::string ToJSDeviceReportingType(const DeviceReportingType& type) { ...@@ -171,6 +174,8 @@ std::string ToJSDeviceReportingType(const DeviceReportingType& type) {
return "logs"; return "logs";
case DeviceReportingType::kPrint: case DeviceReportingType::kPrint:
return "print"; return "print";
case DeviceReportingType::kCrostini:
return "crostini";
default: default:
NOTREACHED() << "Unknown device reporting type"; NOTREACHED() << "Unknown device reporting type";
return "device"; return "device";
...@@ -232,6 +237,12 @@ void AddDeviceReportingInfo(base::Value* report_sources, Profile* profile) { ...@@ -232,6 +237,12 @@ void AddDeviceReportingInfo(base::Value* report_sources, Profile* profile) {
AddDeviceReportingElement(report_sources, kManagementPrinting, AddDeviceReportingElement(report_sources, kManagementPrinting,
DeviceReportingType::kPrint); DeviceReportingType::kPrint);
} }
if (profile->GetPrefs()->GetBoolean(
crostini::prefs::kReportCrostiniUsageEnabled)) {
AddDeviceReportingElement(report_sources, kManagementCrostini,
DeviceReportingType::kCrostini);
}
} }
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
......
...@@ -32,6 +32,7 @@ extern const char kManagementReportHardwareStatus[]; ...@@ -32,6 +32,7 @@ extern const char kManagementReportHardwareStatus[];
extern const char kManagementReportNetworkInterfaces[]; extern const char kManagementReportNetworkInterfaces[];
extern const char kManagementReportUsers[]; extern const char kManagementReportUsers[];
extern const char kManagementPrinting[]; extern const char kManagementPrinting[];
extern const char kManagementCrostini[];
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
extern const char kCloudReportingExtensionId[]; extern const char kCloudReportingExtensionId[];
......
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
<message name="IDS_MANAGEMENT_REPORT_PRINTING" desc="Message stating that administrators can see names of printed files."> <message name="IDS_MANAGEMENT_REPORT_PRINTING" desc="Message stating that administrators can see names of printed files.">
Names of files that you print Names of files that you print
</message> </message>
<message name="IDS_MANAGEMENT_CROSTINI" desc="Message stating that administrators can see Crostini usage">
Linux apps installed and when they were last used
</message>
</if> </if>
<!-- Strings related to extension reporting section of the management page --> <!-- Strings related to extension reporting section of the management page -->
......
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