summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc14
2 files changed, 14 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index e11754c..313545b 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -2241,6 +2241,9 @@ Even if you have downloaded files from this website before, the website might ha
<message name="IDS_APPLICATION_INFO_SIZE_SMALL_LABEL" desc="Text displayed instead of the app or extension's size for apps and extensions that are less than 1 megabyte in size.">
&lt; 1 MB
</message>
+ <message name="IDS_APPLICATION_INFO_REVOKE_PERMISSION_ALT_TEXT" desc="Alt text displayed on hover (or in a screen reader) on the icon button that revokes (removes) the permission from this app.">
+ Revoke the permission '<ph name="PERMISSION">$1<ex>Access your USB and Bluetooth devices</ex></ph>'
+ </message>
<message name="IDS_APPLICATION_INFO_APP_NO_PERMISSIONS_TEXT" desc="Text displayed in the Permissions area of the dialog if the app has no permissions.">
This app requires no special permissions.
</message>
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
index e62f479..53dbb2a 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
@@ -40,10 +40,12 @@ const int kSpacingBetweenTextAndRevokeButton = 15;
const int kIndentationBeforeNestedBullet = 13;
// Creates a close button that calls |callback| on click and can be placed to
-// the right of a bullet in the permissions list.
+// the right of a bullet in the permissions list. The alt-text is set to a
+// revoke message containing the given |permission_message|.
class RevokeButton : public views::ImageButton, public views::ButtonListener {
public:
- explicit RevokeButton(const base::Closure& callback)
+ explicit RevokeButton(const base::Closure& callback,
+ base::string16 permission_message)
: views::ImageButton(this), callback_(callback) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
SetImage(views::CustomButton::STATE_NORMAL,
@@ -54,6 +56,12 @@ class RevokeButton : public views::ImageButton, public views::ButtonListener {
rb.GetImageNamed(IDR_DISABLE_P).ToImageSkia());
SetBorder(scoped_ptr<views::Border>());
SetSize(GetPreferredSize());
+
+ // Make the button focusable & give it alt-text so permissions can be
+ // revoked using only the keyboard.
+ SetFocusable(true);
+ SetTooltipText(l10n_util::GetStringFUTF16(
+ IDS_APPLICATION_INFO_REVOKE_PERMISSION_ALT_TEXT, permission_message));
}
~RevokeButton() override {}
@@ -139,7 +147,7 @@ class BulletedPermissionsList : public views::View {
const base::Closure& revoke_callback) {
RevokeButton* revoke_button = NULL;
if (!revoke_callback.is_null())
- revoke_button = new RevokeButton(revoke_callback);
+ revoke_button = new RevokeButton(revoke_callback, message);
views::Label* permission_label = new views::Label(message);
permission_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);