| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |