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

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

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

Powered by Google App Engine
This is Rietveld 408576698