OLD | NEW |
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/button/custom_button.h" | 5 #include "ui/views/controls/button/custom_button.h" |
6 | 6 |
7 #include "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
8 #include "ui/base/material_design/material_design_controller.h" | 8 #include "ui/base/material_design/material_design_controller.h" |
9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 void CustomButton::NotifyClick(const ui::Event& event) { | 464 void CustomButton::NotifyClick(const ui::Event& event) { |
465 if (has_ink_drop_action_on_click_) { | 465 if (has_ink_drop_action_on_click_) { |
466 AnimateInkDrop(InkDropState::ACTION_TRIGGERED, | 466 AnimateInkDrop(InkDropState::ACTION_TRIGGERED, |
467 ui::LocatedEvent::FromIfValid(&event)); | 467 ui::LocatedEvent::FromIfValid(&event)); |
468 } | 468 } |
469 Button::NotifyClick(event); | 469 Button::NotifyClick(event); |
470 } | 470 } |
471 | 471 |
472 void CustomButton::OnClickCanceled(const ui::Event& event) { | 472 void CustomButton::OnClickCanceled(const ui::Event& event) { |
473 AnimateInkDrop(views::InkDropState::HIDDEN, | 473 if (ink_drop()->GetTargetInkDropState() == |
474 ui::LocatedEvent::FromIfValid(&event)); | 474 views::InkDropState::ACTION_PENDING || |
| 475 ink_drop()->GetTargetInkDropState() == |
| 476 views::InkDropState::ALTERNATE_ACTION_PENDING) { |
| 477 AnimateInkDrop(views::InkDropState::HIDDEN, |
| 478 ui::LocatedEvent::FromIfValid(&event)); |
| 479 } |
475 Button::OnClickCanceled(event); | 480 Button::OnClickCanceled(event); |
476 } | 481 } |
477 | 482 |
478 } // namespace views | 483 } // namespace views |
OLD | NEW |