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

Side by Side Diff: ui/arc/notification/arc_notification_content_view.cc

Issue 2918483002: Add an accessibility description for notification (Closed)
Patch Set: Use a11y description instead of rule Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/message_center/views/message_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/arc/notification/arc_notification_content_view.h" 5 #include "ui/arc/notification/arc_notification_content_view.h"
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/exo/notification_surface.h" 10 #include "components/exo/notification_surface.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 if (item_ && action_data.action == ui::AX_ACTION_DO_DEFAULT) { 619 if (item_ && action_data.action == ui::AX_ACTION_DO_DEFAULT) {
620 item_->ToggleExpansion(); 620 item_->ToggleExpansion();
621 return true; 621 return true;
622 } 622 }
623 return false; 623 return false;
624 } 624 }
625 625
626 void ArcNotificationContentView::GetAccessibleNodeData( 626 void ArcNotificationContentView::GetAccessibleNodeData(
627 ui::AXNodeData* node_data) { 627 ui::AXNodeData* node_data) {
628 node_data->role = ui::AX_ROLE_BUTTON; 628 node_data->role = ui::AX_ROLE_BUTTON;
629 node_data->AddStringAttribute(
630 ui::AX_ATTR_ROLE_DESCRIPTION,
631 l10n_util::GetStringUTF8(
632 IDS_MESSAGE_NOTIFICATION_SETTINGS_BUTTON_ACCESSIBLE_NAME));
629 node_data->SetName(accessible_name_); 633 node_data->SetName(accessible_name_);
630 } 634 }
631 635
632 void ArcNotificationContentView::ButtonPressed(views::Button* sender, 636 void ArcNotificationContentView::ButtonPressed(views::Button* sender,
633 const ui::Event& event) { 637 const ui::Event& event) {
634 if (item_ && !item_->GetPinned() && sender == close_button_.get()) { 638 if (item_ && !item_->GetPinned() && sender == close_button_.get()) {
635 CHECK_EQ(ArcNotificationView::kViewClassName, parent()->GetClassName()); 639 CHECK_EQ(ArcNotificationView::kViewClassName, parent()->GetClassName());
636 static_cast<ArcNotificationView*>(parent())->OnCloseButtonPressed(); 640 static_cast<ArcNotificationView*>(parent())->OnCloseButtonPressed();
637 } 641 }
638 if (item_ && settings_button_ && sender == settings_button_) { 642 if (item_ && settings_button_ && sender == settings_button_) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 settings_button_->SchedulePaint(); 717 settings_button_->SchedulePaint();
714 } 718 }
715 if (close_button_) { 719 if (close_button_) {
716 close_button_->SetBackground(views::CreateSolidBackground(current_color)); 720 close_button_->SetBackground(views::CreateSolidBackground(current_color));
717 close_button_->SchedulePaint(); 721 close_button_->SchedulePaint();
718 } 722 }
719 } 723 }
720 } 724 }
721 725
722 } // namespace arc 726 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/views/message_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698