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

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 2491773002: Page Info (Views): remove images from accessibility order (Closed)
Patch Set: Created 4 years, 1 month 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
Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
index f182aabb5062b633a24b9fe0f81990f7708ac258..c3b9b55b766eee63f12196c6d7e927e58a941e0b 100644
--- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
+++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
@@ -39,6 +39,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/common/constants.h"
+#include "ui/accessibility/ax_enums.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/models/simple_menu_model.h"
@@ -115,6 +117,15 @@ const int STYLED_LABEL_RESET_CERTIFICATE_DECISIONS = 1339;
const int LINK_COOKIE_DIALOG = 1340;
const int LINK_SITE_SETTINGS = 1341;
+class NonAccessibleImageView : public views::ImageView {
+ // Overridden from views::View.
+ void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
+};
+
+void NonAccessibleImageView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
+ node_data->role = ui::AX_ROLE_IGNORED;
+}
+
} // namespace
// |PopupHeaderView| is the UI element (view) that represents the header of the
@@ -369,7 +380,7 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, kSpacing,
kSpacing, kSpacing));
set_margins(gfx::Insets());
- views::ImageView* icon_view = new views::ImageView();
+ views::ImageView* icon_view = new NonAccessibleImageView();
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
icon_view->SetImage(rb.GetImageSkiaNamed(icon));
AddChildView(icon_view);
@@ -619,7 +630,7 @@ void WebsiteSettingsPopupView::SetCookieInfo(
info.is_incognito =
Profile::FromBrowserContext(web_contents()->GetBrowserContext())
->IsOffTheRecord();
- views::ImageView* icon = new views::ImageView();
+ views::ImageView* icon = new NonAccessibleImageView();
const gfx::Image& image = WebsiteSettingsUI::GetPermissionIcon(info);
icon->SetImage(image.ToImageSkia());
layout->AddView(

Powered by Google App Engine
This is Rietveld 408576698