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

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 868473002: [Views] Don't reset button state after dragging if the button is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 11fbbcde1c5ccda74420d9c0a93dbdcfdf357695..d9db86712a2f3cb67838a6a55559459ef6a73ac0 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -273,7 +273,10 @@ void CustomButton::ShowContextMenu(const gfx::Point& p,
}
void CustomButton::OnDragDone() {
- SetState(STATE_NORMAL);
+ // Only reset the state to normal if the button isn't currently disabled
+ // (since disabled buttons may still be able to be dragged).
+ if (state_ != STATE_DISABLED)
+ SetState(STATE_NORMAL);
}
void CustomButton::GetAccessibleState(ui::AXViewState* state) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698