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

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

Issue 2042883003: Fixed right-click/drag bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 905f81d07696a7e3989266b4d1ce456f9f97bbcd..ec99b60f798f6752749e6d4975d3e12754b58efd 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -164,15 +164,16 @@ bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
bool CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
if (state_ != STATE_DISABLED) {
+ bool should_enter_pushed = ShouldEnterPushedState(event);
if (HitTestPoint(event.location())) {
- SetState(ShouldEnterPushedState(event) ? STATE_PRESSED : STATE_HOVERED);
- if (!InDrag() && ink_drop_delegate() &&
+ SetState(should_enter_pushed ? STATE_PRESSED : STATE_HOVERED);
+ if (!InDrag() && should_enter_pushed && ink_drop_delegate() &&
ink_drop_delegate()->GetTargetInkDropState() ==
views::InkDropState::HIDDEN)
ink_drop_delegate()->OnAction(views::InkDropState::ACTION_PENDING);
} else {
SetState(STATE_NORMAL);
- if (!InDrag() && ink_drop_delegate() &&
+ if (!InDrag() && should_enter_pushed && ink_drop_delegate() &&
ink_drop_delegate()->GetTargetInkDropState() ==
views::InkDropState::ACTION_PENDING)
ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN);
« 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