Commit df40ea02 authored by Nikita Podguzov's avatar Nikita Podguzov Committed by Commit Bot

Printing API: Add chrome.printingMetrics permission warning message

Bug: 992889
Change-Id: Ic2b8ff888960bfe23a4a1193db9002bb486e9393
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847395Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Nikita Podguzov <nikitapodguzov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706174}
parent 3e7567e0
......@@ -3783,6 +3783,9 @@ are declared in tools/grit/grit_rule.gni.
<message name="IDS_EXTENSION_PROMPT_WARNING_NETWORKING_PRIVATE" desc="Permission string for Networking Private API.">
Manage network connections
</message>
<message name="IDS_EXTENSION_PROMPT_WARNING_PRINTING_METRICS" desc="Permission string for access to printing metrics.">
See your printing history
</message>
<message name="IDS_EXTENSION_PROMPT_WARNING_SEARCH_SETTINGS_OVERRIDE" desc="Permission string for search settings override.">
Change your search settings to: <ph name="SEARCH_HOST">$1<ex>url.search.com</ex></ph>
</message>
......
......@@ -91,9 +91,10 @@ ChromePermissionMessageProvider::GetPowerfulPermissionMessages(
std::vector<ChromePermissionMessageRule> rules =
ChromePermissionMessageRule::GetAllRules();
// We pick only top N rules as they are considered as most sensitive ones.
// TODO(crbug.com/888981): Find a better way to get wanted rules. Maybe add a
// bool to each one telling if we should consider it here or not.
constexpr size_t rules_considered = 15;
constexpr size_t rules_considered = 17;
rules.erase(rules.begin() + std::min(rules_considered, rules.size()),
rules.end());
......
......@@ -336,6 +336,10 @@ ChromePermissionMessageRule::GetAllRules() {
// system should allow us to design a system that is simple enough to explain
// yet powerful enough to encapsulate all the messages we want to display.
ChromePermissionMessageRule rules_arr[] = {
// BEGIN POWERFUL PERMISSIONS:
// The following permissions are shown in the chrome://management page.
// See also GetPowerfulPermissionMessages().
// Full access permission messages.
{IDS_EXTENSION_PROMPT_WARNING_DEBUGGER, {APIPermission::kDebugger}, {}},
{IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS,
......@@ -429,6 +433,11 @@ ChromePermissionMessageRule::GetAllRules() {
{APIPermission::kFavicon, APIPermission::kTopSites}},
{IDS_EXTENSION_PROMPT_WARNING_FAVICON, {APIPermission::kFavicon}, {}},
{IDS_EXTENSION_PROMPT_WARNING_TOPSITES, {APIPermission::kTopSites}, {}},
{IDS_EXTENSION_PROMPT_WARNING_PRINTING_METRICS,
{APIPermission::kPrintingMetrics},
{}},
// END POWERFUL PERMISSIONS
{IDS_EXTENSION_PROMPT_WARNING_DECLARATIVE_WEB_REQUEST,
{APIPermission::kDeclarativeWebRequest},
......
......@@ -794,9 +794,6 @@ TEST(PermissionsTest, PermissionMessages) {
// and don't require a prompt, i.e. they're restricted to location 'policy'.
skip.insert(APIPermission::kEnterprisePlatformKeys);
skip.insert(APIPermission::kEnterpriseDeviceAttributes);
// TODO (crbug/992889): Remove this when permission warning strings will be
// added.
skip.insert(APIPermission::kPrintingMetrics);
// TODO(erikkay) add a string for this permission.
skip.insert(APIPermission::kBackground);
......
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