| 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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 delegate_->SiblingMenuCreated(alt_menu); | 1416 delegate_->SiblingMenuCreated(alt_menu); |
| 1417 | 1417 |
| 1418 if (!button) { | 1418 if (!button) { |
| 1419 // If the delegate returns a menu, they must also return a button. | 1419 // If the delegate returns a menu, they must also return a button. |
| 1420 NOTREACHED(); | 1420 NOTREACHED(); |
| 1421 return false; | 1421 return false; |
| 1422 } | 1422 } |
| 1423 | 1423 |
| 1424 // There is a sibling menu, update the button state, hide the current menu | 1424 // There is a sibling menu, update the button state, hide the current menu |
| 1425 // and show the new one. | 1425 // and show the new one. |
| 1426 pressed_lock_.reset(new MenuButton::PressedLock(button)); | 1426 pressed_lock_.reset( |
| 1427 new MenuButton::PressedLock(button, true /* is_sibling_menu_show */)); |
| 1427 | 1428 |
| 1428 // Need to reset capture when we show the menu again, otherwise we aren't | 1429 // Need to reset capture when we show the menu again, otherwise we aren't |
| 1429 // going to get any events. | 1430 // going to get any events. |
| 1430 did_capture_ = false; | 1431 did_capture_ = false; |
| 1431 gfx::Point screen_menu_loc; | 1432 gfx::Point screen_menu_loc; |
| 1432 View::ConvertPointToScreen(button, &screen_menu_loc); | 1433 View::ConvertPointToScreen(button, &screen_menu_loc); |
| 1433 | 1434 |
| 1434 // It is currently not possible to show a submenu recursively in a bubble. | 1435 // It is currently not possible to show a submenu recursively in a bubble. |
| 1435 DCHECK(!MenuItemView::IsBubble(anchor)); | 1436 DCHECK(!MenuItemView::IsBubble(anchor)); |
| 1436 // Subtract 1 from the height to make the popup flush with the button border. | 1437 // Subtract 1 from the height to make the popup flush with the button border. |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2610 return; | 2611 return; |
| 2611 SetSelection(item, SELECTION_DEFAULT); | 2612 SetSelection(item, SELECTION_DEFAULT); |
| 2612 View* hot_view = | 2613 View* hot_view = |
| 2613 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN); | 2614 GetInitialFocusableView(item, direction == INCREMENT_SELECTION_DOWN); |
| 2614 CustomButton* hot_button = CustomButton::AsCustomButton(hot_view); | 2615 CustomButton* hot_button = CustomButton::AsCustomButton(hot_view); |
| 2615 if (hot_button) | 2616 if (hot_button) |
| 2616 hot_button->SetHotTracked(true); | 2617 hot_button->SetHotTracked(true); |
| 2617 } | 2618 } |
| 2618 | 2619 |
| 2619 } // namespace views | 2620 } // namespace views |
| OLD | NEW |