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

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

Issue 2832823002: Update avatar button to MD (Closed)
Patch Set: Fixed bad merge that duplicated the GetMinimizeButtonHeight() method in some files Created 3 years, 8 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
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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698