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

Unified Diff: ui/views/controls/menu/menu_item_view.h

Issue 1775533002: Fixes incorrect clearing of hot-tracked state when context menu is opened from a menu item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moves hot_button tracking from MenuController to MenuItemView Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_item_view.h
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index d6a22bfdc05bbe020045ab90cd89428f1a8bff7e..207e8e1931c78b48810c6cb1845c422b0f66afbf 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -39,6 +39,7 @@ namespace test {
class TestMenuItemViewShown;
}
+class CustomButton;
class MenuController;
class MenuDelegate;
class SubmenuView;
@@ -312,6 +313,11 @@ class VIEWS_EXPORT MenuItemView : public View {
// Sizes any child views.
void Layout() override;
+ CustomButton* hot_button() const { return hot_button_; }
+
+ // Updates the current |hot_button_| and its hot tracked state.
+ void SetHotTrackedButton(CustomButton* hot_button);
+
// Returns true if the menu has mnemonics. This only useful on the root menu
// item.
bool has_mnemonics() const { return has_mnemonics_; }
@@ -334,7 +340,10 @@ class VIEWS_EXPORT MenuItemView : public View {
void ChildPreferredSizeChanged(View* child) override;
+ // View:
const char* GetClassName() const override;
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override;
// Returns the preferred size (and padding) of any children.
virtual gfx::Size GetChildPreferredSize() const;
@@ -520,6 +529,9 @@ class VIEWS_EXPORT MenuItemView : public View {
// containing other elements.
bool use_right_margin_;
+ // Current hot tracked child button if any.
+ CustomButton* hot_button_;
+
DISALLOW_COPY_AND_ASSIGN(MenuItemView);
};

Powered by Google App Engine
This is Rietveld 408576698