| 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 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2631 SelectionIncrementDirectionType direction) { | 2631 SelectionIncrementDirectionType direction) { |
| 2632 if (!item) | 2632 if (!item) |
| 2633 return; | 2633 return; |
| 2634 SetSelection(item, SELECTION_DEFAULT); | 2634 SetSelection(item, SELECTION_DEFAULT); |
| 2635 View* hot_view = | 2635 View* hot_view = |
| 2636 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN); | 2636 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN); |
| 2637 SetHotTrackedButton(CustomButton::AsCustomButton(hot_view)); | 2637 SetHotTrackedButton(CustomButton::AsCustomButton(hot_view)); |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 void MenuController::SetHotTrackedButton(CustomButton* hot_button) { | 2640 void MenuController::SetHotTrackedButton(CustomButton* hot_button) { |
| 2641 if (hot_button == hot_button_) | 2641 if (hot_button == hot_button_) { |
| 2642 // Hot-tracked state may change outside of the MenuController. Correct it. |
| 2643 if (hot_button && !hot_button->IsHotTracked()) |
| 2644 hot_button->SetHotTracked(true); |
| 2642 return; | 2645 return; |
| 2646 } |
| 2643 if (hot_button_) | 2647 if (hot_button_) |
| 2644 hot_button_->SetHotTracked(false); | 2648 hot_button_->SetHotTracked(false); |
| 2645 hot_button_ = hot_button; | 2649 hot_button_ = hot_button; |
| 2646 if (hot_button) | 2650 if (hot_button) |
| 2647 hot_button->SetHotTracked(true); | 2651 hot_button->SetHotTracked(true); |
| 2648 } | 2652 } |
| 2649 | 2653 |
| 2650 } // namespace views | 2654 } // namespace views |
| OLD | NEW |