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

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 1982073002: Fix accessibility of buttons inside Chrome menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « chrome/browser/ui/views/toolbar/app_menu.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 return; 2661 return;
2662 SetSelection(item, SELECTION_DEFAULT); 2662 SetSelection(item, SELECTION_DEFAULT);
2663 View* hot_view = 2663 View* hot_view =
2664 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN); 2664 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN);
2665 SetHotTrackedButton(CustomButton::AsCustomButton(hot_view)); 2665 SetHotTrackedButton(CustomButton::AsCustomButton(hot_view));
2666 } 2666 }
2667 2667
2668 void MenuController::SetHotTrackedButton(CustomButton* hot_button) { 2668 void MenuController::SetHotTrackedButton(CustomButton* hot_button) {
2669 if (hot_button == hot_button_) { 2669 if (hot_button == hot_button_) {
2670 // Hot-tracked state may change outside of the MenuController. Correct it. 2670 // Hot-tracked state may change outside of the MenuController. Correct it.
2671 if (hot_button && !hot_button->IsHotTracked()) 2671 if (hot_button && !hot_button->IsHotTracked()) {
2672 hot_button->SetHotTracked(true); 2672 hot_button->SetHotTracked(true);
2673 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
2674 }
2673 return; 2675 return;
2674 } 2676 }
2675 if (hot_button_) 2677 if (hot_button_)
2676 hot_button_->SetHotTracked(false); 2678 hot_button_->SetHotTracked(false);
2677 hot_button_ = hot_button; 2679 hot_button_ = hot_button;
2678 if (hot_button) 2680 if (hot_button) {
2679 hot_button->SetHotTracked(true); 2681 hot_button->SetHotTracked(true);
2682 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
2683 }
2680 } 2684 }
2681 2685
2682 } // namespace views 2686 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698