Skip to content

Commit

Permalink
Add accessibility labels to the permission bubble (Views)
Browse files Browse the repository at this point in the history
dtseng took a look at the accessibility labeling of the permission bubble and
found:

    alert: page action
    static text : <address> wants to use your location
    button: Allow
    button: Block
    link: (unlabeled)
    image: (unabeled)
    button: close

This CL adds labels to the images. However, the labels are simply the empty
string because the images are redundant with the accompanying permission
type. (It doesn't make sense to put "location" next to "location".)

This CL also adds a label for the allow combobox, which I noticed was missing
a label.

I am still unsure what the unlabeled link is, so that issue remains.

BUG=382650

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

Cr-Commit-Position: refs/heads/master@{#312851}
  • Loading branch information
adrifelt authored and Commit bot committed Jan 23, 2015
1 parent a35fc75 commit cce5e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ are declared in build/common.gypi.
<message name="IDS_PERMISSION_ALLOW" desc="Label on button to allow a permissions request.">
Allow
</message>
<message name="IDS_PERMISSION_ALLOW_COMBOBOX" desc="Label on combobox to allow the user to either allow all or customize.">
Allow all or customize
</message>
<message name="IDS_PERMISSION_DENY" desc="Label on button to deny a permissions request.">
Block
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ PermissionsBubbleDelegateView::PermissionsBubbleDelegateView(
views::ImageView* icon = new views::ImageView();
icon->SetImage(bundle.GetImageSkiaNamed(requests.at(index)->GetIconID()));
icon->SetImageSize(gfx::Size(kIconSize, kIconSize));
icon->SetTooltipText(base::string16()); // Redundant with the text fragment
label_container->AddChildView(icon);
views::Label* label =
new views::Label(requests.at(index)->GetMessageTextFragment());
Expand Down Expand Up @@ -330,6 +331,8 @@ PermissionsBubbleDelegateView::PermissionsBubbleDelegateView(
new CustomizeAllowComboboxModel());
allow_combobox->set_listener(this);
allow_combobox->SetStyle(views::Combobox::STYLE_ACTION);
allow_combobox->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW_COMBOBOX));
button_layout->AddView(allow_combobox);
allow_combobox_ = allow_combobox;
}
Expand Down

0 comments on commit cce5e15

Please sign in to comment.