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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 delegate_->SiblingMenuCreated(alt_menu); | 1515 delegate_->SiblingMenuCreated(alt_menu); |
1516 | 1516 |
1517 if (!button) { | 1517 if (!button) { |
1518 // If the delegate returns a menu, they must also return a button. | 1518 // If the delegate returns a menu, they must also return a button. |
1519 NOTREACHED(); | 1519 NOTREACHED(); |
1520 return false; | 1520 return false; |
1521 } | 1521 } |
1522 | 1522 |
1523 // There is a sibling menu, update the button state, hide the current menu | 1523 // There is a sibling menu, update the button state, hide the current menu |
1524 // and show the new one. | 1524 // and show the new one. |
1525 pressed_lock_.reset( | 1525 pressed_lock_.reset(new MenuButton::PressedLock(button, true, nullptr)); |
1526 new MenuButton::PressedLock(button, true /* is_sibling_menu_show */)); | |
1527 | 1526 |
1528 // Need to reset capture when we show the menu again, otherwise we aren't | 1527 // Need to reset capture when we show the menu again, otherwise we aren't |
1529 // going to get any events. | 1528 // going to get any events. |
1530 did_capture_ = false; | 1529 did_capture_ = false; |
1531 gfx::Point screen_menu_loc; | 1530 gfx::Point screen_menu_loc; |
1532 View::ConvertPointToScreen(button, &screen_menu_loc); | 1531 View::ConvertPointToScreen(button, &screen_menu_loc); |
1533 | 1532 |
1534 // It is currently not possible to show a submenu recursively in a bubble. | 1533 // It is currently not possible to show a submenu recursively in a bubble. |
1535 DCHECK(!MenuItemView::IsBubble(anchor)); | 1534 DCHECK(!MenuItemView::IsBubble(anchor)); |
1536 // Subtract 1 from the height to make the popup flush with the button border. | 1535 // Subtract 1 from the height to make the popup flush with the button border. |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 if (hot_button_) | 2710 if (hot_button_) |
2712 hot_button_->SetHotTracked(false); | 2711 hot_button_->SetHotTracked(false); |
2713 hot_button_ = hot_button; | 2712 hot_button_ = hot_button; |
2714 if (hot_button) { | 2713 if (hot_button) { |
2715 hot_button->SetHotTracked(true); | 2714 hot_button->SetHotTracked(true); |
2716 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); | 2715 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); |
2717 } | 2716 } |
2718 } | 2717 } |
2719 | 2718 |
2720 } // namespace views | 2719 } // namespace views |
OLD | NEW |