Chromium Code Reviews| 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() != views::InkDropState::ACTIVATED) { |
|
bruthig
2016/07/26 21:24:27
I think I'd feel better if this were configurable
mohsen
2016/08/17 05:31:35
I changed the code such that OnClickCanceled() is
| |
| 474 ui::LocatedEvent::FromIfValid(&event)); | 474 AnimateInkDrop(views::InkDropState::HIDDEN, |
| 475 ui::LocatedEvent::FromIfValid(&event)); | |
| 476 } | |
| 475 Button::OnClickCanceled(event); | 477 Button::OnClickCanceled(event); |
| 476 } | 478 } |
| 477 | 479 |
| 478 } // namespace views | 480 } // namespace views |
| OLD | NEW |