Add a privacy disclosure to chrome://management page about managed sites
This CL adds a list of websites to which a managed configuration provided by the admin was applied to the Chrome User Transparency page. This ensures user awareness about admin-provided data being sent to the website. Bug: 1194579 Change-Id: I8c16b5566b83340b3bedc9bd3a0bfa9a8cfad2c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2799713 Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Anqing Zhao <anqing@chromium.org> Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org> Cr-Commit-Position: refs/heads/master@{#869653}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
6efe5aad02
commit
ceb092eeb8
chrome/browser
device_api
resources
ui
components
@@ -174,6 +174,11 @@ bool ManagedConfigurationAPI::CanHaveManagedStore(const url::Origin& origin) {
|
|||||||
return base::Contains(managed_origins_, origin);
|
return base::Contains(managed_origins_, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::set<url::Origin>& ManagedConfigurationAPI::GetManagedOrigins()
|
||||||
|
const {
|
||||||
|
return managed_origins_;
|
||||||
|
}
|
||||||
|
|
||||||
void ManagedConfigurationAPI::OnConfigurationPolicyChanged() {
|
void ManagedConfigurationAPI::OnConfigurationPolicyChanged() {
|
||||||
const base::Value* managed_configurations =
|
const base::Value* managed_configurations =
|
||||||
profile_->GetPrefs()->GetList(prefs::kManagedConfigurationPerOrigin);
|
profile_->GetPrefs()->GetList(prefs::kManagedConfigurationPerOrigin);
|
||||||
|
@@ -56,6 +56,9 @@ class ManagedConfigurationAPI : public KeyedService {
|
|||||||
// this checks whether the application is managed.
|
// this checks whether the application is managed.
|
||||||
bool CanHaveManagedStore(const url::Origin& origin);
|
bool CanHaveManagedStore(const url::Origin& origin);
|
||||||
|
|
||||||
|
// Returns the list of all origins that have a managed configuration set.
|
||||||
|
const std::set<url::Origin>& GetManagedOrigins() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ManagedConfigurationDownloader;
|
class ManagedConfigurationDownloader;
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ export let BrowserReportingResponse;
|
|||||||
* @typedef {{
|
* @typedef {{
|
||||||
* browserManagementNotice: string,
|
* browserManagementNotice: string,
|
||||||
* extensionReportingTitle: string,
|
* extensionReportingTitle: string,
|
||||||
|
* managedWebsitesSubtitle: string,
|
||||||
* pageSubtitle: string,
|
* pageSubtitle: string,
|
||||||
* managed: boolean,
|
* managed: boolean,
|
||||||
* overview: string,
|
* overview: string,
|
||||||
@@ -98,6 +99,9 @@ export class ManagementBrowserProxy {
|
|||||||
/** @return {!Promise<!Array<!Extension>>} */
|
/** @return {!Promise<!Array<!Extension>>} */
|
||||||
getExtensions() {}
|
getExtensions() {}
|
||||||
|
|
||||||
|
/** @return {!Promise<!Array<!String>>} */
|
||||||
|
getManagedWebsites() {}
|
||||||
|
|
||||||
// <if expr="chromeos">
|
// <if expr="chromeos">
|
||||||
/**
|
/**
|
||||||
* @return {!Promise<boolean>} Boolean describing trust root configured
|
* @return {!Promise<boolean>} Boolean describing trust root configured
|
||||||
@@ -138,6 +142,11 @@ export class ManagementBrowserProxyImpl {
|
|||||||
return sendWithPromise('getExtensions');
|
return sendWithPromise('getExtensions');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
getManagedWebsites() {
|
||||||
|
return sendWithPromise('getManagedWebsites');
|
||||||
|
}
|
||||||
|
|
||||||
// <if expr="chromeos">
|
// <if expr="chromeos">
|
||||||
/** @override */
|
/** @override */
|
||||||
getLocalTrustRootsInfo() {
|
getLocalTrustRootsInfo() {
|
||||||
|
@@ -362,6 +362,22 @@
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
<template is="dom-if"
|
||||||
|
if="[[showManagedWebsitesInfo_(managedWebsites_)]]">
|
||||||
|
<section class="managed-webistes">
|
||||||
|
<h2 class="cr-title-text">$i18n{managedWebsites}</h2>
|
||||||
|
<div class="subtitle">
|
||||||
|
[[managedWebsitesSubtitle_]]
|
||||||
|
</div>
|
||||||
|
<div class="content-indented">
|
||||||
|
<template is="dom-repeat" items="[[managedWebsites_]]">
|
||||||
|
<div class="report">
|
||||||
|
[[item]]
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@@ -53,6 +53,12 @@ Polymer({
|
|||||||
*/
|
*/
|
||||||
extensions_: Array,
|
extensions_: Array,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of messages related to browser reporting.
|
||||||
|
* @private (?Array<!String>)
|
||||||
|
*/
|
||||||
|
managedWebsites_: Array,
|
||||||
|
|
||||||
// <if expr="chromeos">
|
// <if expr="chromeos">
|
||||||
/**
|
/**
|
||||||
* List of messages related to device reporting.
|
* List of messages related to device reporting.
|
||||||
@@ -132,6 +138,7 @@ Polymer({
|
|||||||
info => this.threatProtectionInfo_ = info);
|
info => this.threatProtectionInfo_ = info);
|
||||||
|
|
||||||
this.getExtensions_();
|
this.getExtensions_();
|
||||||
|
this.getManagedWebsites_();
|
||||||
// <if expr="chromeos">
|
// <if expr="chromeos">
|
||||||
this.getDeviceReportingInfo_();
|
this.getDeviceReportingInfo_();
|
||||||
this.getPluginVmDataCollectionStatus_();
|
this.getPluginVmDataCollectionStatus_();
|
||||||
@@ -180,6 +187,13 @@ Polymer({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** @private */
|
||||||
|
getManagedWebsites_() {
|
||||||
|
this.browserProxy_.getManagedWebsites().then(managedWebsites => {
|
||||||
|
this.managedWebsites_ = managedWebsites;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
getThreatProtectionInfo_() {
|
getThreatProtectionInfo_() {
|
||||||
this.browserProxy_.getThreatProtectionInfo().then(info => {
|
this.browserProxy_.getThreatProtectionInfo().then(info => {
|
||||||
@@ -295,6 +309,15 @@ Polymer({
|
|||||||
return !!this.extensions_ && this.extensions_.length > 0;
|
return !!this.extensions_ && this.extensions_.length > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {boolean} True of there is managed websites info to show.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
showManagedWebsitesInfo_() {
|
||||||
|
return !!this.managedWebsites_ && this.managedWebsites_.length > 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ReportingType} reportingType
|
* @param {ReportingType} reportingType
|
||||||
* @returns {string} The associated icon.
|
* @returns {string} The associated icon.
|
||||||
@@ -344,6 +367,7 @@ Polymer({
|
|||||||
this.browserProxy_.getContextualManagedData().then(data => {
|
this.browserProxy_.getContextualManagedData().then(data => {
|
||||||
this.managed_ = data.managed;
|
this.managed_ = data.managed;
|
||||||
this.extensionReportingSubtitle_ = data.extensionReportingTitle;
|
this.extensionReportingSubtitle_ = data.extensionReportingTitle;
|
||||||
|
this.managedWebsitesSubtitle_ = data.managedWebsitesSubtitle;
|
||||||
this.subtitle_ = data.pageSubtitle;
|
this.subtitle_ = data.pageSubtitle;
|
||||||
// <if expr="chromeos">
|
// <if expr="chromeos">
|
||||||
this.customerLogo_ = data.customerLogo;
|
this.customerLogo_ = data.customerLogo;
|
||||||
|
@@ -88,6 +88,8 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) {
|
|||||||
{"searchPrompt", IDS_SETTINGS_SEARCH_PROMPT},
|
{"searchPrompt", IDS_SETTINGS_SEARCH_PROMPT},
|
||||||
{"clearSearch", IDS_CLEAR_SEARCH},
|
{"clearSearch", IDS_CLEAR_SEARCH},
|
||||||
{"backButton", IDS_ACCNAME_BACK},
|
{"backButton", IDS_ACCNAME_BACK},
|
||||||
|
{"managedWebsites", IDS_MANAGEMENT_MANAGED_WEBSITES},
|
||||||
|
{"managedWebsitesSubtitle", IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION},
|
||||||
{kManagementExtensionReportMachineName,
|
{kManagementExtensionReportMachineName,
|
||||||
IDS_MANAGEMENT_EXTENSION_REPORT_MACHINE_NAME},
|
IDS_MANAGEMENT_EXTENSION_REPORT_MACHINE_NAME},
|
||||||
{kManagementExtensionReportMachineNameAddress,
|
{kManagementExtensionReportMachineNameAddress,
|
||||||
|
@@ -85,6 +85,8 @@ IN_PROC_BROWSER_TEST_F(ManagementUITest, ManagementStateChange) {
|
|||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED)},
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED)},
|
||||||
{"pageSubtitle",
|
{"pageSubtitle",
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_NOT_MANAGED_SUBTITLE)},
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_NOT_MANAGED_SUBTITLE)},
|
||||||
|
{"managedWebsitesSubtitle",
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION)},
|
||||||
};
|
};
|
||||||
|
|
||||||
VerifyTexts(unmanaged_value_ptr.get(), expected_unmanaged_values);
|
VerifyTexts(unmanaged_value_ptr.get(), expected_unmanaged_values);
|
||||||
@@ -115,7 +117,8 @@ IN_PROC_BROWSER_TEST_F(ManagementUITest, ManagementStateChange) {
|
|||||||
{"extensionReportingTitle",
|
{"extensionReportingTitle",
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED)},
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED)},
|
||||||
{"pageSubtitle", l10n_util::GetStringUTF16(IDS_MANAGEMENT_SUBTITLE)},
|
{"pageSubtitle", l10n_util::GetStringUTF16(IDS_MANAGEMENT_SUBTITLE)},
|
||||||
};
|
{"managedWebsitesSubtitle",
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION)}};
|
||||||
|
|
||||||
VerifyTexts(managed_value_ptr.get(), expected_managed_values);
|
VerifyTexts(managed_value_ptr.get(), expected_managed_values);
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "chrome/browser/browser_process.h"
|
#include "chrome/browser/browser_process.h"
|
||||||
#include "chrome/browser/browser_process_platform_part.h"
|
#include "chrome/browser/browser_process_platform_part.h"
|
||||||
|
#include "chrome/browser/device_api/managed_configuration_api.h"
|
||||||
|
#include "chrome/browser/device_api/managed_configuration_api_factory.h"
|
||||||
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
|
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
|
||||||
#include "chrome/browser/policy/profile_policy_connector.h"
|
#include "chrome/browser/policy/profile_policy_connector.h"
|
||||||
#include "chrome/browser/profiles/profile.h"
|
#include "chrome/browser/profiles/profile.h"
|
||||||
@@ -389,6 +391,10 @@ void ManagementUIHandler::RegisterMessages() {
|
|||||||
"getThreatProtectionInfo",
|
"getThreatProtectionInfo",
|
||||||
base::BindRepeating(&ManagementUIHandler::HandleGetThreatProtectionInfo,
|
base::BindRepeating(&ManagementUIHandler::HandleGetThreatProtectionInfo,
|
||||||
base::Unretained(this)));
|
base::Unretained(this)));
|
||||||
|
web_ui()->RegisterMessageCallback(
|
||||||
|
"getManagedWebsites",
|
||||||
|
base::BindRepeating(&ManagementUIHandler::HandleGetManagedWebsites,
|
||||||
|
base::Unretained(this)));
|
||||||
web_ui()->RegisterMessageCallback(
|
web_ui()->RegisterMessageCallback(
|
||||||
"initBrowserReportingInfo",
|
"initBrowserReportingInfo",
|
||||||
base::BindRepeating(&ManagementUIHandler::HandleInitBrowserReportingInfo,
|
base::BindRepeating(&ManagementUIHandler::HandleInitBrowserReportingInfo,
|
||||||
@@ -676,6 +682,9 @@ base::Value ManagementUIHandler::GetContextualManagedData(Profile* profile) {
|
|||||||
response.SetStringPath(
|
response.SetStringPath(
|
||||||
"extensionReportingTitle",
|
"extensionReportingTitle",
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
response.SetStringPath(
|
||||||
|
"managedWebsitesSubtitle",
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
response.SetStringPath(
|
response.SetStringPath(
|
||||||
@@ -699,6 +708,10 @@ base::Value ManagementUIHandler::GetContextualManagedData(Profile* profile) {
|
|||||||
"extensionReportingTitle",
|
"extensionReportingTitle",
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
base::UTF8ToUTF16(enterprise_manager)));
|
base::UTF8ToUTF16(enterprise_manager)));
|
||||||
|
response.SetStringPath("managedWebsitesSubtitle",
|
||||||
|
l10n_util::GetStringFUTF16(
|
||||||
|
IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
base::UTF8ToUTF16(enterprise_manager)));
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
response.SetStringPath(
|
response.SetStringPath(
|
||||||
@@ -806,6 +819,17 @@ base::Value ManagementUIHandler::GetThreatProtectionInfo(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::Value ManagementUIHandler::GetManagedWebsitesInfo(
|
||||||
|
Profile* profile) const {
|
||||||
|
base::Value managed_websites(base::Value::Type::LIST);
|
||||||
|
for (const auto& entry :
|
||||||
|
ManagedConfigurationAPIFactory::GetForProfile(profile)
|
||||||
|
->GetManagedOrigins()) {
|
||||||
|
managed_websites.Append(entry.Serialize());
|
||||||
|
}
|
||||||
|
return managed_websites;
|
||||||
|
}
|
||||||
|
|
||||||
policy::PolicyService* ManagementUIHandler::GetPolicyService() const {
|
policy::PolicyService* ManagementUIHandler::GetPolicyService() const {
|
||||||
return Profile::FromWebUI(web_ui())
|
return Profile::FromWebUI(web_ui())
|
||||||
->GetProfilePolicyConnector()
|
->GetProfilePolicyConnector()
|
||||||
@@ -1004,6 +1028,15 @@ void ManagementUIHandler::HandleGetThreatProtectionInfo(
|
|||||||
GetThreatProtectionInfo(Profile::FromWebUI(web_ui())));
|
GetThreatProtectionInfo(Profile::FromWebUI(web_ui())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ManagementUIHandler::HandleGetManagedWebsites(
|
||||||
|
const base::ListValue* args) {
|
||||||
|
AllowJavascript();
|
||||||
|
|
||||||
|
ResolveJavascriptCallback(
|
||||||
|
args->GetList()[0] /* callback_id */,
|
||||||
|
GetManagedWebsitesInfo(Profile::FromWebUI(web_ui())));
|
||||||
|
}
|
||||||
|
|
||||||
void ManagementUIHandler::HandleInitBrowserReportingInfo(
|
void ManagementUIHandler::HandleInitBrowserReportingInfo(
|
||||||
const base::ListValue* args) {
|
const base::ListValue* args) {
|
||||||
base::Value report_sources(base::Value::Type::LIST);
|
base::Value report_sources(base::Value::Type::LIST);
|
||||||
|
@@ -139,6 +139,7 @@ class ManagementUIHandler : public content::WebUIMessageHandler,
|
|||||||
|
|
||||||
base::Value GetContextualManagedData(Profile* profile);
|
base::Value GetContextualManagedData(Profile* profile);
|
||||||
base::Value GetThreatProtectionInfo(Profile* profile) const;
|
base::Value GetThreatProtectionInfo(Profile* profile) const;
|
||||||
|
base::Value GetManagedWebsitesInfo(Profile* profile) const;
|
||||||
virtual policy::PolicyService* GetPolicyService() const;
|
virtual policy::PolicyService* GetPolicyService() const;
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
@@ -174,6 +175,7 @@ class ManagementUIHandler : public content::WebUIMessageHandler,
|
|||||||
void HandleGetExtensions(const base::ListValue* args);
|
void HandleGetExtensions(const base::ListValue* args);
|
||||||
void HandleGetContextualManagedData(const base::ListValue* args);
|
void HandleGetContextualManagedData(const base::ListValue* args);
|
||||||
void HandleGetThreatProtectionInfo(const base::ListValue* args);
|
void HandleGetThreatProtectionInfo(const base::ListValue* args);
|
||||||
|
void HandleGetManagedWebsites(const base::ListValue* args);
|
||||||
void HandleInitBrowserReportingInfo(const base::ListValue* args);
|
void HandleInitBrowserReportingInfo(const base::ListValue* args);
|
||||||
|
|
||||||
void AsyncUpdateLogo();
|
void AsyncUpdateLogo();
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
// Copyright 2019 The Chromium Authors. All rights reserved.
|
// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
@@ -14,6 +13,7 @@
|
|||||||
|
|
||||||
#include "build/chromeos_buildflags.h"
|
#include "build/chromeos_buildflags.h"
|
||||||
#include "chrome/browser/ui/webui/management/management_ui_handler.h"
|
#include "chrome/browser/ui/webui/management/management_ui_handler.h"
|
||||||
|
#include "chrome/common/pref_names.h"
|
||||||
#include "chrome/test/base/testing_profile.h"
|
#include "chrome/test/base/testing_profile.h"
|
||||||
#include "components/policy/core/browser/browser_policy_connector.h"
|
#include "components/policy/core/browser/browser_policy_connector.h"
|
||||||
#include "components/policy/core/common/mock_configuration_policy_provider.h"
|
#include "components/policy/core/common/mock_configuration_policy_provider.h"
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "components/policy/core/common/policy_namespace.h"
|
#include "components/policy/core/common/policy_namespace.h"
|
||||||
#include "components/policy/core/common/policy_service.h"
|
#include "components/policy/core/common/policy_service.h"
|
||||||
#include "components/policy/policy_constants.h"
|
#include "components/policy/policy_constants.h"
|
||||||
|
#include "components/prefs/pref_service.h"
|
||||||
#include "components/strings/grit/components_strings.h"
|
#include "components/strings/grit/components_strings.h"
|
||||||
#include "content/public/test/browser_task_environment.h"
|
#include "content/public/test/browser_task_environment.h"
|
||||||
#include "extensions/common/extension.h"
|
#include "extensions/common/extension.h"
|
||||||
@@ -96,6 +97,7 @@ using testing::ReturnRef;
|
|||||||
|
|
||||||
struct ContextualManagementSourceUpdate {
|
struct ContextualManagementSourceUpdate {
|
||||||
std::u16string extension_reporting_title;
|
std::u16string extension_reporting_title;
|
||||||
|
std::u16string managed_websites_title;
|
||||||
std::u16string subtitle;
|
std::u16string subtitle;
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
std::u16string management_overview;
|
std::u16string management_overview;
|
||||||
@@ -202,6 +204,10 @@ class TestManagementUIHandler : public ManagementUIHandler {
|
|||||||
return report_sources;
|
return report_sources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::Value GetManagedWebsitesInfo(Profile* profile) {
|
||||||
|
return ManagementUIHandler::GetManagedWebsitesInfo(profile);
|
||||||
|
}
|
||||||
|
|
||||||
base::Value GetThreatProtectionInfo(Profile* profile) {
|
base::Value GetThreatProtectionInfo(Profile* profile) {
|
||||||
return ManagementUIHandler::GetThreatProtectionInfo(profile);
|
return ManagementUIHandler::GetThreatProtectionInfo(profile);
|
||||||
}
|
}
|
||||||
@@ -307,6 +313,8 @@ class ManagementUIHandlerTests : public TestingBaseClass {
|
|||||||
void ExtractContextualSourceUpdate(const base::Value& data) {
|
void ExtractContextualSourceUpdate(const base::Value& data) {
|
||||||
extracted_.extension_reporting_title =
|
extracted_.extension_reporting_title =
|
||||||
ExtractPathFromDict(data, "extensionReportingTitle");
|
ExtractPathFromDict(data, "extensionReportingTitle");
|
||||||
|
extracted_.managed_websites_title =
|
||||||
|
ExtractPathFromDict(data, "managedWebsitesSubtitle");
|
||||||
extracted_.subtitle = ExtractPathFromDict(data, "pageSubtitle");
|
extracted_.subtitle = ExtractPathFromDict(data, "pageSubtitle");
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
extracted_.management_overview = ExtractPathFromDict(data, "overview");
|
extracted_.management_overview = ExtractPathFromDict(data, "overview");
|
||||||
@@ -492,6 +500,10 @@ class ManagementUIHandlerTests : public TestingBaseClass {
|
|||||||
return extracted_.extension_reporting_title;
|
return extracted_.extension_reporting_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::u16string GetManagedWebsitesTitle() const {
|
||||||
|
return extracted_.managed_websites_title;
|
||||||
|
}
|
||||||
|
|
||||||
std::u16string GetPageSubtitle() const { return extracted_.subtitle; }
|
std::u16string GetPageSubtitle() const { return extracted_.subtitle; }
|
||||||
|
|
||||||
TestingProfile* GetProfile() const { return profile_.get(); }
|
TestingProfile* GetProfile() const { return profile_.get(); }
|
||||||
@@ -653,6 +665,9 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
|
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
||||||
@@ -668,6 +683,9 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
|
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_BROWSER_NOTICE,
|
IDS_MANAGEMENT_BROWSER_NOTICE,
|
||||||
@@ -685,6 +703,9 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
|
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_BROWSER_NOTICE,
|
IDS_MANAGEMENT_BROWSER_NOTICE,
|
||||||
@@ -706,6 +727,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
base::UTF8ToUTF16(domain)));
|
base::UTF8ToUTF16(domain)));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
base::UTF8ToUTF16(domain)));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
||||||
@@ -723,6 +748,9 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
|
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
IDS_MANAGEMENT_NOT_MANAGED_NOTICE,
|
||||||
@@ -743,6 +771,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
base::UTF8ToUTF16(domain)));
|
base::UTF8ToUTF16(domain)));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
base::UTF8ToUTF16(domain)));
|
||||||
EXPECT_EQ(GetBrowserManagementNotice(),
|
EXPECT_EQ(GetBrowserManagementNotice(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_BROWSER_NOTICE,
|
IDS_MANAGEMENT_BROWSER_NOTICE,
|
||||||
@@ -769,6 +801,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
base::UTF8ToUTF16(domain)));
|
base::UTF8ToUTF16(domain)));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
base::UTF8ToUTF16(domain)));
|
||||||
EXPECT_EQ(GetPageSubtitle(),
|
EXPECT_EQ(GetPageSubtitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_SUBTITLE_MANAGED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_SUBTITLE_MANAGED_BY,
|
||||||
l10n_util::GetStringUTF16(device_type),
|
l10n_util::GetStringUTF16(device_type),
|
||||||
@@ -789,6 +825,9 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
|
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetPageSubtitle(),
|
EXPECT_EQ(GetPageSubtitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_SUBTITLE_MANAGED,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_SUBTITLE_MANAGED,
|
||||||
l10n_util::GetStringUTF16(device_type)));
|
l10n_util::GetStringUTF16(device_type)));
|
||||||
@@ -812,6 +851,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
device_domain()));
|
device_domain()));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
device_domain()));
|
||||||
EXPECT_EQ(GetManagementOverview(), std::u16string());
|
EXPECT_EQ(GetManagementOverview(), std::u16string());
|
||||||
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
||||||
EXPECT_TRUE(GetManaged());
|
EXPECT_TRUE(GetManaged());
|
||||||
@@ -835,6 +878,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetManagementOverview(),
|
EXPECT_EQ(GetManagementOverview(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_DEVICE_AND_ACCOUNT_MANAGED_BY, device_domain()));
|
IDS_MANAGEMENT_DEVICE_AND_ACCOUNT_MANAGED_BY, device_domain()));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
device_domain()));
|
||||||
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
||||||
EXPECT_TRUE(GetManaged());
|
EXPECT_TRUE(GetManaged());
|
||||||
}
|
}
|
||||||
@@ -856,6 +903,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
device_domain()));
|
device_domain()));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
device_domain()));
|
||||||
EXPECT_EQ(GetManagementOverview(),
|
EXPECT_EQ(GetManagementOverview(),
|
||||||
l10n_util::GetStringFUTF16(
|
l10n_util::GetStringFUTF16(
|
||||||
IDS_MANAGEMENT_DEVICE_MANAGED_BY_ACCOUNT_MANAGED_BY,
|
IDS_MANAGEMENT_DEVICE_MANAGED_BY_ACCOUNT_MANAGED_BY,
|
||||||
@@ -877,6 +928,9 @@ TEST_F(ManagementUIHandlerTests, ManagementContextualSourceUpdateUnmanaged) {
|
|||||||
l10n_util::GetStringUTF16(device_type)));
|
l10n_util::GetStringUTF16(device_type)));
|
||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION));
|
||||||
EXPECT_EQ(GetManagementOverview(),
|
EXPECT_EQ(GetManagementOverview(),
|
||||||
l10n_util::GetStringUTF16(IDS_MANAGEMENT_DEVICE_NOT_MANAGED));
|
l10n_util::GetStringUTF16(IDS_MANAGEMENT_DEVICE_NOT_MANAGED));
|
||||||
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
EXPECT_EQ(GetUpdateRequiredEolMessage(), std::u16string());
|
||||||
@@ -903,6 +957,10 @@ TEST_F(ManagementUIHandlerTests,
|
|||||||
EXPECT_EQ(GetExtensionReportingTitle(),
|
EXPECT_EQ(GetExtensionReportingTitle(),
|
||||||
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_EXTENSIONS_INSTALLED_BY,
|
||||||
device_domain()));
|
device_domain()));
|
||||||
|
EXPECT_EQ(
|
||||||
|
GetManagedWebsitesTitle(),
|
||||||
|
l10n_util::GetStringFUTF16(IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION,
|
||||||
|
device_domain()));
|
||||||
EXPECT_TRUE(GetManaged());
|
EXPECT_TRUE(GetManaged());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1059,7 +1117,6 @@ TEST_F(ManagementUIHandlerTests, ExtensionReportingInfoNoPolicySetNoMessage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ManagementUIHandlerTests, CloudReportingPolicy) {
|
TEST_F(ManagementUIHandlerTests, CloudReportingPolicy) {
|
||||||
|
|
||||||
policy::PolicyMap chrome_policies;
|
policy::PolicyMap chrome_policies;
|
||||||
const policy::PolicyNamespace chrome_policies_namespace =
|
const policy::PolicyNamespace chrome_policies_namespace =
|
||||||
policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string());
|
policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string());
|
||||||
@@ -1132,6 +1189,27 @@ TEST_F(ManagementUIHandlerTests, ExtensionReportingInfoPoliciesMerge) {
|
|||||||
expected_messages);
|
expected_messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ManagementUIHandlerTests, ManagedWebsitiesInfoNoPolicySet) {
|
||||||
|
TestingProfile::Builder builder_no_domain;
|
||||||
|
auto profile = builder_no_domain.Build();
|
||||||
|
auto info = handler_.GetManagedWebsitesInfo(profile.get());
|
||||||
|
EXPECT_EQ(info.GetList().size(), 0u);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ManagementUIHandlerTests, ManagedWebsitiesInfoWebsites) {
|
||||||
|
TestingProfile::Builder builder_no_domain;
|
||||||
|
auto profile = builder_no_domain.Build();
|
||||||
|
base::Value managed_websites(base::Value::Type::LIST);
|
||||||
|
base::Value entry(base::Value::Type::DICTIONARY);
|
||||||
|
entry.SetStringKey("origin", "https://example.com");
|
||||||
|
managed_websites.Append(std::move(entry));
|
||||||
|
profile->GetPrefs()->Set(prefs::kManagedConfigurationPerOrigin,
|
||||||
|
managed_websites);
|
||||||
|
auto info = handler_.GetManagedWebsitesInfo(profile.get());
|
||||||
|
EXPECT_EQ(info.GetList().size(), 1u);
|
||||||
|
EXPECT_EQ(info.GetList().begin()->GetString(), "https://example.com");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(ManagementUIHandlerTests, ThreatReportingInfo) {
|
TEST_F(ManagementUIHandlerTests, ThreatReportingInfo) {
|
||||||
policy::PolicyMap chrome_policies;
|
policy::PolicyMap chrome_policies;
|
||||||
const policy::PolicyNamespace chrome_policies_namespace =
|
const policy::PolicyNamespace chrome_policies_namespace =
|
||||||
|
@@ -158,6 +158,18 @@
|
|||||||
Permissions
|
Permissions
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
<!-- Strings related to website managed configuration of the management page -->
|
||||||
|
<message name="IDS_MANAGEMENT_MANAGED_WEBSITES" desc="Title of the configured websites section of the page">
|
||||||
|
Websites with info from your organization
|
||||||
|
</message>
|
||||||
|
<message name="IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION" desc="Message describing that administrator has set some preset organization data to be sent to the following websites">
|
||||||
|
The administrator of this device has sent some info to the following websites, like settings or policies.
|
||||||
|
</message>
|
||||||
|
<message name="IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION" desc="Message describing that administrator has set some preset organization data to be sent to the following websites">
|
||||||
|
Your organization, <ph name="ENROLLMENT_DOMAIN">$1<ex>example.com</ex></ph>, has sent some info to the following websites, like settings or policies.
|
||||||
|
</message>
|
||||||
|
|
||||||
|
|
||||||
<!-- Strings related to browser reporting section of the management page -->
|
<!-- Strings related to browser reporting section of the management page -->
|
||||||
<message name="IDS_MANAGEMENT_BROWSER_REPORTING" desc="Title of the types of browser reporting section of the page">
|
<message name="IDS_MANAGEMENT_BROWSER_REPORTING" desc="Title of the types of browser reporting section of the page">
|
||||||
Browser
|
Browser
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
98fc6bcd813e1b6b1f1215984b6eaaaf3e402882
|
1
components/management_strings_grdp/IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION.png.sha1
Normal file
1
components/management_strings_grdp/IDS_MANAGEMENT_MANAGED_WEBSITES_BY_EXPLANATION.png.sha1
Normal file
@@ -0,0 +1 @@
|
|||||||
|
4de4388bab08404c4911126c211c53a102ccca94
|
1
components/management_strings_grdp/IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION.png.sha1
Normal file
1
components/management_strings_grdp/IDS_MANAGEMENT_MANAGED_WEBSITES_EXPLANATION.png.sha1
Normal file
@@ -0,0 +1 @@
|
|||||||
|
98fc6bcd813e1b6b1f1215984b6eaaaf3e402882
|
Reference in New Issue
Block a user