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

Unified Diff: ui/views/controls/button/menu_button.h

Issue 873513002: [Views] Make MenuButton track its desired state while pressed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/menu_button.h
diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h
index 39a490bc319ec36069f49bbb6fb37dae4f8a93f0..dbff53c186935a1c848e9ffeb62a11e0f6997c15 100644
--- a/ui/views/controls/button/menu_button.h
+++ b/ui/views/controls/button/menu_button.h
@@ -87,6 +87,7 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
// Overridden from CustomButton:
bool ShouldEnterPushedState(const ui::Event& event) override;
+ void StateChanged() override;
// Offset of the associated menu position.
gfx::Point menu_offset_;
@@ -127,6 +128,11 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
// The current number of "pressed" locks this button has.
int pressed_lock_count_;
+ // True if the button was in a disabled state when a menu was run, and should
+ // return to it once the press is complete. This can happen if, e.g., we
+ // programmatically show a menu on a disabled button.
+ bool should_disable_after_press_;
+
base::WeakPtrFactory<MenuButton> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuButton);
« no previous file with comments | « no previous file | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698