Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Unified Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc

Issue 689863002: Made the revoke buttons in the App Info dialog tab-navigable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@auto_focus_button_dialog
Patch Set: Changed generic 'Revoke' message to refer to the specific permission Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
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 fdfb8109759643bb82de56851251e5dc8b34a108..6e962fe3d7787f80930c6514f3b918edaaf63882 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));
}
virtual ~RevokeButton() {}
@@ -140,7 +148,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);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698