Commit 8e8d2ec2 authored by mohammed@chromium.org's avatar mohammed@chromium.org

Combine the read and modify warning message for "accessibilitySettings" access.

When the extension/app requests to read and modify the accessibility settings, two messages are displayed to the user during install-time. The CL aims to combine these into one message to say "Read and modify ...".

BUG=344566
R=jww,meacer,kalman

Review URL: https://codereview.chromium.org/324273003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278854 0039d316-1c4b-4281-b951-d872f2087c98
parent abe29e2a
......@@ -4419,6 +4419,9 @@ Make sure you do not expose any sensitive information.
<message name="IDS_EXTENSION_PROMPT_WARNING_ACCESSIBILITY_FEATURES_READ" desc="Permission string for modifying acccessibility settings via extension API shown when a extension utilizing the API is installed.">
Read your accessibility settings
</message>
<message name="IDS_EXTENSION_PROMPT_WARNING_ACCESSIBILITY_FEATURES_READ_MODIFY" desc="Permission string for reading and modifying acccessibility settings via extension API shown when an extension utilizing the API is installed.">
Read and change your accessibility settings
</message>
<!-- Extension/App error messages -->
<message name="IDS_EXTENSION_CANT_GET_ABSOLUTE_PATH" desc="Warning displayed in pack dialog when the absolute path to the extension directory can not be found.">
......
......@@ -111,6 +111,8 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
bool media_galleries_read = false;
bool media_galleries_copy_to = false;
bool media_galleries_delete = false;
bool accessibility_read = false;
bool accessibility_write = false;
for (PermissionMessages::const_iterator i = messages.begin();
i != messages.end(); ++i) {
switch (i->id()) {
......@@ -129,6 +131,12 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
case PermissionMessage::kMediaGalleriesAllGalleriesDelete:
media_galleries_delete = true;
break;
case PermissionMessage::kAccessibilityFeaturesRead:
accessibility_read = true;
break;
case PermissionMessage::kAccessibilityFeaturesModify:
accessibility_write = true;
break;
default:
break;
}
......@@ -147,6 +155,16 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
continue;
}
}
if (accessibility_read && accessibility_write) {
if (id == PermissionMessage::kAccessibilityFeaturesRead) {
message_strings.push_back(l10n_util::GetStringUTF16(
IDS_EXTENSION_PROMPT_WARNING_ACCESSIBILITY_FEATURES_READ_MODIFY));
continue;
} else if (id == PermissionMessage::kAccessibilityFeaturesModify) {
// The combined message will be pushed above.
continue;
}
}
if (media_galleries_read &&
(media_galleries_copy_to || media_galleries_delete)) {
if (id == PermissionMessage::kMediaGalleriesAllGalleriesRead) {
......
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